Skip to content

feat(helm): make imagePullPolicy configurable in StatefulSet#20296

Open
safijunaid17 wants to merge 2 commits into
bytebase:mainfrom
safijunaid17:patch-1
Open

feat(helm): make imagePullPolicy configurable in StatefulSet#20296
safijunaid17 wants to merge 2 commits into
bytebase:mainfrom
safijunaid17:patch-1

Conversation

@safijunaid17

@safijunaid17 safijunaid17 commented May 11, 2026

Copy link
Copy Markdown

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.

@safijunaid17 safijunaid17 requested a review from a team as a code owner May 11, 2026 23:18
@cla-bot

cla-bot Bot commented May 11, 2026

Copy link
Copy Markdown

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.

@cla-bot

cla-bot Bot commented May 11, 2026

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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" -}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

@safijunaid17 safijunaid17 changed the title Chore: Support imagePullPolicy changes from template feat(helm): make imagePullPolicy configurable in StatefulSet May 11, 2026
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