feat(helm): make imagePullPolicy configurable in StatefulSet#20296
feat(helm): make imagePullPolicy configurable in StatefulSet#20296safijunaid17 wants to merge 2 commits into
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please sign CLA and add your name to contributors list. |
|
We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please sign CLA and add your name to contributors list. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f04d080b01
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| {{- $extraVolumes := .Values.bytebase.extraVolumes }} | ||
| # imagePullPolicy | ||
| {{- $pullPolicy := .Values.global.azure.images.bytebase.imagePullPolicy | default "Always" -}} | ||
| {{- $initPullPolicy := .Values.bytebase.initImage.initPullPolicy | default "IfNotPresent" -}} |
There was a problem hiding this comment.
Guard the missing initImage map before reading it
With the default values.yaml, bytebase.initImage is not defined, so this chained lookup is evaluated before default can apply and Helm will fail rendering with a nil-pointer-style template error. Because this variable is initialized unconditionally at the top of the template, chart installs/upgrades using the defaults break even when the init container is disabled; use dig/index with a dict fallback or add the missing map to the default values.
Useful? React with 👍 / 👎.
|



This PR introduces configurable imagePullPolicy parameters for both the main Bytebase container and the initialization container.
Rationale:
Hardcoding imagePullPolicy: Always can lead to deployment failures in environments with strict Admission Controllers (such as Kyverno or OPA Gatekeeper) that enforce best practices. By allowing users to specify the pull policy, we ensure compliance with organizational security and resource optimization requirements.
Furthermore, while Always is useful for mutable tags like :latest, standard production workflows rely on specific versioning where IfNotPresent is preferred to reduce unnecessary network egress and improve pod startup latency.