-
Notifications
You must be signed in to change notification settings - Fork 21
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
Unowned template panic #29
Conversation
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>
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! Thanks for the fix and the code improvements.
[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 |
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>
…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>
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: