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

Force creation of generic items into AppWrapper deployment namespace #665

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

tardieu
Copy link
Member

@tardieu tardieu commented Oct 18, 2023

This PR makes sure that generic items are created in the same namespace as the AppWrapper. If the metadata of the generic item explicitly specifies a namespace that is different from the AppWrapper deployment namespace, an error message is generated to report the discrepancy and the resource creation fails. If the specified namespace is equal to the AppWrapper namespace or if no explicit namespace is specified then the creation can process in the AppWrapper namespace.

This PR does not affect the creation of cluster scoped resources, which was already prohibited.

This PR modifies MCAD's behavior when resources do not specify a namespace. They used to be deployed in the default namespace irrespective of the AppWrapper namespace. Now they will be deployed in the AppWrapper namespace instead. Alternatively, we could check the namespace without changing the existing behavior. In the long term though, if the deployment namespace can only be the appwrapper namespace, it does not make much sense to require the namespace in the resource definition, i.e., interpret the absence of a namespace as the default namespace.

Copy link
Contributor

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

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

It's still possible for users to delete existing resources in namespaces they are not granted permissions to.

Copy link
Contributor

@ChristianZaccaria ChristianZaccaria left a comment

Choose a reason for hiding this comment

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

This looks great!

For this PR: #652 (I have to update it)
Should I still keep the resourceName labels but left unused as discussed?

@tardieu
Copy link
Member Author

tardieu commented Oct 19, 2023

It's still possible for users to delete existing resources in namespaces they are not granted permissions to.

Ok. I added the same fix on resource deletion.

@astefanutti
Copy link
Contributor

/lgtm

@astefanutti
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Oct 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astefanutti

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

@tardieu tardieu merged commit ccec55c into project-codeflare:main Oct 19, 2023
1 check 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.

3 participants