-
Notifications
You must be signed in to change notification settings - Fork 19
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
Sync 192 193 194 #701
Conversation
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)
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
[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:
Approvers can indicate their approval by writing |
Syncing:
Closes #696 (192 failed to sync because of an issue that is fixed in 194)