-
Notifications
You must be signed in to change notification settings - Fork 260
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
Configure Compliance Operator for ROSA HCP #510
Configure Compliance Operator for ROSA HCP #510
Conversation
As mentioned in the Compliance Operator documentation, when installed on ROSA hosted control planes, a special node selector must be configured for the operator to run. This update uses conditionals to only make this configuration only on those clusters. Refs: - https://issues.redhat.com/browse/ACM-14161 Signed-off-by: Justin Kulikauskas <[email protected]>
This conditionally configures a node selector to allow the operator to run on ROSA HCP clusters. This update matches what is in the policy-collection. Refs: - https://issues.redhat.com/browse/ACM-14161 - open-cluster-management-io/policy-collection#510 Signed-off-by: Justin Kulikauskas <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JustinKuli, yiraeChristineKim 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 |
b57156c
into
open-cluster-management-io:main
@@ -51,3 +51,9 @@ spec: | |||
namespace: openshift-compliance | |||
source: redhat-operators | |||
sourceNamespace: openshift-marketplace | |||
# Conditionally configure a nodeSelector for installing on ROSA hosted control planes | |||
config: '{{ if and (eq "ROSA" (fromClusterClaim |
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.
Nice work! Not necessary to update now, but this would be cleaner as a folded multiline string:
config: >-
{{ if and
(eq "ROSA" (fromClusterClaim "product.open-cluster-management.io"))
(eq "true" (fromClusterClaim "hostedcluster.hypershift.openshift.io"))
}}
{"nodeSelector":{"node-role.kubernetes.io/worker":""} }
{{ else }}
{{ "{}" | toLiteral }}
{{ end }}
But actually, now that I do that, it looks like it'd fail--it has an extra }
in there after the nodeSelector?
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.
Using >-
is generally a good idea! But multiline yaml can be incredibly frustrating. In this case, the indents break the line folding, so I think this would be necessary:
config: >-
{{ if and
(eq "ROSA" (fromClusterClaim "product.open-cluster-management.io"))
(eq "true" (fromClusterClaim "hostedcluster.hypershift.openshift.io"))
}}
{"nodeSelector":{"node-role.kubernetes.io/worker":""} }
{{ else }}
{{ "{}" | toLiteral }}
{{ end }}
You also had a space at the end of the first line, emphasizing how tricky this is.
This conditionally configures a node selector to allow the operator to run on ROSA HCP clusters. This update matches what is in the policy-collection. Refs: - https://issues.redhat.com/browse/ACM-14161 - open-cluster-management-io/policy-collection#510 Signed-off-by: Justin Kulikauskas <[email protected]>
This conditionally configures a node selector to allow the operator to run on ROSA HCP clusters. This update matches what is in the policy-collection. Refs: - https://issues.redhat.com/browse/ACM-14161 - open-cluster-management-io/policy-collection#510 Signed-off-by: Justin Kulikauskas <[email protected]>
As mentioned in the Compliance Operator documentation, when installed on ROSA hosted control planes, a special node selector must be configured for the operator to run. This update uses conditionals to only make this configuration only on those clusters.
Refs: