Skip to content

[chore] Setting initContainers pullPolicy to IfNotPresent#248

Merged
openshift-merge-bot[bot] merged 7 commits intoredhat-developer:mainfrom
OpinionatedHeron:pullPolicy
Oct 9, 2025
Merged

[chore] Setting initContainers pullPolicy to IfNotPresent#248
openshift-merge-bot[bot] merged 7 commits intoredhat-developer:mainfrom
OpinionatedHeron:pullPolicy

Conversation

@OpinionatedHeron
Copy link
Copy Markdown
Member

Description of the change

Changing initContainers: imagePullPolicy to "IfNotPresent". This should ensure shorter startup time.

Which issue(s) does this PR fix or relate to

RHDHBUGS-1000

How to test changes / Special notes to the reviewer

Checklist

  • For each Chart updated, version bumped in the corresponding Chart.yaml according to Semantic Versioning.
  • For each Chart updated, variables are documented in the values.yaml and added to the corresponding README.md. The pre-commit utility can be used to generate the necessary content. Use pre-commit run -a to apply changes. The pre-commit Workflow will do this automatically for you if needed.
  • JSON Schema template updated and re-generated the raw schema via the pre-commit hook.
  • Tests pass using the Chart Testing tool and the ct lint command.
  • If you updated the orchestrator-infra chart, make sure the versions of the Knative CRDs are aligned with the versions of the CRDs installed by the OpenShift Serverless operators declared in the values.yaml file. See Installing Knative Eventing and Knative Serving CRDs for more details.

Signed-off-by: Leanne Ahern <lahern@redhat.com>
@qodo-code-review
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

RHDHBUGS-1000 - Partially compliant

Compliant requirements:

  • Change initContainers[0] imagePullPolicy from "Always" to "IfNotPresent" in the Helm chart.
  • Ensure the change applies to the values.yaml so downstream users get the default.
  • Reflect the change in the chart schema/templates so rendered manifests use IfNotPresent.

Non-compliant requirements:

  • Follow chart contribution standards (version bump, docs/schema updates, tests as applicable).

Requires further human verification:

  • Result should help reduce startup time by avoiding unnecessary image pulls.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Schema Consistency

Verify that the JSON schema still validates the updated values and that the schema path accurately matches the Helm values structure for initContainers' imagePullPolicy.

"image": "{{ include \"backstage.image\" . }}",
"imagePullPolicy": "IfNotPresent",
"name": "install-dynamic-plugins",
Rendered Manifest Check

Ensure templates actually consume this value for the initContainer and that no other template hardcodes a different pull policy overriding "IfNotPresent".

imagePullPolicy: IfNotPresent
volumeMounts:
📄 References
  1. No matching references available

@qodo-code-review qodo-code-review Bot added enhancement New feature or request and removed Review effort 1/5 labels Oct 7, 2025
@rhdh-qodo-merge
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

RHDHBUGS-1000 - Partially compliant

Compliant requirements:

  • Change the initContainer install-dynamic-plugins image pull policy from "Always" to "IfNotPresent" in the Helm chart.
  • Ensure the change is reflected in both the chart values and the generated JSON schema to keep them consistent.

Non-compliant requirements:

  • Follow chart contribution standards (version bump, docs/schema updates, tests) as applicable.

Requires further human verification:

  • Result should help reduce startup time by avoiding unnecessary image pulls.
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Chart Versioning

The checklist calls for bumping the chart version in Chart.yaml when values change. Verify that Chart.yaml was updated accordingly to reflect this change.

imagePullPolicy: IfNotPresent
volumeMounts:
📚 Focus areas based on broader codebase context

Consistency

Verify that the initContainer image reference matches environments where pullPolicy is IfNotPresent. Upstream values use a templated image, while other deployments specify concrete images; IfNotPresent may serve stale local images if the tag is mutable like latest/next. (Ref 1, Ref 3)

"image": "{{ include \"backstage.image\" . }}",
"imagePullPolicy": "IfNotPresent",
"name": "install-dynamic-plugins",

Reference reasoning: In related deployment configs, initContainers use imagePullPolicy: IfNotPresent with concrete image tags and explicit images, while the chart’s values use a templated image defaulting to latest. Aligning image policy with immutable tags or documenting expectations matches established patterns and prevents stale images.

Tag Mutability

Switching to IfNotPresent can cause nodes to reuse outdated images when tags are mutable. Consider recommending immutable tags or a mechanism to force refresh when needed. (Ref 2, Ref 3)

  - ./install-dynamic-plugins.sh
  - /dynamic-plugins-root
env:
  - name: NPM_CONFIG_USERCONFIG
    value: /opt/app-root/src/.npmrc.dynamic-plugins
    # This following variable is required for orchestrator to startup properly.
  - name: MAX_ENTRY_SIZE
    value: "30000000"
imagePullPolicy: IfNotPresent
volumeMounts:

Reference reasoning: Operator and test deployment manifests already use IfNotPresent with specific images; adopting the same policy in the chart without ensuring immutable tags risks drift. Aligning with those manifests’ practice of explicit images mitigates this.

📄 References
  1. redhat-developer/rhdh-chart/charts/backstage/values.yaml [184-208]
  2. redhat-developer/rhdh-operator/pkg/model/testdata/janus-deployment.yaml [36-56]
  3. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [41-62]
  4. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [83-99]
  5. redhat-developer/rhdh-chart/charts/backstage/values.yaml [70-97]
  6. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [100-111]
  7. redhat-developer/rhdh-operator/pkg/model/testdata/janus-deployment.yaml [58-87]
  8. redhat-developer/rhdh-operator/config/crd/bases/rhdh.redhat.com_backstages.yaml [1491-1508]

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Oct 7, 2025

PR Type

(Describe updated until commit 9067bd0)

Enhancement


Description

  • Change initContainers imagePullPolicy from Always to IfNotPresent

  • Improve startup time by avoiding unnecessary image pulls

  • Bump chart version from 4.5.10 to 4.5.11


File Walkthrough

Relevant files
Configuration changes
Chart.yaml
Bump chart version                                                                             

charts/backstage/Chart.yaml

  • Increment chart version from 4.5.10 to 4.5.11
+1/-1     
values.schema.json
Update schema imagePullPolicy default                                       

charts/backstage/values.schema.json

  • Change imagePullPolicy from "Always" to "IfNotPresent" in schema
+1/-1     
values.yaml
Update initContainer imagePullPolicy setting                         

charts/backstage/values.yaml

  • Change imagePullPolicy from "Always" to "IfNotPresent" for
    install-dynamic-plugins initContainer
+1/-1     
Documentation
README.md
Update documentation version references                                   

charts/backstage/README.md

  • Update version badge from 4.5.10 to 4.5.11
  • Update helm install command version reference
+2/-2     

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Oct 7, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

1 similar comment
@rhdh-qodo-merge
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@OpinionatedHeron
Copy link
Copy Markdown
Member Author

/bump backstage patch

Copy link
Copy Markdown
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

@OpinionatedHeron
Copy link
Copy Markdown
Member Author

@OpinionatedHeron Could you please bump the Chart version to make the linter happy? https://github.com/redhat-developer/rhdh-chart/actions/runs/18316730655/job/52160075886?pr=248#step:8:51

Hey @rm3l, I did put the command to bump it, but I don't know if it needs to run again or what to acknowledge the bump. I just can't trigger the lint to run again to see if the bump is acknowledged

@OpinionatedHeron
Copy link
Copy Markdown
Member Author

@OpinionatedHeron Could you please bump the Chart version to make the linter happy? https://github.com/redhat-developer/rhdh-chart/actions/runs/18316730655/job/52160075886?pr=248#step:8:51

Hey @rm3l, I did put the command to bump it, but I don't know if it needs to run again or what to acknowledge the bump. I just can't trigger the lint to run again to see if the bump is acknowledged

Okay, for some reason that didn't work, so tried manually changing the patch version

Co-authored-by: OpinionatedHeron <OpinionatedHeron@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 8, 2025

⚠️ Files changed after running the pre-commit hooks

Those changes should have been pushed automatically to your PR branch.

NOTE: If the PR checks are stuck after this additional commit, manually close the PR and immediately reopen it to trigger the checks again.

@rm3l
Copy link
Copy Markdown
Member

rm3l commented Oct 8, 2025

@OpinionatedHeron Could you please bump the Chart version to make the linter happy? redhat-developer/rhdh-chart/actions/runs/18316730655/job/52160075886?pr=248#step:8:51

Hey @rm3l, I did put the command to bump it, but I don't know if it needs to run again or what to acknowledge the bump. I just can't trigger the lint to run again to see if the bump is acknowledged

Okay, for some reason that didn't work, so tried manually changing the patch version

Ah, looking at the Bump job logs here, it looks like it correctly bumped the Chart version, but pushed to a new branch (in the rhdh-chart repo, not in your fork PR branch): https://github.com/redhat-developer/rhdh-chart/tree/pullPolicy 😕
We should look into fixing this behavior (later).

@rm3l rm3l closed this Oct 8, 2025
@rm3l rm3l reopened this Oct 8, 2025
@qodo-code-review
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

RHDHBUGS-1000 - PR Code Verified

Compliant requirements:

  • Change initContainers[0] imagePullPolicy to "IfNotPresent"
  • Bump chart version in Chart.yaml and README badge/install command
  • Update values.yaml and values.schema.json to use "IfNotPresent" for the init container

Requires further human verification:

  • Validate that no environments rely on Always pull policy (operational consideration).
  • Confirm CT/lint passes and charts render correctly across supported Kubernetes/OpenShift versions.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Behavior Change

Switching to IfNotPresent may cause stale images in clusters without image digest pinning; verify release and operational guidelines cover image update procedures (e.g., tag changes, imagePullSecrets, or manual image pull).

imagePullPolicy: IfNotPresent
volumeMounts:
Schema Consistency

Ensure any validation or defaults elsewhere in templates do not still assume "Always" for the init container; confirm no conflicting template logic overrides the policy.

"imagePullPolicy": "IfNotPresent",
"name": "install-dynamic-plugins",
📄 References
  1. No matching references available

@rhdh-qodo-merge
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

RHDHBUGS-1000 - PR Code Verified

Compliant requirements:

  • Change the initContainer install-dynamic-plugins imagePullPolicy from "Always" to "IfNotPresent" in the Helm chart.
  • Ensure chart metadata and docs reflect the new version including this change.
  • Maintain consistency across values.yaml and generated schema so users get correct defaults and docs.

Requires further human verification:

  • Validate in a real cluster that subsequent pod restarts no longer pull the large image when present (runtime behavior).
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Version Bump

Confirm that 4.5.11 is the correct next chart version per your release process and that any dependent charts or automation expect this version.

version: 4.5.11
Schema Consistency

Ensure the schema's default and allowed values align with values.yaml for imagePullPolicy on the initContainer so that tooling (ct lint, schema validation) passes.

"imagePullPolicy": "IfNotPresent",
"name": "install-dynamic-plugins",
📄 References
  1. redhat-developer/rhdh-chart/charts/backstage/values.yaml [184-208]
  2. redhat-developer/rhdh-operator/pkg/model/testdata/janus-deployment.yaml [36-56]
  3. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [41-62]
  4. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [83-99]
  5. redhat-developer/rhdh-chart/charts/backstage/values.yaml [70-97]
  6. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [100-111]
  7. redhat-developer/rhdh-operator/config/profile/rhdh/default-config/deployment.yaml [126-139]
  8. redhat-developer/rhdh-operator/pkg/model/testdata/janus-deployment.yaml [58-87]

@qodo-code-review
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

1 similar comment
@rhdh-qodo-merge
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Comment thread charts/backstage/values.yaml
Signed-off-by: Leanne Ahern <lahern@redhat.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 9, 2025

Copy link
Copy Markdown
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

/lgtm

Comment thread charts/backstage/values.yaml
@openshift-ci openshift-ci Bot added the lgtm label Oct 9, 2025
@openshift-merge-bot openshift-merge-bot Bot merged commit 6012030 into redhat-developer:main Oct 9, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants