mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #15908 from jlowdermilk/rolling-update-doc
Auto commit by PR queue bot
This commit is contained in:
commit
a10ed3e2b1
@ -36,7 +36,7 @@ existing replication controller and overwrite at least one (common) label in its
|
||||
|
||||
.PP
|
||||
\fB\-\-image\fP=""
|
||||
Image to use for upgrading the replication controller. Can not be used with \-\-filename/\-f
|
||||
Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with \-\-filename/\-f
|
||||
|
||||
.PP
|
||||
\fB\-\-no\-headers\fP=false
|
||||
|
@ -72,7 +72,7 @@ $ kubectl rolling-update frontend --image=image:v2
|
||||
--deployment-label-key="deployment": The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise
|
||||
--dry-run[=false]: If true, print out the changes that would be made, but don't actually make them.
|
||||
-f, --filename=[]: Filename or URL to file to use to create the new replication controller.
|
||||
--image="": Image to use for upgrading the replication controller. Can not be used with --filename/-f
|
||||
--image="": Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f
|
||||
--no-headers[=false]: When using the default output, don't print headers.
|
||||
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
|
||||
--output-version="": Output the formatted object with the given version (default api-version).
|
||||
@ -119,7 +119,7 @@ $ kubectl rolling-update frontend --image=image:v2
|
||||
|
||||
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
||||
|
||||
###### Auto generated by spf13/cobra on 9-Oct-2015
|
||||
###### Auto generated by spf13/cobra on 19-Oct-2015
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
|
@ -90,7 +90,7 @@ func NewCmdRollingUpdate(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
usage := "Filename or URL to file to use to create the new replication controller."
|
||||
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
|
||||
cmd.MarkFlagRequired("filename")
|
||||
cmd.Flags().String("image", "", "Image to use for upgrading the replication controller. Can not be used with --filename/-f")
|
||||
cmd.Flags().String("image", "", "Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f")
|
||||
cmd.MarkFlagRequired("image")
|
||||
cmd.Flags().String("deployment-label-key", "deployment", "The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise")
|
||||
cmd.Flags().Bool("dry-run", false, "If true, print out the changes that would be made, but don't actually make them.")
|
||||
@ -235,8 +235,14 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
|
||||
return err
|
||||
}
|
||||
if newRc != nil {
|
||||
if inProgressImage := newRc.Spec.Template.Spec.Containers[0].Image; inProgressImage != image {
|
||||
return cmdutil.UsageError(cmd, "Found existing in-progress update to image (%s).\nEither continue in-progress update with --image=%s or rollback with --rollback", inProgressImage, inProgressImage)
|
||||
}
|
||||
fmt.Fprintf(out, "Found existing update in progress (%s), resuming.\n", newRc.Name)
|
||||
} else {
|
||||
if oldRc.Spec.Template.Spec.Containers[0].Image == image {
|
||||
return cmdutil.UsageError(cmd, "Specified --image must be distinct from existing container image")
|
||||
}
|
||||
newRc, err = kubectl.CreateNewControllerFromCurrentController(client, cmdNamespace, oldName, newName, image, deploymentKey)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user