-
Notifications
You must be signed in to change notification settings - Fork 147
never let PodTemplateSpec rewrite Host Profiler seccomp init container #3135
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
aed9541
cd85d77
74695b6
ca9687e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,11 @@ func PodTemplateSpec(logger logr.Logger, manager feature.PodTemplateManagers, ov | |
| } | ||
|
|
||
| for i, initContainer := range manager.PodTemplateSpec().Spec.InitContainers { | ||
| // host-profiler-seccomp-setup copies a seccomp profile JSON baked into the profiler image, not the agent image | ||
| // until the profiler is bundled in the agent. | ||
| if apicommon.AgentContainerName(initContainer.Name) == apicommon.HostProfilerSeccompSetupContainerName { | ||
| continue | ||
|
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Host Profiler is enabled and Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @theomagellan I wonder if this implies that
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fyi, global settings may modify image registry and suffix
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👋 Thank you for this! I added skip checks there as well. See 74695b6 |
||
| } | ||
| manager.PodTemplateSpec().Spec.InitContainers[i].Image = images.OverrideAgentImage(initContainer.Image, override.Image) | ||
| if override.Image.PullPolicy != nil { | ||
| manager.PodTemplateSpec().Spec.InitContainers[i].ImagePullPolicy = *override.Image.PullPolicy | ||
|
|
||
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.
When
spec.override.nodeAgent.image.pullPolicyis set, thiscontinueskips both the image rewrite and the pull-policy assignment below, sohost-profiler-seccomp-setupkeeps its default pull policy while thehost-profilercontainer is updated. In clusters that reuse a mutable profiler tag and setAlways/Nevervia the override, the init container can copy a stale or disallowed seccomp JSON before the main profiler image is pulled with the requested policy. The skip should avoid only changing the image, while still honoringoverride.Image.PullPolicyfor this init container.Useful? React with 👍 / 👎.
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.
The Host Profiler is only supported through annotations with the
image-override-config.spec.override.nodeAgent.image.pullPolicydoesn't apply to the annotation.