-
Notifications
You must be signed in to change notification settings - Fork 216
OCPBUGS-22198: Reconcile Volumes in SCCs #985
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
OCPBUGS-22198: Reconcile Volumes in SCCs #985
Conversation
Clearly separate input/output. Do not use side effects on structures passed as input, pass output only via return value. Cover both `EnsureSecurityContextConstraint` and `ApplySecurityContextConstraintv1` with tests, including the fact that `Apply...` does *not* call `Ensure...` as expected, which is a bug reported as OCPBUGS-18386. The new tests need additional files to be vendored, which is done in a separate followup commit.
|
Skipping CI for Draft Pull Request. |
afcaf4b to
460caaf
Compare
Previously CVO only created SCC resources when they did not exist, but did not enforce any further state from the manifests afterwards, so e.g. SCC changes on updates were never propagated to the cluster. There is an existing `EnsureSecurityContextConstraint` method in the code, but it was not used anywhere. It is possible that calling it from `ApplySecurityContextConstraint` is all that is missing. The method has a "merge" semantics on various lists though (so the resulting state is the union of what is in the cluster and in the manifest), which plays nice and tolerates user changes. This behavior will be removed in a followup commit because we want CVO to strictly reconcile to the state desired in the manifest.
```console
$ oc explain scc.allowPrivilegeEscalation
KIND: SecurityContextConstraints
VERSION: security.openshift.io/v1
DESCRIPTION:
AllowPrivilegeEscalation determines if a pod can request to allow privilege
escalation. If unspecified, defaults to true.
```
Implemented following the same pattern like `clusterManifestDeleteInProgressUpgradeable`, unfortunately uses a global but trying to weave some communication channel through the builder hiearchy would result in a more invasive, and hence risky, change.
Because reconciling SCCs can endanger existing workloads, we only add the merging semantics for the `Volumes` field, because we need to carry updates we did in manifests. I have checked SCC manifests in 4.11, 4.12 and 4.13 payloads, and we only add items to `volumes`, so we do not need other fields for now. For other fields, only track _whether_ we would need to reconcile towards the manifest state, so that we can report this cluster state to the admin before they upgrade to 4.14 which changes the reconciliation behavior to strict.
|
/jira cherrypick OCPBUGS-19472 |
|
@petr-muller: Jira Issue OCPBUGS-19472 has been cloned as Jira Issue OCPBUGS-22198. Will retitle bug to link to clone. DetailsIn response to this:
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. |
|
@petr-muller: This pull request references Jira Issue OCPBUGS-22198, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
/jira refresh |
|
@petr-muller: This pull request references Jira Issue OCPBUGS-22198, which is invalid:
Comment DetailsIn response to this:
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. |
|
/test e2e-agnostic-ovn-upgrade-out-of-change Does not seem related, re-running |
|
@petr-muller: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/jira refresh |
|
@petr-muller: This pull request references Jira Issue OCPBUGS-22198, which is valid. The bug has been moved to the POST state. 6 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jianl@redhat.com), skipping review request. DetailsIn response to this:
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. |
|
/label qe-approved |
|
@petr-muller: This pull request references Jira Issue OCPBUGS-22198, which is valid. 6 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jianl@redhat.com), skipping review request. DetailsIn response to this:
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. |
|
/label cherry-pick-approved |
wking
left a comment
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.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: petr-muller, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/label backport-risk-assessed |
|
@petr-muller: Jira Issue OCPBUGS-22198: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-22198 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
|
Fix included in accepted release 4.12.0-0.nightly-2023-10-26-183149 |
And after the above, add 4855dd5 to remove the
Upgradeable=Falsegate and on ly warn in logs.