-
Notifications
You must be signed in to change notification settings - Fork 107
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
Auto-select selinuxd image based on nodeInfo.OSImage #1600
Conversation
/hold |
Cluster nodes might be upgraded between major OS releases where the libselinux major version is incompatible. This means that the selinuxd image must be based on images matching the OS release and the libselinux major version. But SPO must also be able to select the images based on what OS are the cluster nodes running. To implement that, this patch adds a new key to the security-profiles-operator-profile configmap that maps regexes matching nodeInfo.OSImage to selinuxd images. The operator then selects the right selinuxd image, falling back to using the RELATED_IMAGE environment variable.
@@ -1,3 +1,3 @@ | |||
--- | |||
- path: /rules/2 | |||
- path: /rules/3 |
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.
In case someone is going wtf is this change..because I changed the spo role by adding a new permission, this overlay would have removed a permission at the wrong index:
diff --git a/deploy/webhook-operator.yaml b/deploy/webhook-operator.yaml
index cad32631..ed2ae5f8 100644
--- a/deploy/webhook-operator.yaml
+++ b/deploy/webhook-operator.yaml
@@ -2171,9 +2171,9 @@ rules:
- list
- watch
- apiGroups:
- - ""
+ - admissionregistration.k8s.io
resources:
- - services
+ - mutatingwebhookconfigurations
verbs:
- create
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhrozek, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Cluster nodes might be upgraded between major OS releases where the
libselinux major version is incompatible. This means that the selinuxd
image must be based on images matching the OS release and the libselinux
major version.
But SPO must also be able to select the images based on what OS are the
cluster nodes running.
To implement that, this patch adds a new key to the
security-profiles-operator-profile configmap that maps regexes matching
nodeInfo.OSImage to selinuxd images. The operator then selects the right
selinuxd image, falling back to using the
RELATED_IMAGE_SELINUXD
environmentvariable.
Which issue(s) this PR fixes:
Fixes #1576
Does this PR have test?
some unit tests
Special notes for your reviewer:
I'll hold this patch before I can install a RHEL-9 based cluster - I've
been having issues with that. But I wanted to get some early feedback.
Does this PR introduce a user-facing change?