Skip to content

Conversation

@QuanMPhm
Copy link
Contributor

Closes #196. Built on top #205. This PR consists on the last commit. More info in the commit message.

Copy link
Collaborator

@knikolla knikolla left a comment

Choose a reason for hiding this comment

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

Made some comments. Otherwise looks pretty close.

@QuanMPhm QuanMPhm requested a review from naved001 May 6, 2025 16:21
Copy link
Contributor

@naved001 naved001 left a comment

Choose a reason for hiding this comment

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

I don't understand why we are trying to "replace" the namespace (api.replace) instead of just patching the namespace api.patch to update the labels.

@QuanMPhm
Copy link
Contributor Author

QuanMPhm commented May 6, 2025

@naved001 Thank you for pointing that out. I've updated the code to use patch. I guess it never dawned on me to use that when testing with the openshift client.

Copy link
Collaborator

@knikolla knikolla left a comment

Choose a reason for hiding this comment

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

One last comment from me, the rest looks good.

@QuanMPhm QuanMPhm requested a review from knikolla May 7, 2025 17:01
@QuanMPhm
Copy link
Contributor Author

QuanMPhm commented May 7, 2025

@knikolla I'll let you resolve the comments and merge

@knikolla
Copy link
Collaborator

knikolla commented May 7, 2025

@naved001 can you do one final pass?

Copy link
Contributor

@naved001 naved001 left a comment

Choose a reason for hiding this comment

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

looks good to me, but I'd like to see one small test added (inline)

All Openshift projects created through Coldfront will now have an additional label:
`'nerc.mghpcc.org/allow-unencrypted-routes': "true"`

`validate_allocations` has also been changed to ensure all current Openshift projects contain a few default labels:

```
PROJECT_DEFAULT_LABELS = {
    'opendatahub.io/dashboard': "true",
    'modelmesh-enabled': "true",
    'nerc.mghpcc.org/allow-unencrypted-routes': "true"
}
```

Implementing this required code in the Openshift allocator to
interact with the Namespace API. For reasons not entirely
clear in the documentation, it is not possible
change a Project’s labels directly. This is only possible
through the Namespace API.
@QuanMPhm QuanMPhm requested a review from naved001 May 7, 2025 19:06
@knikolla knikolla merged commit c5ac22c into nerc-project:main May 8, 2025
6 checks passed
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.

Need to set additional nerc.mghpcc.org/allow-unencrypted-routes: 'true' label by default to any newly approved or already existing OpenShift allocations

3 participants