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

Unowned template panic #29

Conversation

JustinKuli
Copy link
Member

Some refactoring as well, but the more important bit is this commit:

Previously, if a Policy defined a template that already exists, it assumed that another Policy had defined it, and tried to get its owner reference in order to give a helpful error message. But if the template was created outside of a Policy, then this process would panic.

Refs:

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
Previously, if a Policy defined a template that already exists, it
assumed that another Policy had defined it, and tried to get its owner
reference in order to give a helpful error message. But if the template
was created outside of a Policy, then this process would panic.

Refs:
 - https://issues.redhat.com/browse/ACM-3416

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
Copy link
Member

@gparvin gparvin left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the fix and the code improvements.

@openshift-ci
Copy link

openshift-ci bot commented Feb 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gparvin, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit c07ac53 into open-cluster-management-io:main Feb 14, 2023
@JustinKuli JustinKuli deleted the unowned-template-panic branch February 14, 2023 21:39
openshift-merge-robot pushed a commit to stolostron/governance-policy-template-sync that referenced this pull request Mar 29, 2023
Previously, if a Policy defined a template that already exists, it
assumed that another Policy had defined it, and tried to get its owner
reference in order to give a helpful error message. But if the template
was created outside of a Policy, then this process would panic.

Refs:
 - https://issues.redhat.com/browse/ACM-4211
 - open-cluster-management-io/governance-policy-framework-addon#29

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
mprahl pushed a commit to mprahl/governance-policy-framework-addon that referenced this pull request Apr 19, 2023
…y-framework-addon: open-cluster-management-io#29 (open-cluster-management-io#36)

* Refactor: new hubApplyPolicy function

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
(cherry picked from commit 8654c6f)

* Emit template-error if template already exists

Previously, if a Policy defined a template that already exists, it
assumed that another Policy had defined it, and tried to get its owner
reference in order to give a helpful error message. But if the template
was created outside of a Policy, then this process would panic.

Refs:
 - https://issues.redhat.com/browse/ACM-3416

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

---------

Co-authored-by: Justin Kulikauskas <jkulikau@redhat.com>
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