Repository navigation
Conversation
The AKS workload identity webhook injects AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_FEDERATED_TOKEN_FILE and the token volume, and the Azure SDK falls back to them when the options are empty, but the function still required the azure-creds Secret to exist. It is now optional for identity.type AzureWorkloadIdentityCredentials and the README describes the Secret, its keys and the DeploymentRuntimeConfig as the webhook leaves them. Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
With workload identity the AKS webhook injects
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_FEDERATED_TOKEN_FILEand the projected token volume into any pod that carries theazure.workload.identity/uselabel and runs with an annotated service account, andazidentity.NewWorkloadIdentityCredentialfalls back to those variables when its options are empty. The function already passed empty options when the keys were absent, but it still required theazure-credsSecret to be present, and the README told users to setfederatedTokenFileand to mount the token volume themselves.getCredsnow treats the Secret as optional whenidentity.typeisAzureWorkloadIdentityCredentials; it stays required for service principal credentials, where nothing else can supply the secret. The README marks the Secret and its keys as optional with their environment variable defaults, and the DeploymentRuntimeConfig example is reduced to the label and the service account annotation the webhook needs.Fixes #117
I have:
TestIdentityTypegains a workload identity case without any credentials, which now reaches the identity provider instead of failing on the missing Secret (onmainit fails withfailed to get azure-creds credentials), and a service principal case without credentials that pins the unchanged fatal.go test ./...and the repository's golangci-lint configuration are clean; the input type did not change, so nothing was regenerated. Not run on an AKS cluster.