-
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
deployment: carry over the securityContext from deployer to lifecycle hooks #12733
Conversation
There was some discussion upstream related to securityContext for contaienrs being broken but I can't remember if it was an issue or from the mailing list. |
@Kargakis if it was broken the deployer pod won't be working? |
Not necessarily. Found the discussion: kubernetes/kubeadm#107 |
@pweil- @php-coder can you confirm the securityContext is broken for SELinux? @Kargakis also it is possible to set |
looks like this was new to 1.12.5/1.13 |
@@ -397,6 +397,7 @@ func makeHookPod(hook *deployapi.LifecycleHook, rc *kapi.ReplicationController, | |||
Env: mergedEnv, | |||
Resources: resources, | |||
VolumeMounts: volumeMounts, | |||
SecurityContext: baseContainer.SecurityContext, |
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.
this is a pointer, should we be making a copy?
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 and should not be copied from baseContainer but from the deployment config...
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.
@pweil- fixed. finally ;)
a67f146
to
a9b8931
Compare
[test] @pweil- updated, ptal |
@@ -375,6 +375,11 @@ func makeHookPod(hook *deployapi.LifecycleHook, rc *kapi.ReplicationController, | |||
|
|||
gracePeriod := int64(10) | |||
|
|||
podSecurityContext, err := kapi.Scheme.DeepCopy(rc.Spec.Template.Spec.SecurityContext) |
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.
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.
@pweil- if DC has RC with more than 1 container, which one will you pick for the hook pod? ;-)
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.
you have to tell the hook pod the container name so it knows the image to use. That would be unique
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.
fixed
8d9383e
to
38576ca
Compare
… to lifecycle hook
38576ca
to
d026451
Compare
@pweil- updated, PTAL :) |
Evaluated for origin test up to d026451 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/569/) (Base Commit: 801b564) |
I'd also update the comment here: origin/pkg/deploy/strategy/support/lifecycle.go Lines 176 to 181 in 83e3250
|
good catch. (but will fix in next PR because I don't want to ruin the green test run of this ;-) |
[merge] |
Evaluated for origin merge up to d026451 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/569/) (Base Commit: ed285a1) (Image: devenv-rhel7_6119) |
Fixes: #12103