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
110ab79f
Commit
110ab79f
authored
Mar 10, 2015
by
Jerzy Szczepkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for labels to "kubectl stop".
Added support for labels and --all to "kubectl stop". Fixes #5178.
parent
6d465c4d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
4 deletions
+27
-4
kubectl-delete.md
docs/kubectl-delete.md
+1
-1
kubectl-stop.md
docs/kubectl-stop.md
+6
-1
kubectl-stop.1
docs/man/man1/kubectl-stop.1
+11
-0
delete.go
pkg/kubectl/cmd/delete.go
+1
-1
stop.go
pkg/kubectl/cmd/stop.go
+8
-1
No files found.
docs/kubectl-delete.md
View file @
110ab79f
...
@@ -17,7 +17,7 @@ submits an update to a resource right when you submit a delete, their update
...
@@ -17,7 +17,7 @@ submits an update to a resource right when you submit a delete, their update
will be lost along with the rest of the resource.
will be lost along with the rest of the resource.
```
```
kubectl delete (
[
-f filename
]
| (
<resource>
[
(<id> | -l <label> | --all)
]
kubectl delete (
-f filename |
<resource>
(
<id>
| -l
<label>
| --all))
### Examples
### Examples
...
...
docs/kubectl-stop.md
View file @
110ab79f
...
@@ -11,7 +11,7 @@ Attempts to shut down and delete a resource that supports graceful termination.
...
@@ -11,7 +11,7 @@ Attempts to shut down and delete a resource that supports graceful termination.
If the resource is resizable it will be resized to 0 before deletion.
If the resource is resizable it will be resized to 0 before deletion.
```
```
kubectl stop (
<resource>
<id>
|-f filename
)
kubectl stop (
-f filename |
<resource>
(
<id>
| -l
<label>
| --all)
)
### Examples
### Examples
...
@@ -19,6 +19,9 @@ kubectl stop (<resource> <id>|-f filename)
...
@@ -19,6 +19,9 @@ kubectl stop (<resource> <id>|-f filename)
// Shut down foo.
// Shut down foo.
$ kubectl stop replicationcontroller foo
$ kubectl stop replicationcontroller foo
// Stop pods and services with label name=myLabel.
$ kubectl stop pods,services -l name=myLabel
// Shut down the service defined in service.json
// Shut down the service defined in service.json
$ kubectl stop -f service.json
$ kubectl stop -f service.json
...
@@ -29,7 +32,9 @@ $ kubectl stop -f path/to/resources
...
@@ -29,7 +32,9 @@ $ kubectl stop -f path/to/resources
### Options
### Options
```
```
--all=false: [-all] to select all the specified resources
-f, --filename=[]: Filename, directory, or URL to file of resource(s) to be stopped
-f, --filename=[]: Filename, directory, or URL to file of resource(s) to be stopped
-l, --selector="": Selector (label query) to filter on
```
```
### Options inherrited from parent commands
### Options inherrited from parent commands
...
...
docs/man/man1/kubectl-stop.1
View file @
110ab79f
...
@@ -22,9 +22,17 @@ If the resource is resizable it will be resized to 0 before deletion.
...
@@ -22,9 +22,17 @@ If the resource is resizable it will be resized to 0 before deletion.
.SH OPTIONS
.SH OPTIONS
.PP
.PP
\fB\-\-all\fP=false
[\-all] to select all the specified resources
.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file of resource(s) to be stopped
Filename, directory, or URL to file of resource(s) to be stopped
.PP
\fB\-l\fP, \fB\-\-selector\fP=""
Selector (label query) to filter on
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
.PP
...
@@ -140,6 +148,9 @@ If the resource is resizable it will be resized to 0 before deletion.
...
@@ -140,6 +148,9 @@ If the resource is resizable it will be resized to 0 before deletion.
// Shut down foo.
// Shut down foo.
$ kubectl stop replicationcontroller foo
$ kubectl stop replicationcontroller foo
// Stop pods and services with label name=myLabel.
$ kubectl stop pods,services \-l name=myLabel
// Shut down the service defined in service.json
// Shut down the service defined in service.json
$ kubectl stop \-f service.json
$ kubectl stop \-f service.json
...
...
pkg/kubectl/cmd/delete.go
View file @
110ab79f
...
@@ -60,7 +60,7 @@ func (f *Factory) NewCmdDelete(out io.Writer) *cobra.Command {
...
@@ -60,7 +60,7 @@ func (f *Factory) NewCmdDelete(out io.Writer) *cobra.Command {
Filenames
util
.
StringList
Filenames
util
.
StringList
}{}
}{}
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"delete (
[-f filename] | (<resource> [(<id> | -l <label> | --all)]
"
,
Use
:
"delete (
-f filename | <resource> (<id> | -l <label> | --all))
"
,
Short
:
"Delete a resource by filename, stdin, or resource and ID."
,
Short
:
"Delete a resource by filename, stdin, or resource and ID."
,
Long
:
delete_long
,
Long
:
delete_long
,
Example
:
delete_example
,
Example
:
delete_example
,
...
...
pkg/kubectl/cmd/stop.go
View file @
110ab79f
...
@@ -34,6 +34,9 @@ If the resource is resizable it will be resized to 0 before deletion.`
...
@@ -34,6 +34,9 @@ If the resource is resizable it will be resized to 0 before deletion.`
stop_example
=
`// Shut down foo.
stop_example
=
`// Shut down foo.
$ kubectl stop replicationcontroller foo
$ kubectl stop replicationcontroller foo
// Stop pods and services with label name=myLabel.
$ kubectl stop pods,services -l name=myLabel
// Shut down the service defined in service.json
// Shut down the service defined in service.json
$ kubectl stop -f service.json
$ kubectl stop -f service.json
...
@@ -46,7 +49,7 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
...
@@ -46,7 +49,7 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
Filenames
util
.
StringList
Filenames
util
.
StringList
}{}
}{}
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"stop (
<resource> <id>|-f filename
)"
,
Use
:
"stop (
-f filename | <resource> (<id> | -l <label> | --all)
)"
,
Short
:
"Gracefully shut down a resource by id or filename."
,
Short
:
"Gracefully shut down a resource by id or filename."
,
Long
:
stop_long
,
Long
:
stop_long
,
Example
:
stop_example
,
Example
:
stop_example
,
...
@@ -59,6 +62,8 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
...
@@ -59,6 +62,8 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
NamespaceParam
(
cmdNamespace
)
.
RequireNamespace
()
.
NamespaceParam
(
cmdNamespace
)
.
RequireNamespace
()
.
ResourceTypeOrNameArgs
(
false
,
args
...
)
.
ResourceTypeOrNameArgs
(
false
,
args
...
)
.
FilenameParam
(
flags
.
Filenames
...
)
.
FilenameParam
(
flags
.
Filenames
...
)
.
SelectorParam
(
cmdutil
.
GetFlagString
(
cmd
,
"selector"
))
.
SelectAllParam
(
cmdutil
.
GetFlagBool
(
cmd
,
"all"
))
.
Flatten
()
.
Flatten
()
.
Do
()
Do
()
cmdutil
.
CheckErr
(
r
.
Err
())
cmdutil
.
CheckErr
(
r
.
Err
())
...
@@ -76,5 +81,7 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
...
@@ -76,5 +81,7 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
},
},
}
}
cmd
.
Flags
()
.
VarP
(
&
flags
.
Filenames
,
"filename"
,
"f"
,
"Filename, directory, or URL to file of resource(s) to be stopped"
)
cmd
.
Flags
()
.
VarP
(
&
flags
.
Filenames
,
"filename"
,
"f"
,
"Filename, directory, or URL to file of resource(s) to be stopped"
)
cmd
.
Flags
()
.
StringP
(
"selector"
,
"l"
,
""
,
"Selector (label query) to filter on"
)
cmd
.
Flags
()
.
Bool
(
"all"
,
false
,
"[-all] to select all the specified resources"
)
return
cmd
return
cmd
}
}
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