mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
Use dedent for the kubectl commands
The one side effect is that for the "kubectl help" commands a newline is prepended to output, which will alter the yaml output. Here we use dedent to format the code to match the output. hack/update-generated-docs.sh has been run and the affected files have been added. Note: for describe.go we added a period to the end of an output message.
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/renstrom/dedent"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/kubernetes/pkg/kubectl"
|
||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
@@ -33,25 +34,27 @@ type StopOptions struct {
|
||||
Recursive bool
|
||||
}
|
||||
|
||||
const (
|
||||
stop_long = `Deprecated: Gracefully shut down a resource by name or filename.
|
||||
var (
|
||||
stop_long = dedent.Dedent(`
|
||||
Deprecated: Gracefully shut down a resource by name or filename.
|
||||
|
||||
The stop command is deprecated, all its functionalities are covered by delete command.
|
||||
See 'kubectl delete --help' for more details.
|
||||
The stop command is deprecated, all its functionalities are covered by delete command.
|
||||
See 'kubectl delete --help' for more details.
|
||||
|
||||
Attempts to shut down and delete a resource that supports graceful termination.
|
||||
If the resource is scalable it will be scaled to 0 before deletion.`
|
||||
stop_example = `# Shut down foo.
|
||||
kubectl stop replicationcontroller foo
|
||||
Attempts to shut down and delete a resource that supports graceful termination.
|
||||
If the resource is scalable it will be scaled to 0 before deletion.`)
|
||||
stop_example = dedent.Dedent(`
|
||||
# Shut down foo.
|
||||
kubectl stop replicationcontroller foo
|
||||
|
||||
# Stop pods and services with label name=myLabel.
|
||||
kubectl stop pods,services -l name=myLabel
|
||||
# Stop pods and services with label name=myLabel.
|
||||
kubectl stop pods,services -l name=myLabel
|
||||
|
||||
# Shut down the service defined in service.json
|
||||
kubectl stop -f service.json
|
||||
# Shut down the service defined in service.json
|
||||
kubectl stop -f service.json
|
||||
|
||||
# Shut down all resources in the path/to/resources directory
|
||||
kubectl stop -f path/to/resources`
|
||||
# Shut down all resources in the path/to/resources directory
|
||||
kubectl stop -f path/to/resources`)
|
||||
)
|
||||
|
||||
func NewCmdStop(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
|
||||
Reference in New Issue
Block a user