Skip to content

fix: update init container config refs in primary spec#1925

Open
immanuwell wants to merge 1 commit into
fluxcd:mainfrom
immanuwell:fix/init-container-primary-config-refs
Open

fix: update init container config refs in primary spec#1925
immanuwell wants to merge 1 commit into
fluxcd:mainfrom
immanuwell:fix/init-container-primary-config-refs

Conversation

@immanuwell
Copy link
Copy Markdown

ApplyPrimaryConfigs rewrites ConfigMap/Secret refs in spec.Containers to use -primary copies, but skips spec.InitContainers entirely. GetTargetConfigs already tracks init container refs, so the primary copies get created, but the init containers in the primary deployment still point to the originals. Not great.

How to reproduce: deploy anything with an init container that pulls config from a ConfigMap or Secret via env/envFrom, let flagger init the primary, check the primary deployment spec - init containers still reference the original names.

Fix mirrors the existing containers loop for InitContainers. Also squashed a double-space typo in an error message while in the file.

Tests added to TestConfigTracker_ConfigMaps and TestConfigTracker_Secrets for both deployment and daemonset subtests.

Signed-off-by: immanuwell <pchpr.00@list.ru>
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