Skip to content
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

🤖 Sync from open-cluster-management-io/config-policy-controller: #192 #695

Closed
wants to merge 4 commits into from

Conversation

magic-mirror-bot[bot]
Copy link

ComplianceType and RemediationActions were previously checked inline
with string comparisons. This is more easily readable, and potentially
better able to be changed in the future.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit e6deab6)
It was decided to use RawExtension for the "embedded" Subscription and
OperatorGroup, this can better allow for possible version skew in the
future. The CRD validation would be limited inside the policy framework
anyway because in a Policy, the raw content has no validation.

This also removes some fields which are not expected to be functional
in the initial release.

The `build*` functions have been updated to use the RawExtension, and
may have been adjusted for some other incoming changes. Some other
temporary changes were made to resolve compilation errors and unit
tests, but the OperatorPolicy "e2e" tests were not considered.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit 362ca28)
The previous version of this function was only applicable to a Policy
owning a ConfigurationPolicy. Now it is more broadly applicable.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit 7ef6c39)
The general plan is to continue adding `handle*` functions for the other
resources that an OperatorPolicy needs to examine. Each handle function
will update the policy's status (with conditions and relatedObjects),
and possibly emit compliance events. This may cause more compliance
events "than usual" compared to other controllers, but I think the
separation of concerns will help each function be more maintainable.

My hope is that some of the `*Cond` and `*Obj` functions in the status
section can be reused in the future handlers. There was already overlap
between the Subscription and OperatorGroup, so this seemed reasonable.

To check if the Subscription/OperatorGroup on the cluster matches what
is desired by the policy, a function `handleKeys` was created that
can be used for OperatorPolicies and ConfigurationPolicies.

Refs:
 - https://issues.redhat.com/browse/ACM-9283

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit 56ace86)
Copy link

openshift-ci bot commented Jan 31, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: magic-mirror-bot[bot]
Once this PR has been reviewed and has the lgtm label, please assign mprahl for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dhaiducek
Copy link
Contributor

Closing in favor of:

@dhaiducek dhaiducek closed this Feb 1, 2024
@dhaiducek dhaiducek deleted the magic-mirror-main-1706718332869 branch July 3, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants