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

Support creation of non namespaced objects in createk8scr #86

Conversation

jhernand
Copy link
Collaborator

Kubernetes forbids the creation of object in one namespace with owners in another namespace, or the creation of non-namespaced objects with namespaced owners. But the CreateK8sCR function doesn't support. We will need that in order to create cluster roles and cluster role bindings. This patch changes the function so that it will not try to set an owner if the namespace of the object and the namespace of the owner are different.

@openshift-ci openshift-ci bot requested review from danielerez and irinamihai April 11, 2024 10:44
Copy link

openshift-ci bot commented Apr 11, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jhernand. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@jhernand
Copy link
Collaborator Author

Note that this pull request also includes the code in #85. That should be merged before this, and then this should be rebased.

Kubernetes forbids the creation of object in one namespace with owners
in another namespace, or the creation of non-namespaced objects with
namespaced owners. But the `CreateK8sCR` function doesn't support. We
will need that in order to create cluster roles and cluster role
bindings. This patch changes the function so that it will not try to set
an owner if the namespace of the object and the namespace of the owner
are different.

Signed-off-by: Juan Hernandez <[email protected]>
@jhernand jhernand force-pushed the support_creation_of_non_namespaced_objects_in_createk8scr branch from 508821b to a95618c Compare April 11, 2024 12:59
@jhernand jhernand merged commit 2111f88 into openshift-kni:main Apr 11, 2024
7 of 8 checks passed
@jhernand jhernand deleted the support_creation_of_non_namespaced_objects_in_createk8scr branch April 11, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant