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

Require objectDefinition and remediationAction #183

Conversation

dhaiducek
Copy link
Member

Without these fields, the policy is meaningless. When they're optional, a ConfigurationPolicy can be created without an objectDefinition and, if there was an attempt to put the object at the objectDefinition level (i.e. apiVersion, kind, metadata), all those fields get wiped out without notice for the user. It'd be a better experience to make these required and surface the error sooner.

I tested it out, and the status is returned properly:

NonCompliant; template-error; Failed to create policy template: ConfigurationPolicy.policy.open-cluster-management.io "7799-policy-crd" is invalid: spec.object-templates[0].objectDefinition: Required value

@dhaiducek
Copy link
Member Author

We could alternatively set a default for remediationAction?

@dhaiducek
Copy link
Member Author

/hold for review (and a Jira, if reviews are positive)

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.

¯\_(ツ)_/¯ seems good to me

Without these fields, the policy is meaningless. When they're optional,
a ConfigurationPolicy can be created without an `objectDefinition`.
It'd be a better experience to make these required and surface the
error sooner.

ref: https://issues.redhat.com/browse/ACM-8898

Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
@dhaiducek
Copy link
Member Author

/unhold

@openshift-ci openshift-ci bot added the lgtm label Dec 5, 2023
Copy link

openshift-ci bot commented Dec 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, JustinKuli, 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:
  • OWNERS [JustinKuli,dhaiducek,mprahl]

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

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.

3 participants