-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Allow rolling-update of a single container in multi-container pods #17111
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
Labelling this PR as size/S |
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
I signed it! Signed as ASAP Compare Ltd. |
93a4108
to
967039d
Compare
} | ||
|
||
if !containerFound { | ||
return nil, goerrors.New(fmt.Sprintf("Container %s not found in pod", container)) |
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.
Use fmt.Errorf() instead of goerrors.New(fmt.Sprintf(
What happens when someone uses --container=name with a name not in the pod but there is only one container in the pod? |
cc @bgrant0607 @janetkuo @kubernetes/kubectl |
d3d60eb
to
64b7c8a
Compare
Labelling this PR as size/M |
64b7c8a
to
01b0ed6
Compare
Thanks for the comments. I've updated to account for specifying the container name when there's only one container in the pod (so if the user now specifies a container, it must exist within the pod regardless of the number of containers in the pod). Rebased & regenerated docs based off 1.1. |
if len(newRc.Spec.Template.Spec.Containers) > 1 { | ||
// TODO: support multi-container image update. | ||
return nil, goerrors.New("Image update is not supported for multi-container pods") | ||
if container != "" { |
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.
We follow a convention of comparing the length of a string against zero instead of an empty string. So this should be len(container) != 0
.
01b0ed6
to
337af99
Compare
a couple of nits, lgtm otherwise also a unit test would be appreciated |
I signed it |
CLAs look good, thanks! |
The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label? |
Thanks @munnerz, sorry about the long wait. |
@k8s-bot test this Tests are more than 48 hours old. Re-running tests. |
No worries, thanks for your help - any idea what release this'll be rolled into? |
CLAs look good, thanks! |
We typically only do cherrypick/patch releases for bug fixes, so this will get picked up by the next minor release, which would be 1.2. |
@k8s-bot ok to test |
GCE e2e test build/test passed for commit 61306c2. |
GCE e2e build/test failed for commit 61306c2. |
@k8s-bot test this |
GCE e2e build/test failed for commit 61306c2. |
@k8s-bot e2e test this |
GCE e2e test build/test passed for commit 61306c2. |
@k8s-bot test this Tests are more than 48 hours old. Re-running tests. |
GCE e2e build/test failed for commit 61306c2. |
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
@k8s-bot ok to test |
GCE e2e test build/test passed for commit 61306c2. |
Allow rolling-update of a single container in multi-container pods
This is a fix for #13483
It allows for the updating of a single containers image within a pod with multiple containers, in order to make rolling updates on multi-container pods easier.