Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Keystone auth webhook integration #34

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

heytrav
Copy link
Contributor

@heytrav heytrav commented Dec 4, 2023

No description provided.

@heytrav heytrav marked this pull request as draft December 4, 2023 20:28
@heytrav heytrav changed the title WIP: Keystone auth webhook integration Keystone auth webhook integration Dec 4, 2023
@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch from 84e5623 to 0892205 Compare December 7, 2023 02:30
Copy link
Member

@JohnGarbutt JohnGarbutt left a comment

Choose a reason for hiding this comment

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

I am curious why we don't want to let users override the default using a template variable?

I am not against the default coming from config, but would on by default meet your use case better? That might be simpler?

What version of the chart do we require to get this working? Maybe lets bump the default chart version to match that version in this patch?

@@ -685,6 +685,26 @@ def _update_helm_release(self, context, cluster, nodegroups=None):
}
values = helm.mergeconcat(values, network_details)

# CatalystCloud: K8s keystone auth webhook
if CONF.capi_helm.k8s_keystone_auth_enabled:
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be more consistent to use a template variable for this? But I am guessing this doesn't work for you use case? Would making it on by default help, because I see a strong case for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed I hadn't considered using a template variable because, as you mention, it doesn't fit our use case. However I am happy to change this to a template variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed it to a template variable and adjusted the tests and minimum helm chart version accordingly.

@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch 3 times, most recently from 0e5ecc6 to e3adb2a Compare January 8, 2024 19:23
@heytrav heytrav marked this pull request as ready for review January 8, 2024 19:37
@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch 5 times, most recently from 6d7eb14 to bf5a478 Compare January 12, 2024 19:34
@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch from bf5a478 to 5624549 Compare January 22, 2024 20:33
@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch 2 times, most recently from e2b85aa to ba42d13 Compare January 31, 2024 02:35
@heytrav
Copy link
Contributor Author

heytrav commented Jan 31, 2024

Similar to #32, since rebasing the linter now complains about some files that weren't changed. Running black locally doesn't bring up any issues.

@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch from ba42d13 to d2cfb6f Compare February 1, 2024 01:33
@heytrav
Copy link
Contributor Author

heytrav commented Feb 1, 2024

Similar to #32, since rebasing the linter now complains about some files that weren't changed. Running black locally doesn't bring up any issues.

updated black and that fixed the problem

"enabled": True,
"values": {
"openstackAuthUrl": context.auth_url,
"projectId": context.project_id,
Copy link
Member

Choose a reason for hiding this comment

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

This might create issues with admin users updating clusters, but I don't want to block on that now, might be worth a follow up doing cluster.project_id instead here, for safety.

@JohnGarbutt
Copy link
Member

Arg, sorry, it conflicted with your other change again 🤦

@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch from 4dac7a3 to 6434175 Compare February 6, 2024 17:47
@heytrav
Copy link
Contributor Author

heytrav commented Feb 6, 2024

Arg, sorry, it conflicted with your other change again 🤦

Thanks @JohnGarbutt! No worries. I expected there would be some rebasing required. Just pushed that up so hopefully all the tests and linting are all good.

* Make keystone auth webhook configurable with a template label
* on by default
* Add unittests for k8s-keystone-auth config
@heytrav heytrav force-pushed the feat/k8s-keystone-auth-webhook branch from 6434175 to 3c9c9de Compare February 6, 2024 18:06
@@ -1189,6 +1189,9 @@ def _get_cluster_helm_standard_values(self):
"machineSSHKeyName": None,
}

@mock.patch.object(
driver.Driver, "_get_k8s_keystone_auth_enabled", return_value=False
Copy link
Member

Choose a reason for hiding this comment

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

Nit: it would be good to have one test with return_value is True, but I don't want to block this one any longer!

@JohnGarbutt JohnGarbutt merged commit bfca108 into stackhpc:main Feb 7, 2024
1 check passed
@heytrav heytrav deleted the feat/k8s-keystone-auth-webhook branch February 7, 2024 19:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants