Skip to content

Conversation

astefanutti
Copy link
Contributor

An owner reference from a non-namespaced resource cannot be namespaced.

@astefanutti
Copy link
Contributor Author

/assign @KPostOffice

@@ -232,9 +232,6 @@ func desiredOAuthClusterRoleBinding(cluster *rayv1.RayCluster) *rbacapply.Cluste
WithAPIGroup("rbac.authorization.k8s.io").
WithKind("ClusterRole").
WithName("system:auth-delegator"),
).
WithOwnerReferences(
v1.OwnerReference().WithUID(cluster.UID).WithName(cluster.Name).WithKind(cluster.Kind).WithAPIVersion(cluster.APIVersion),
Copy link
Contributor

Choose a reason for hiding this comment

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

In such case controller needs to make sure the CRB is deleted when RayCluster is removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is achieved with the finalizer. That owner reference isn't relevant as a cluster-scope resource cannot be owned by a namespace resource, which materialises with the absence of the namespace in the reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, I completely forgot on that.

@openshift-ci openshift-ci bot added the lgtm label Apr 17, 2024
Copy link

openshift-ci bot commented Apr 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KPostOffice

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 8b3b27c into project-codeflare:main Apr 17, 2024
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