Skip to content

fix(chart): honour image.repository/image.tag instead of hardcoding Docker Hub - #128

Merged
MusaMisto merged 1 commit into
mainfrom
fix/chart-image-registry
Aug 31, 2026
Merged

fix(chart): honour image.repository/image.tag instead of hardcoding Docker Hub#128
MusaMisto merged 1 commit into
mainfrom
fix/chart-image-registry

Conversation

@MusaMisto

Copy link
Copy Markdown
Member

Root cause

deployment.yaml hardcoded the image:

image: "docker.io/simplify9/{{ .Chart.Name }}:{{ .Chart.Version }}"

So it ignored the image.repository and image.tag values the CI pipeline has been passing all alongreusable-service-cicd.yml sets image-repository to <container-registry>/<image-name> and image-tag to the computed version, which helm-deploy turns into --set image.repository=… --set image.tag=…. ci-cd.yml's own inline comment documented this bug.

CI publishes to ghcr.io. Docker Hub has had no push since 6.0.8 (Aug 2025, from the retired Azure pipeline), so every version from 8.0.0 on is simply absent there:

registry 8.0.0 newest tag
docker.io/simplify9/mtm ❌ HTTP 404 6.0.8
ghcr.io/simplify9/mtm ✅ pulls anonymously 8.0.0

Confirmed live on the cluster — playground/mtm runs docker.io/simplify9/mtm:8.0.0 from chart mtm-8.0.0, state ImagePullBackOff.

Change

  • _helpers.tpl — new project.image, defaulting to ghcr.io/simplify9/<chart name>:<chart version>
  • deployment.yaml — use it
  • values.yaml — declare image.repository and image.tag (empty = default)

⚠️ The default registry changes: docker.io → ghcr.io

That is deliberate, and it is the fix. ghcr.io is the only registry carrying images for current chart versions, and the package is public — verified with an anonymous pull after docker logout ghcr.io, so no imagePullSecret is needed. Anyone who needs the old registry can set image.repository=docker.io/simplify9/mtm.

This also matters beyond playground: the chart backs six releases (funride / kwickbox / tamweelna × staging/production). Without this, any of them moving to chart 8.0.x would hit the same ImagePullBackOff.

Verification

Check Result
helm lint --strict clean
Default render ghcr.io/simplify9/mtm:<chart version>
With the pipeline's exact --set ghcr.io/simplify9/mtm:8.0.0
Escape hatch (--set image.repository=docker.io/simplify9/mtm) docker.io/simplify9/mtm:6.0.8
Rendered against live values of all six releases exactly 2 changed lines each — the image registry, nothing else
ghcr.io/simplify9/mtm:8.0.0 pulls anonymously; carries Microsoft.AspNetCore.App 8.0.30

Note

mtm-8.0.0 is now on charts.sf9.io and contains httproute.yaml — the first gateway-capable published chart. Downstream callers should pin 8.0.1 (this fix), not 8.0.0, or they inherit the Docker Hub 404.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VHkpqv6dB6wjALyFe9ocMU

…ocker Hub

The playground deploy of 8.0.0 is in ImagePullBackOff:

  Failed to pull image "docker.io/simplify9/mtm:8.0.0": not found

deployment.yaml hardcoded the image as
  docker.io/simplify9/{{ .Chart.Name }}:{{ .Chart.Version }}
so it ignored the image.repository and image.tag values the CI pipeline has
been passing all along (reusable-service-cicd.yml sets image-repository to
"<container-registry>/<image-name>" and image-tag to the computed version,
which helm-deploy turns into --set image.repository=... --set image.tag=...).
ci-cd.yml's own comment documented this bug.

CI publishes to ghcr.io. Docker Hub has received no push since 6.0.8
(Aug 2025, the retired Azure pipeline), so every version from 8.0.0 onward
is missing there. Confirmed: docker.io/simplify9/mtm:8.0.0 -> HTTP 404,
ghcr.io/simplify9/mtm:8.0.0 -> pulls anonymously and carries
Microsoft.AspNetCore.App 8.0.30.

- _helpers.tpl: new `project.image`, defaulting to
  ghcr.io/simplify9/<chart name>:<chart version>.
- deployment.yaml: use it.
- values.yaml: declare image.repository and image.tag (both empty = default).

The default registry changes from docker.io to ghcr.io. That is the point:
ghcr.io is the only registry carrying images for current chart versions.
Anyone needing the old one can set image.repository=docker.io/simplify9/mtm.

Verified: helm lint --strict clean; default renders
ghcr.io/simplify9/mtm:<version>; the pipeline's exact --set renders
ghcr.io/simplify9/mtm:8.0.0; and rendering against the live values of all
six releases changes exactly two lines each - the image registry, nothing
else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHkpqv6dB6wjALyFe9ocMU
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: simplify9/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4242fb12-f7ca-4fb2-b884-5388f1c2645e

📥 Commits

Reviewing files that changed from the base of the PR and between d9df33c and 381812a.

📒 Files selected for processing (3)
  • charts/default/templates/_helpers.tpl
  • charts/default/templates/deployment.yaml
  • charts/default/values.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
Review Helm chart changes for insecure defaults, exposed services,

⚙️ CodeRabbit configuration file

Files:

  • charts/default/templates/deployment.yaml
  • charts/default/templates/_helpers.tpl
  • charts/default/values.yaml
🪛 Trivy (0.73.0)
charts/default/templates/deployment.yaml

[warning] 28-76: Can elevate its own privileges

Container 'mtm' of Deployment 'mtm' should set 'securityContext.allowPrivilegeEscalation' to false

Rule: KSV-0001

Learn more

(IaC/Kubernetes)


[info] 28-76: Default capabilities: some containers do not drop all

Container 'mtm' of Deployment 'mtm' should add 'ALL' to 'securityContext.capabilities.drop'

Rule: KSV-0003

Learn more

(IaC/Kubernetes)


[info] 28-76: Default capabilities: some containers do not drop any

Container 'mtm' of 'deployment' 'mtm' in 'default' namespace should set securityContext.capabilities.drop

Rule: KSV-0004

Learn more

(IaC/Kubernetes)


[info] 28-76: CPU not limited

Container 'mtm' of Deployment 'mtm' should set 'resources.limits.cpu'

Rule: KSV-0011

Learn more

(IaC/Kubernetes)


[warning] 28-76: Runs as root user

Container 'mtm' of Deployment 'mtm' should set 'securityContext.runAsNonRoot' to true

Rule: KSV-0012

Learn more

(IaC/Kubernetes)


[error] 28-76: Root file system is not read-only

Container 'mtm' of Deployment 'mtm' should set 'securityContext.readOnlyRootFilesystem' to true

Rule: KSV-0014

Learn more

(IaC/Kubernetes)


[info] 28-76: CPU requests not specified

Container 'mtm' of Deployment 'mtm' should set 'resources.requests.cpu'

Rule: KSV-0015

Learn more

(IaC/Kubernetes)


[info] 28-76: Memory requests not specified

Container 'mtm' of Deployment 'mtm' should set 'resources.requests.memory'

Rule: KSV-0016

Learn more

(IaC/Kubernetes)


[info] 28-76: Memory not limited

Container 'mtm' of Deployment 'mtm' should set 'resources.limits.memory'

Rule: KSV-0018

Learn more

(IaC/Kubernetes)


[info] 28-76: Runs with UID <= 10000

Container 'mtm' of Deployment 'mtm' should set 'securityContext.runAsUser' > 10000

Rule: KSV-0020

Learn more

(IaC/Kubernetes)


[info] 28-76: Runs with GID <= 10000

Container 'mtm' of Deployment 'mtm' should set 'securityContext.runAsGroup' > 10000

Rule: KSV-0021

Learn more

(IaC/Kubernetes)


[info] 28-76: Runtime/Default Seccomp profile not set

Either Pod or Container should set 'securityContext.seccompProfile.type' to 'RuntimeDefault'

Rule: KSV-0030

Learn more

(IaC/Kubernetes)


[warning] 28-76: Seccomp policies disabled

container "mtm" of deployment "mtm" in "default" namespace should specify a seccomp profile

Rule: KSV-0104

Learn more

(IaC/Kubernetes)


[info] 28-76: Container capabilities must only include NET_BIND_SERVICE

container should drop all

Rule: KSV-0106

Learn more

(IaC/Kubernetes)


[error] 28-76: Default security context configured

container mtm in default namespace is using the default security context

Rule: KSV-0118

Learn more

(IaC/Kubernetes)


[error] 26-76: Default security context configured

deployment mtm in default namespace is using the default security context, which allows root privileges

Rule: KSV-0118

Learn more

(IaC/Kubernetes)


[warning] 28-76: Restrict container images to trusted registries

Container mtm in deployment mtm (namespace: default) uses an image from an untrusted registry.

Rule: KSV-0125

Learn more

(IaC/Kubernetes)

🪛 YAMLlint (1.37.1)
charts/default/templates/deployment.yaml

[error] 28-28: syntax error: expected , but found ''

(syntax)

🔇 Additional comments (3)
charts/default/values.yaml (1)

9-16: LGTM!

charts/default/templates/_helpers.tpl (1)

44-60: LGTM!

charts/default/templates/deployment.yaml (1)

28-28: LGTM!


📝 Walkthrough

Summary

  • Added project.image to resolve the image from .Values.image.repository and .Values.image.tag.
  • Default image is ghcr.io/simplify9/<chart name>:<chart version>.
  • Updated the deployment to use the helper.
  • Added image.repository and image.tag to values.yaml.

Risk: risk:low

Security-sensitive areas: Container image source and tag resolution changed. Review registry access and image provenance. No authentication or application security logic changed.

Test coverage impact: Helm linting and renders cover default values, pipeline-specific values, old-registry overrides, and six release comparisons.

Operational concerns: Existing deployments may pull from GHCR instead of Docker Hub. Ensure GHCR images and registry credentials are available before upgrade. Users can override the repository and tag. Rollback restores the previous chart behavior if the prior chart version remains available.

Walkthrough

The chart adds configurable image repository and tag values, resolves defaults through a new project.image helper, and uses the helper output for the deployment container image.

Changes

Container image configuration

Layer / File(s) Summary
Image values and resolution
charts/default/values.yaml, charts/default/templates/_helpers.tpl
The chart adds repository and tag overrides. Empty values default to ghcr.io/simplify9/<chart name> and .Chart.Version.
Deployment image integration
charts/default/templates/deployment.yaml
The deployment uses project.image instead of a fixed Docker Hub image path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 38181

The chart now honors configured image repositories and tags, defaulting current releases to the available public registry; no actionable merge-blocking risk remains after normal checks and review.

Suggested labels: infra, risk:high

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that the chart will honor image.repository and image.tag instead of using a hardcoded Docker Hub image.
Description check ✅ Passed The description directly explains the hardcoded image issue, the GHCR default, the configurable overrides, and the verification performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MusaMisto
MusaMisto merged commit fc57bf5 into main Aug 31, 2026
5 checks passed
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