Skip to content

Allow adding nerc.mghpcc.org/allow-unencrypted-routes: 'true' label to all pre-existing and future Openshift projects#211

Merged
knikolla merged 1 commit into
nerc-project:mainfrom
QuanMPhm:196/add_label
May 8, 2025
Merged

Allow adding nerc.mghpcc.org/allow-unencrypted-routes: 'true' label to all pre-existing and future Openshift projects#211
knikolla merged 1 commit into
nerc-project:mainfrom
QuanMPhm:196/add_label

Conversation

@QuanMPhm

Copy link
Copy Markdown
Contributor

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

@knikolla knikolla left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread src/coldfront_plugin_cloud/management/commands/validate_allocations.py Outdated
Comment thread src/coldfront_plugin_cloud/management/commands/validate_allocations.py Outdated
Comment thread src/coldfront_plugin_cloud/openshift.py Outdated
@QuanMPhm QuanMPhm requested a review from naved001 May 6, 2025 16:21

@naved001 naved001 left a comment

Copy link
Copy Markdown
Contributor

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

QuanMPhm commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

@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.

@knikolla knikolla left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread src/coldfront_plugin_cloud/openshift.py Outdated
@QuanMPhm QuanMPhm requested a review from knikolla May 7, 2025 17:01
@QuanMPhm

QuanMPhm commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

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

@knikolla

knikolla commented May 7, 2025

Copy link
Copy Markdown
Collaborator

@naved001 can you do one final pass?

@naved001 naved001 left a comment

Copy link
Copy Markdown
Contributor

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