-
Notifications
You must be signed in to change notification settings - Fork 88
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
feat: configure workspace security context for container builds #1549
Conversation
Hi @AObuchow. Thanks for your PR. I'm waiting for a eclipse-che member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
@@ Coverage Diff @@
## main #1549 +/- ##
==========================================
+ Coverage 59.02% 60.56% +1.53%
==========================================
Files 74 73 -1
Lines 6418 6306 -112
==========================================
+ Hits 3788 3819 +31
+ Misses 2261 2147 -114
+ Partials 369 340 -29
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Andrew Obuchowicz <[email protected]>
69fecad
to
773900f
Compare
Signed-off-by: Andrew Obuchowicz <[email protected]>
c1d3159
to
37263ee
Compare
@tolusha Sorry about that, will fix failing tests |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AObuchow, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fix eclipse-che/che#21770 Signed-off-by: Andrew Obuchowicz <[email protected]>
Signed-off-by: Andrew Obuchowicz <[email protected]>
Signed-off-by: Andrew Obuchowicz <[email protected]>
70eeb4e
to
825d048
Compare
@AObuchow: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@AObuchow: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
closed in favor of #1576 |
What does this PR do?
Configures the
workspace.containerSecurityContext
field of the Che-Operator-owned DWOC depending on the value ofdevEnvironments.disableContainerBuildCapabilities
in the Che Cluster CR.If
devEnvironments.disableContainerBuildCapabilities
is set tofalse
, then the DWOC'sworkspace.containerSecurityContext
is configured as follows:If
devEnvironments.disableContainerBuildCapabilities
is set totrue
, then the DWOC'sworkspace.containerSecurityContext
field is cleared.Screenshot/screencast of this PR
n/a
What issues does this PR fix or reference?
eclipse-che/che#21770
How to test this PR?
Some extra automated tests were added for this PR.
In terms of manual testing, there are 2 relevant cases (the first one concerns the core functionality this PR adds, and the second one ensures that the appropriate SCC is used when testing Che on OpenShift):
Ensuring the Che-Operator-owned DWOC is correctly configured (Minikube)
quay.io/aobuchow/dwo-container-security-context
.quay.io/aobuchow/che-operator:next
chectl server:deploy --installer operator -p minikube --che-operator-image=quay.io/aobuchow/che-operator:next
workspace.containerSecurityContext
field by default.oc describe dwoc -n eclipse-che
devEnvironments.disableContainerBuildCapabilities
totrue
the Che Cluster CR:workspace.containerSecurityContext
field configured with the correct container security context:oc describe dwoc -n eclipse-che
devEnvironments.disableContainerBuildCapabilities
tofalse
the Che Cluster CR.workspace.containerSecurityContext
field has been cleared from the Che-Operator-owned DWOC:oc describe dwoc -n eclipse-che
Ensuring containers can be built on OpenShift with an SCC present that has higher priority than container-build
oc apply -f
apply the following catalogsource and then install DWO from OperatorHub:chectl server:deploy -p openshift --che-operator-image=quay.io/aobuchow/che-operator:next
devEnvironments.disableContainerBuildCapabilities
tofalse
the Che Cluster CR.controller.devfile.io/scc
attribute yet. Note: For Step 3. Let the user creating the DevWorkspace use the container-build SCC requires you to have a user other thankube:admin
on your cluster. I personally create other users with HTPasswdkube:admin
), create a workspace that uses thecontroller.devfile.io/scc
attribute (Step 4 from the SCC PR)openshift.io/scc: container-build
annotation is set.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.