-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
UPSTREAM: Do not mutate pods on update that are scheduled #15190
Conversation
187bc09
to
1fc5fb1
Compare
@@ -53,7 +55,11 @@ func (a *alwaysPullImages) Admit(attributes admission.Attributes) (err error) { | |||
if !ok { | |||
return apierrors.NewBadRequest("Resource was marked with kind Pod but was unable to be converted") | |||
} | |||
|
|||
// already scheduled pods cannot be mutated | |||
if attributes.GetOperation() == admission.Update && len(pod.Spec.NodeName) != 0 { |
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.
I don't know why this plugin is looking at update at all... ImagePullPolicy is never mutable
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.
I'll remove it.
d6e21cc
to
c9a6d22
Compare
@@ -75,6 +77,12 @@ func (p *plugin) Admit(attributes admission.Attributes) (err error) { | |||
return errors.NewBadRequest(fmt.Sprintf("expected *api.Pod but got %T", attributes.GetObject())) | |||
} | |||
|
|||
// already scheduled pods cannot be mutated | |||
if attributes.GetOperation() == admission.Update { |
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.
why not just remove Update from Handler: admission.NewHandler(admission.Create, admission.Update)
?
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.
Tolerations are mutable post create
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.
crap, they're only addable.... GRRRRRRRRRRR
They fail validation
c9a6d22
to
43e60df
Compare
Evaluated for origin test up to 43e60df |
Stripped down to the minimal change to prevent alwayspullimages for 3.6, and will deal with defaulttolerationseconds upstream and later. |
LGTM |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/3183/) (Base Commit: e1d18a3) (PR Branch Commit: 43e60df) |
[merge] |
continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 1 |
Evaluated for origin merge up to 43e60df |
That is an illegal operation in validation, which means these cannot be turned on after a cluster is already running.
[test] @deads2k
Fixes #15188
Will update commit with correct upstream shortly