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
17c005bb
Commit
17c005bb
authored
Aug 17, 2015
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12730 from eparis/bash-completions-delete-label
bashcompletions: suggest resources to delete in kubectl delete
parents
5d58c2ca
9b2ac753
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
kubectl
contrib/completions/bash/kubectl
+15
-0
delete.go
pkg/kubectl/cmd/delete.go
+4
-0
No files found.
contrib/completions/bash/kubectl
View file @
17c005bb
...
...
@@ -426,6 +426,21 @@ _kubectl_delete()
must_have_one_flag
=()
must_have_one_noun
=()
must_have_one_noun+
=(
"componentstatus"
)
must_have_one_noun+
=(
"endpoints"
)
must_have_one_noun+
=(
"event"
)
must_have_one_noun+
=(
"limitrange"
)
must_have_one_noun+
=(
"namespace"
)
must_have_one_noun+
=(
"node"
)
must_have_one_noun+
=(
"persistentvolume"
)
must_have_one_noun+
=(
"persistentvolumeclaim"
)
must_have_one_noun+
=(
"pod"
)
must_have_one_noun+
=(
"podtemplate"
)
must_have_one_noun+
=(
"replicationcontroller"
)
must_have_one_noun+
=(
"resourcequota"
)
must_have_one_noun+
=(
"secret"
)
must_have_one_noun+
=(
"service"
)
must_have_one_noun+
=(
"serviceaccount"
)
}
_kubectl_namespace
()
...
...
pkg/kubectl/cmd/delete.go
View file @
17c005bb
...
...
@@ -58,6 +58,9 @@ $ kubectl delete pods --all`
)
func
NewCmdDelete
(
f
*
cmdutil
.
Factory
,
out
io
.
Writer
)
*
cobra
.
Command
{
p
:=
kubectl
.
NewHumanReadablePrinter
(
false
,
false
,
false
,
[]
string
{})
validArgs
:=
p
.
HandledResources
()
cmd
:=
&
cobra
.
Command
{
Use
:
"delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])"
,
Short
:
"Delete resources by filenames, stdin, resources and names, or by resources and label selector."
,
...
...
@@ -68,6 +71,7 @@ func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command {
err
:=
RunDelete
(
f
,
out
,
cmd
,
args
)
cmdutil
.
CheckErr
(
err
)
},
ValidArgs
:
validArgs
,
}
usage
:=
"Filename, directory, or URL to a file containing the resource to delete."
kubectl
.
AddJsonFilenameFlag
(
cmd
,
usage
)
...
...
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