Skip to content

fix(helm): use appVersion as default image tag instead of latest#895

Merged
jannfis merged 4 commits intoargoproj-labs:mainfrom
enbiyagoral:fix/helm-agent-image-tag-convention
Apr 13, 2026
Merged

fix(helm): use appVersion as default image tag instead of latest#895
jannfis merged 4 commits intoargoproj-labs:mainfrom
enbiyagoral:fix/helm-agent-image-tag-convention

Conversation

@enbiyagoral
Copy link
Copy Markdown
Contributor

@enbiyagoral enbiyagoral commented Apr 13, 2026

Summary

The agent Helm chart hardcodes image.tag to latest and appVersion is stuck at 0.4.1 (project is at v0.8.1). This makes deployments non-deterministic and helm list shows incorrect version info.

This PR aligns the agent chart's image tag handling with the official argo-cd Helm chart pattern (argo-cd.defaultTag):

  • Add defaultTag helper that falls back to Chart.AppVersion when image.tag is empty
  • Change image.tag default from "latest" to "" so appVersion is used
  • Change pullPolicy from Always to IfNotPresent
  • Bump appVersion to v0.8.1 and chart version to 0.2.0
  • Sync values.schema.json defaults

Behavior

Scenario Before After
Default install argocd-agent:latest argocd-agent:v0.8.1
--set image.tag=custom argocd-agent:custom argocd-agent:custom
helm list APP VERSION 0.4.1 v0.8.1

Test plan

  • helm template renders v0.8.1 as default tag
  • helm template --set image.tag=custom override works
  • imagePullPolicy renders as IfNotPresent
  • Schema validation passes

Summary by CodeRabbit

  • Chores

    • Helm chart bumped to v0.2.0 and appVersion to v0.8.1
    • Default image pull policy changed to IfNotPresent
    • Image tag now defaults to the chart appVersion when no explicit tag is set
    • Chart templates updated to consistently resolve the image tag from values or appVersion
  • Documentation

    • README and chart metadata badges updated to reflect new versions and defaults

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d87ec3db-d7ac-4381-9994-f379844d6ac1

📥 Commits

Reviewing files that changed from the base of the PR and between 3dec7ba and bed7dcf.

📒 Files selected for processing (6)
  • install/helm-repo/argocd-agent-agent/Chart.yaml
  • install/helm-repo/argocd-agent-agent/README.md
  • install/helm-repo/argocd-agent-agent/templates/_helpers.tpl
  • install/helm-repo/argocd-agent-agent/templates/agent-deployment.yaml
  • install/helm-repo/argocd-agent-agent/values.schema.json
  • install/helm-repo/argocd-agent-agent/values.yaml
✅ Files skipped from review due to trivial changes (4)
  • install/helm-repo/argocd-agent-agent/values.yaml
  • install/helm-repo/argocd-agent-agent/README.md
  • install/helm-repo/argocd-agent-agent/values.schema.json
  • install/helm-repo/argocd-agent-agent/Chart.yaml

📝 Walkthrough

Walkthrough

Helm chart bumped (version 0.2.0, appVersion v0.8.1); added helper to choose image tag from Values or Chart.AppVersion; deployment template now uses that helper and removes a duplicated container; image.tag default set to empty and pullPolicy default changed to IfNotPresent; README and schema updated.

Changes

Cohort / File(s) Summary
Chart Metadata
install/helm-repo/argocd-agent-agent/Chart.yaml
Bumped version 0.1.0 → 0.2.0 and appVersion 0.4.1 → v0.8.1; minor comment spacing adjusted.
Template Helpers
install/helm-repo/argocd-agent-agent/templates/_helpers.tpl
Added argocd-agent-agent.defaultTag helper that returns .Values.image.tag if set, otherwise .Chart.AppVersion.
Deployment Template
install/helm-repo/argocd-agent-agent/templates/agent-deployment.yaml
Replaced direct .Values.image.tag usage with include "argocd-agent-agent.defaultTag" . and removed a duplicated container stanza, leaving a single container definition.
Configuration Schema & Defaults
install/helm-repo/argocd-agent-agent/values.schema.json, install/helm-repo/argocd-agent-agent/values.yaml
Changed image.pullPolicy default AlwaysIfNotPresent; changed image.tag default latest"" and updated description to state chart appVersion is used when tag is empty.
Documentation
install/helm-repo/argocd-agent-agent/README.md
Updated Chart Version/AppVersion badges and documented new defaults shown in values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jgwest
  • chetan-rns
  • mikeshng

Poem

🐰 I hop the chart and tweak a tag,
A helper picks the perfect flag,
One container stands, no duplicate fray,
Pulls kept light, defaults clear as day,
I nibble diffs and bound away ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: updating the Helm chart to use appVersion as the default image tag instead of 'latest'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@enbiyagoral enbiyagoral force-pushed the fix/helm-agent-image-tag-convention branch 2 times, most recently from 1d2164b to 2b87270 Compare April 13, 2026 08:56
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@install/helm-repo/argocd-agent-agent/templates/agent-deployment.yaml`:
- Around line 246-248: The container block in the Deployment template defines
name, image and imagePullPolicy twice (the second set uses "{{
.Values.image.repository }}:{{ include "argocd-agent-agent.defaultTag" . }}" and
{{ .Values.image.pullPolicy }}), causing duplicate YAML keys; remove the
redundant definitions (the name/image/imagePullPolicy lines at the later
location) so only the original declarations (the ones near the top of the
container spec) remain, leaving the container definition with a single name,
image, and imagePullPolicy (refer to the container block and the include
"argocd-agent-agent.defaultTag" usage to locate the duplicates).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c934fadd-5d58-427c-9fa6-bce0a7f1c2cc

📥 Commits

Reviewing files that changed from the base of the PR and between d253a47 and 3009353.

📒 Files selected for processing (5)
  • install/helm-repo/argocd-agent-agent/Chart.yaml
  • install/helm-repo/argocd-agent-agent/templates/_helpers.tpl
  • install/helm-repo/argocd-agent-agent/templates/agent-deployment.yaml
  • install/helm-repo/argocd-agent-agent/values.schema.json
  • install/helm-repo/argocd-agent-agent/values.yaml

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.55%. Comparing base (6bbfea2) to head (bed7dcf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #895   +/-   ##
=======================================
  Coverage   46.55%   46.55%           
=======================================
  Files         122      122           
  Lines       17456    17456           
=======================================
  Hits         8127     8127           
  Misses       8585     8585           
  Partials      744      744           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jannfis
Copy link
Copy Markdown
Collaborator

jannfis commented Apr 13, 2026

Thanks @enbiyagoral!

The Helm documentation needs to be updated, too. You can either install helm-docs locally or wait for PR #896 to be merged, and run make generate-helm-docs afterwards and push changes to your PR.

@enbiyagoral
Copy link
Copy Markdown
Contributor Author

Thanks @enbiyagoral!

The Helm documentation needs to be updated, too. You can either install helm-docs locally or wait for PR #896 to be merged, and run make generate-helm-docs afterwards and push changes to your PR.

Done! Installed helm-docs locally and regenerated the README.

Signed-off-by: Enbiya Goral <100806254+enbiyagoral@users.noreply.github.com>
Signed-off-by: Enbiya Goral <100806254+enbiyagoral@users.noreply.github.com>
Signed-off-by: Enbiya Goral <100806254+enbiyagoral@users.noreply.github.com>
@enbiyagoral enbiyagoral force-pushed the fix/helm-agent-image-tag-convention branch from 3dec7ba to aa7fa21 Compare April 13, 2026 13:29
Copy link
Copy Markdown
Collaborator

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@jannfis jannfis enabled auto-merge (squash) April 13, 2026 16:53
@jannfis jannfis merged commit e589ae1 into argoproj-labs:main Apr 13, 2026
19 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.

3 participants