Skip to content

fix(operator): allow multiple keys of one Secret in spec.secrets - #6690

Open
lightsabit wants to merge 1 commit into
stacklok:mainfrom
lightsabit:fix/secrets-list-map-keys
Open

lightsabit wants to merge 1 commit into
stacklok:mainfrom
lightsabit:fix/secrets-list-map-keys

Conversation

@lightsabit

Copy link
Copy Markdown

spec.secrets entries are per-key -- name and key are both required, and the operator's env builder turns each entry into its own secretKeyRef -- but the list was keyed on name only (#6686), so referencing two keys of the same Secret fails validation as a duplicate key.

This adds key to the list map keys and regenerates the CRDs. Existing objects already have unique names, so nothing changes for them.

I've been running the same list-map-keys change as a Helm post-renderer on a live 0.49.0 install for a few days; one MCPServer there references five keys of a single Secret.

SecretRef entries are per-key -- name and key are both required -- and the
env builder maps each entry to its own secretKeyRef, so referencing two
keys of the same Secret is expected usage. The list was keyed on name
only, so the API server rejected the second entry as a duplicate.

Fixes stacklok#6686

Signed-off-by: lights <115397533+lightsabit@users.noreply.github.com>
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.

1 participant