-
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
Set the cluster namespace on OperatorPolicy dependencies #147
Set the cluster namespace on OperatorPolicy dependencies #147
Conversation
Without this, the governance-policy-framework panics because it doesn't have permission to view OperatorPolicy in all namespaces. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Name: dep.Name, | ||
} | ||
|
||
// Use cluster namespace for known policy types when the namespace is blank | ||
if depID.Namespace == "" && depID.Group == policiesv1.GroupVersion.Group && | ||
depID.Version == policiesv1.GroupVersion.Version && |
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.
This version check was the culprit since OperatorPolicy is v1beta1 and not v1.
} | ||
|
||
res = dClient.Resource(rsrc).Namespace(ns) | ||
res = dClient.Resource(rsrc).Namespace(dep.Namespace) |
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.
Should this also use the new function?
res = dClient.Resource(rsrc).Namespace(dep.Namespace) | |
res = dClient.Resource(rsrc).Namespace(getDepNamespace(r.ClusterNamespace, dep)) |
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.
@dhaiducek it's not needed in this case because the input to processDependencies
already has dependencies with the correct namespace.
[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 |
c2681fe
into
open-cluster-management-io:main
Without this, the governance-policy-framework panics because it doesn't have permission to view OperatorPolicy in all namespaces.