fix: ensure unique mountPath when service has multiple secrets - #2104
fix: ensure unique mountPath when service has multiple secrets#2104fru1tworld wants to merge 2 commits into
Conversation
|
Welcome @fru1tworld! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fru1tworld The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
When a service references multiple secrets, compose-go normalizes
short-syntax
secrets: [a, b]to long-syntax withTarget="/run/secrets/<name>".getSecretPathsLegacythen stripped thefilename and used only the parent directory as
mountPath, so bothsecrets ended up with
mountPath: /run/secretsandkubectl applyfailedwith
volumeMounts[*].mountPath: must be unique.Use the full target as the mountPath. SubPath still selects the file
within the secret data, so the file lands at the same location.
Which issue(s) this PR fixes:
Fixes #1894