fix: stop wiping API-key metadata ConfigMap on LLMModel reconcile - #166
Merged
Conversation
The LLMModel reconciler's createOrUpdateConfigMap overwrites existing.Data with the desired data on every reconcile. The desired <model>-api-key-metadata ConfigMap the operator builds is an empty placeholder (the key-manager fills it in), so each reconcile reset the metadata to empty and API keys vanished from the UI while the keys in the <model>-api-keys Secret kept authenticating. Reconcile the metadata ConfigMap with a data-preserving variant that only manages labels, mirroring createOrUpdateSecret (and the PassthroughModel reconciler, which already preserves ConfigMap data). The EPP ConfigMap keeps the overwriting behavior since its data is operator-owned. Fixes #85 Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Summary
Fixes #85 — API keys disappearing from the UI.
The key-manager stores key values in the
<model>-api-keysSecret (what the gateway authenticates against) and key metadata in the<model>-api-key-metadataConfigMap (what the UI lists). The LLMModel reconciler applied these two asymmetrically:createOrUpdateSecretdeliberately preservesexisting.Data, butcreateOrUpdateConfigMapoverwroteexisting.Datawith the operator's desired data — which for the metadata ConfigMap is an empty placeholder the key-manager is supposed to fill in. So every reconcile of an LLMModel wiped the key metadata, and keys vanished from the UI while continuing to authenticate (the Secret was untouched).Changes
createOrUpdateConfigMapPreserveDatato the LLMModel reconciler — it manages labels only and leavesDataalone, mirroringcreateOrUpdateSecretand the PassthroughModel reconciler's existing (correct) ConfigMap behavior. The metadata ConfigMap now reconciles through this variant.createOrUpdateConfigMap, since its data is operator-owned config that must propagate on reconcile.Notes
passthroughmodel_controller.go), so only the LLMModel path needed the fix.make test, envtest k8s 1.34).Screenshots
🤖 Generated with Claude Code