-
Notifications
You must be signed in to change notification settings - Fork 39.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require distinct image for kubectl rolling-update NAME --image=IMAGE
#15908
Conversation
Labelling this PR as size/XS |
In case it's not clear why we want this restriction, it's to try to prevent users getting themselves in a weird state, and in particular to block use of this command with the The assumption that |
GCE e2e test build/test passed for commit ec11f1f67e9c3d8f82155cddbd2c6cfa56ae6804. |
@@ -229,6 +229,12 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg | |||
// than the old rc. This selector is the hash of the rc, which will differ because the new rc has a | |||
// different image. | |||
if len(image) != 0 { | |||
if len(oldRc.Spec.Template.Spec.Containers) > 1 { | |||
return cmdutil.UsageError(cmd, "Image update is not supported for multi-container pods") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we already have an error for that somewhere? #13483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in rolling_updater. Removed superfluous check.
Cases to think about:
As long as you're doing this, could you also address #9045? |
47e76e0
to
6fba1ff
Compare
Require distinct image from current one when starting a new rolling-update, and exit with error if an existing in-progress update is targeting a different image.
6fba1ff
to
5bf993b
Compare
PTAL. I changed it to print the error message about requiring a distinct image name when starting a fresh rolling update. Added check for matching image name on resuming an interrupted rolling update that tells the user to either continue the existing rollback with the in-progress image, or revert it with |
GCE e2e test build/test passed for commit 47e76e0da558c7cb6e0f1afd7611fa1f1fe8536f. |
GCE e2e test build/test passed for commit 6fba1fff0ccda5f6b82f8b00687b1bf50e4589e7. |
GCE e2e test build/test passed for commit 5bf993b. |
Thanks much. LGTM. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 5bf993b. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 5bf993b. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
Fixes #9045
@kubernetes/kubectl