Skip to content

feat: use project from extra#66

Merged
scotwells merged 4 commits intomainfrom
feat/useextras
Sep 9, 2025
Merged

feat: use project from extra#66
scotwells merged 4 commits intomainfrom
feat/useextras

Conversation

@zachsmith1
Copy link
Copy Markdown
Contributor

@zachsmith1 zachsmith1 commented Aug 21, 2025

This pull request refactors how the webhook server determines the cluster context for incoming requests. The main change is to extract the cluster name from the UserInfo.Extra field in the admission request, rather than from the request path, and to set the cluster context accordingly. This simplifies the context propagation and removes dependencies on URL parsing.

Cluster context extraction improvements:

  • Added a new utility function clusterFromExtra in internal/webhook/util.go to extract the cluster name from the UserInfo.Extra field, specifically using the key iam.miloapis.com/parent-name.
  • Updated the Register method in clusterAwareWebhookServer (internal/webhook/server.go) to wrap the webhook handler and inject the cluster context based on UserInfo.Extra, replacing the previous logic that parsed the cluster name from the request path.

@zachsmith1 zachsmith1 requested a review from scotwells August 21, 2025 23:10
scotwells
scotwells previously approved these changes Aug 21, 2025
@scotwells scotwells merged commit 004676e into main Sep 9, 2025
8 checks passed
@scotwells scotwells deleted the feat/useextras branch September 9, 2025 14:06
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.

2 participants