Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
39a9ec3a
Commit
39a9ec3a
authored
Aug 15, 2016
by
Silas Boyd-Wickizer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a short `-n` for `kubectl`'s `--namespace`
fixes #24078 --namespace is a very common flag for nearly every kubectl command we have. We should claim -n for it.
parent
929b238a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
kubectl-conventions.md
docs/devel/kubectl-conventions.md
+1
-0
test-cmd.sh
hack/make-rules/test-cmd.sh
+2
-0
overrides.go
pkg/client/unversioned/clientcmd/overrides.go
+1
-1
No files found.
docs/devel/kubectl-conventions.md
View file @
39a9ec3a
...
@@ -142,6 +142,7 @@ list when adding new short flags
...
@@ -142,6 +142,7 @@ list when adding new short flags
*
`-f`
: Resource file
*
`-f`
: Resource file
*
also used for
`--follow`
in
`logs`
, but should be deprecated in favor of
`-F`
*
also used for
`--follow`
in
`logs`
, but should be deprecated in favor of
`-F`
*
`-n`
: Namespace scope
*
`-l`
: Label selector
*
`-l`
: Label selector
*
also used for
`--labels`
in
`expose`
, but should be deprecated
*
also used for
`--labels`
in
`expose`
, but should be deprecated
*
`-L`
: Label columns
*
`-L`
: Label columns
...
...
hack/make-rules/test-cmd.sh
View file @
39a9ec3a
...
@@ -1349,6 +1349,8 @@ __EOF__
...
@@ -1349,6 +1349,8 @@ __EOF__
kubectl create
"
${
kube_flags
[@]
}
"
--namespace
=
other
-f
docs/admin/limitrange/valid-pod.yaml
kubectl create
"
${
kube_flags
[@]
}
"
--namespace
=
other
-f
docs/admin/limitrange/valid-pod.yaml
# Post-condition: valid-pod POD is created
# Post-condition: valid-pod POD is created
kube::test::get_object_assert
'pods --namespace=other'
"{{range.items}}{{
$id_field
}}:{{end}}"
'valid-pod:'
kube::test::get_object_assert
'pods --namespace=other'
"{{range.items}}{{
$id_field
}}:{{end}}"
'valid-pod:'
# Post-condition: verify shorthand `-n other` has the same results as `--namespace=other`
kube::test::get_object_assert
'pods -n other'
"{{range.items}}{{
$id_field
}}:{{end}}"
'valid-pod:'
### Delete POD valid-pod in specific namespace
### Delete POD valid-pod in specific namespace
# Pre-condition: valid-pod POD exists
# Pre-condition: valid-pod POD exists
...
...
pkg/client/unversioned/clientcmd/overrides.go
View file @
39a9ec3a
...
@@ -158,7 +158,7 @@ func RecommendedContextOverrideFlags(prefix string) ContextOverrideFlags {
...
@@ -158,7 +158,7 @@ func RecommendedContextOverrideFlags(prefix string) ContextOverrideFlags {
return
ContextOverrideFlags
{
return
ContextOverrideFlags
{
ClusterName
:
FlagInfo
{
prefix
+
FlagClusterName
,
""
,
""
,
"The name of the kubeconfig cluster to use"
},
ClusterName
:
FlagInfo
{
prefix
+
FlagClusterName
,
""
,
""
,
"The name of the kubeconfig cluster to use"
},
AuthInfoName
:
FlagInfo
{
prefix
+
FlagAuthInfoName
,
""
,
""
,
"The name of the kubeconfig user to use"
},
AuthInfoName
:
FlagInfo
{
prefix
+
FlagAuthInfoName
,
""
,
""
,
"The name of the kubeconfig user to use"
},
Namespace
:
FlagInfo
{
prefix
+
FlagNamespace
,
""
,
""
,
"If present, the namespace scope for this CLI request"
},
Namespace
:
FlagInfo
{
prefix
+
FlagNamespace
,
"
n
"
,
""
,
"If present, the namespace scope for this CLI request"
},
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment