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 192 193 194 #701

Merged
merged 8 commits into from
Feb 1, 2024
Merged

Sync 192 193 194 #701

merged 8 commits into from
Feb 1, 2024

Conversation

JustinKuli and others added 8 commits February 1, 2024 09:27
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)
ref: https://issues.redhat.com/browse/ACM-9734
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
(cherry picked from commit 4bfdf6e)
Loop variables are re-used in different iterations, which means taking
the address of one can lead to unexpected results.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit 2d589d4)
This might prevent conditions of the same type from being duplicated
in the status.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit 1895478)
There was already one like this when the OperatorGroup was not being
specified in the OperatorPolicy, but this helps keep things complete.

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

sonarcloud bot commented Feb 1, 2024

Copy link

openshift-ci bot commented Feb 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, JustinKuli

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:
  • OWNERS [JustinKuli,dhaiducek]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 429e350 into main Feb 1, 2024
14 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the sync-192-193-194 branch February 1, 2024 18:31
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.

😿 Failed to sync the upstream PRs: #192
2 participants