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

Set the cluster namespace on OperatorPolicy dependencies #147

Conversation

mprahl
Copy link
Member

@mprahl mprahl commented Jun 26, 2024

Without this, the governance-policy-framework panics because it doesn't have permission to view OperatorPolicy in all namespaces.

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 &&
Copy link
Member Author

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)
Copy link
Member

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?

Suggested change
res = dClient.Resource(rsrc).Namespace(dep.Namespace)
res = dClient.Resource(rsrc).Namespace(getDepNamespace(r.ClusterNamespace, dep))

Copy link
Member Author

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.

@mprahl mprahl requested a review from dhaiducek July 1, 2024 12:11
Copy link

openshift-ci bot commented Jul 1, 2024

[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

@openshift-merge-bot openshift-merge-bot bot merged commit c2681fe into open-cluster-management-io:main Jul 1, 2024
9 checks passed
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.

None yet

2 participants