fix(shopware): omit initContainers, extraContainers, extraEnvs when not configured#266
Conversation
|
Hey, thanks for the PR So this will also end in this result in the store: So in the kind cluster this was not an issue. How do you deploy this helm-chart? With argo or flux maybe? Then we need to make sure to double check this. |
Yes, those values you provided will also end up causing issues if not set. |
c13bcdd to
c09eba2
Compare
When these fields are not configured they render as null in the Store CRD manifest, which is rejected by the Kubernetes API server since the CRD schema requires them to be arrays. Wrap each field with a conditional guard so they are only emitted when they have content: - initContainers: omitted unless container.initContainers is set or sidecarLogging is enabled - extraContainers: omitted unless container.extraContainers is set or fpm is non-dynamic - extraEnvs: omitted unless container.extraEnvs is set Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
restartPolicy was incorrectly reading from .Values.store.container.imagePullPolicy instead of .Values.store.container.restartPolicy, causing the restart policy to reflect the image pull policy value rather than the intended restart behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c09eba2 to
a31e826
Compare
|
Bug which is related to our pipeline: So for me this is clear, our e2e pipeline should fail, because the generated helm-chart is not valid. It's valid for But nothing you should worry about for now, we will fix this later. |
17a279d
into
shopware:main
|
Your changes are added to helm-chart version 0.0.59 and it's now live. Again thank you for the PR 💙 |
Thanks a lot for merging and deploying it |
Problem
When
initContainers,extraContainers, orextraEnvsare not set in values, these fields are rendered unconditionally asnullin theStoreCRD manifest:The Kubernetes API server rejects this because the
StoreCRD schema declares these fields astype: array, andnullis not a valid array. This causes an error on apply:Fix
Wrap each field with a guard so it is only emitted when it has content:
initContainers: only rendered whencontainer.initContainersis set orsidecarLoggingis enabledextraContainers: only rendered whencontainer.extraContainersis set orfpmis configured with a non-dynamic process managerextraEnvs: only rendered whencontainer.extraEnvsis setThe fix is a minimal, idiomatic Helm change — no helpers or logic outside
store.yamlare required. All existing behaviour when the fields are configured is preserved exactly.