Skip to content

Add the spec.copyPolicyMetadata field #91

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

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Add the spec.copyPolicyMetadata field #91

merged 1 commit into from
Jan 30, 2023

Conversation

mprahl
Copy link
Member

@mprahl mprahl commented Jan 27, 2023

This new field allows a replicated policy to not have labels and annotations that are not managed by the policy framework. This is useful in the case where policies are deployed with ArgoCD and you don't want them to show up in the ArgoCD UI.

Additionally, the argocd.argoproj.io/compare-options annotation is now always set to IgnoreExtraneous on the replicated policies to avoid ArgoCD trying to manage the replicated policies.

Relates:
https://issues.redhat.com/browse/ACM-1690

// If set to false, only the policy framework specific policy labels and annotations will be copied to the
// replicated policy.
// +kubebuilder:validation:Optional
CopyPolicyMetadata *bool `json:"copyPolicyMetadata,omitempty"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is a pointer to avoid setting a default in the CRD to always cause this field to be shown when unset.

dhaiducek
dhaiducek previously approved these changes Jan 30, 2023
Copy link
Member

@dhaiducek dhaiducek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold

LGTM! Not sure whether other reviews are needed--unhold if not! 🙂

@mprahl
Copy link
Member Author

mprahl commented Jan 30, 2023

/hold

LGTM! Not sure whether other reviews are needed--unhold if not! slightly_smiling_face

Thanks for the review!

I'll wait for a second +1 since it is a CRD change.

JustinKuli
JustinKuli previously approved these changes Jan 30, 2023
Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

This new field allows a replicated policy to not have labels and
annotations that are not managed by the policy framework. This is useful
in the case where policies are deployed with ArgoCD and you don't want
them to show up in the ArgoCD UI.

Additionally, the argocd.argoproj.io/compare-options annotation is now
always set to IgnoreExtraneous on the replicated policies to avoid
ArgoCD trying to manage the replicated policies.

Relates:
https://issues.redhat.com/browse/ACM-1690

Signed-off-by: mprahl <[email protected]>
@mprahl mprahl dismissed stale reviews from JustinKuli and dhaiducek via 64660bd January 30, 2023 20:27
@openshift-ci openshift-ci bot removed the lgtm label Jan 30, 2023
@mprahl mprahl changed the title Add the spec.copyMetadataField Add the spec.copyPolicyMetadata field Jan 30, 2023
@mprahl
Copy link
Member Author

mprahl commented Jan 30, 2023

@dhaiducek and @JustinKuli , I realized I had a typo in the commit subject, so I had to force push. Could you please approve it again?

Copy link
Member

@dhaiducek dhaiducek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and now I have two e-mail threads for this PR 😉

@openshift-ci openshift-ci bot added the lgtm label Jan 30, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jan 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@mprahl
Copy link
Member Author

mprahl commented Jan 30, 2023

/unhold

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.

4 participants