mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Change all cobra commands to use the example section
This will output the examples in their own section, rather than as part of the 'long' synposis.
This commit is contained in:
@@ -27,28 +27,27 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
updatePeriod = "1m0s"
|
||||
timeout = "5m0s"
|
||||
pollInterval = "3s"
|
||||
updatePeriod = "1m0s"
|
||||
timeout = "5m0s"
|
||||
pollInterval = "3s"
|
||||
rollingupdate_long = `Perform a rolling update of the given ReplicationController.
|
||||
|
||||
Replaces the specified controller with new controller, updating one pod at a time to use the
|
||||
new PodTemplate. The new-controller.json must specify the same namespace as the
|
||||
existing controller and overwrite at least one (common) label in its replicaSelector.`
|
||||
rollingupdate_example = `// Update pods of frontend-v1 using new controller data in frontend-v2.json.
|
||||
$ kubectl rollingupdate frontend-v1 -f frontend-v2.json
|
||||
|
||||
// Update pods of frontend-v1 using JSON data passed into stdin.
|
||||
$ cat frontend-v2.json | kubectl rollingupdate frontend-v1 -f -`
|
||||
)
|
||||
|
||||
func (f *Factory) NewCmdRollingUpdate(out io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "rollingupdate <old-controller-name> -f <new-controller.json>",
|
||||
Short: "Perform a rolling update of the given ReplicationController.",
|
||||
Long: `Perform a rolling update of the given ReplicationController.
|
||||
|
||||
Replaces the specified controller with new controller, updating one pod at a time to use the
|
||||
new PodTemplate. The new-controller.json must specify the same namespace as the
|
||||
existing controller and overwrite at least one (common) label in its replicaSelector.
|
||||
|
||||
Examples:
|
||||
|
||||
// Update pods of frontend-v1 using new controller data in frontend-v2.json.
|
||||
$ kubectl rollingupdate frontend-v1 -f frontend-v2.json
|
||||
|
||||
// Update pods of frontend-v1 using JSON data passed into stdin.
|
||||
$ cat frontend-v2.json | kubectl rollingupdate frontend-v1 -f -`,
|
||||
Use: "rollingupdate <old-controller-name> -f <new-controller.json>",
|
||||
Short: "Perform a rolling update of the given ReplicationController.",
|
||||
Long: rollingupdate_long,
|
||||
Example: rollingupdate_example,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
filename := util.GetFlagString(cmd, "filename")
|
||||
if len(filename) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user