Skip to content

fix: reuse existing secretKey and TLS certs to prevent ArgoCD drift - #2310

Open
MyoungHaSong wants to merge 1 commit into
goharbor:mainfrom
MyoungHaSong:fix/argocd-secret-drift
Open

fix: reuse existing secretKey and TLS certs to prevent ArgoCD drift#2310
MyoungHaSong wants to merge 1 commit into
goharbor:mainfrom
MyoungHaSong:fix/argocd-secret-drift

Conversation

@MyoungHaSong

Copy link
Copy Markdown

Summary

When using ArgoCD or other GitOps tools, the helm template is rendered on each sync. This causes unnecessary secret updates and pod restarts because:

  1. secretKey did not use the lookup function to check for existing values
  2. TLS certificates (tls.key, tls.crt) were always regenerated with genCA

Changes

  • secretKey: Add lookup fallback to reuse existing value from the cluster
  • tls.key/tls.crt: Check for existing certificates before generating new ones with genCA

How it works

The fix follows the same pattern already used for secret and CSRF_KEY:

# Before (secretKey)
secretKey: {{ .Values.secretKey | b64enc | quote }}

# After (secretKey)
secretKey: {{ .Values.secretKey | default (include "harbor.secretKeyHelper" ...) | default "not-a-secure-key" | b64enc | quote }}

For TLS certificates, we check if both tls.key and tls.crt exist in the current secret before falling back to genCA.

Testing

  • helm template renders successfully
  • Fresh install: generates new secrets as expected
  • Existing install: reuses existing values (no drift)

Closes #2263

When using ArgoCD or other GitOps tools, the helm template is rendered
on each sync. Previously, `secretKey` did not use the lookup function
to check for existing values, and TLS certificates were always
regenerated with `genCA`. This caused unnecessary secret updates and
pod restarts.

Changes:
- secretKey: Add lookup fallback to reuse existing value
- tls.key/tls.crt: Check for existing certificates before generating new ones

This fixes the drift issue reported in goharbor#2263 where ArgoCD detects
changes on every sync due to randomly generated values.

Closes goharbor#2263

Signed-off-by: danny.song <danny.song@sionic.ai>
@MyoungHaSong
MyoungHaSong force-pushed the fix/argocd-secret-drift branch from 12a26eb to 70a2e79 Compare February 3, 2026 16:53
@MinerYang MinerYang self-assigned this Feb 9, 2026
isityael added a commit to isityael/harbor-helm that referenced this pull request Mar 16, 2026
Cherry-picked upstream PRs:
- goharbor#2310: fix secret drift for ArgoCD (fixes goharbor#2263)
- goharbor#2307: default image tag to chart appVersion
- goharbor#2314: fix rollingUpdate checks for jobservice/registry
- goharbor#2312: fix ArgoCD diff in httproute
- goharbor#2317: configurable health probe timeoutSeconds/failureThreshold
- goharbor#2330: parametrise gracePeriodTerminationSeconds + core startupProbe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions Bot added the Stale label Apr 10, 2026
@alessio-pascolini

alessio-pascolini commented Apr 10, 2026

Copy link
Copy Markdown

Please keep it open

@github-actions github-actions Bot removed the Stale label Apr 11, 2026
isityael added a commit to isityael/harbor-helm that referenced this pull request Apr 14, 2026
Cherry-picked upstream PRs:
- goharbor#2310: fix secret drift for ArgoCD (fixes goharbor#2263)
- goharbor#2307: default image tag to chart appVersion
- goharbor#2314: fix rollingUpdate checks for jobservice/registry
- goharbor#2312: fix ArgoCD diff in httproute
- goharbor#2317: configurable health probe timeoutSeconds/failureThreshold
- goharbor#2330: parametrise gracePeriodTerminationSeconds + core startupProbe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
isityael added a commit to isityael/harbor-helm that referenced this pull request Apr 14, 2026
Cherry-picked upstream PRs:
- goharbor#2310: fix secret drift for ArgoCD (fixes goharbor#2263)
- goharbor#2307: default image tag to chart appVersion
- goharbor#2314: fix rollingUpdate checks for jobservice/registry
- goharbor#2312: fix ArgoCD diff in httproute
- goharbor#2317: configurable health probe timeoutSeconds/failureThreshold
- goharbor#2330: parametrise gracePeriodTerminationSeconds + core startupProbe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: replace upstream GHA with GHCR OCI release + lint workflows

- release.yaml: package and push to oci://ghcr.io/sm-moshi/charts on tag push
- lint.yaml: helm lint + template on PRs and sm-moshi/main pushes
- Remove upstream-specific workflows (Docker Hub publish, stale issues, integration, unittest)
- Add CLAUDE.md with fork maintenance instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: replace GitHub Actions with Woodpecker CI pipelines

- .woodpecker/lint.yaml: helm lint + template on push/PR
- .woodpecker/release.yaml: package, push to ghcr.io/sm-moshi/charts,
  create GitHub release on tag push
- Remove .github/workflows/ (GHA no longer needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: use DHI helm 4.1.3 image, pinned by digest

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

build: mark chart as 1.19.0-rc2 to match appVersion v2.15.0-rc2

Chart version should reflect pre-release status while shipping RC images.
Will bump to 1.19.0 when Harbor v2.15.0 GA ships.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
isityael added a commit to isityael/harbor-helm that referenced this pull request Apr 14, 2026
Cherry-picked upstream PRs:
- goharbor#2310: fix secret drift for ArgoCD (fixes goharbor#2263)
- goharbor#2307: default image tag to chart appVersion
- goharbor#2314: fix rollingUpdate checks for jobservice/registry
- goharbor#2312: fix ArgoCD diff in httproute
- goharbor#2317: configurable health probe timeoutSeconds/failureThreshold
- goharbor#2330: parametrise gracePeriodTerminationSeconds + core startupProbe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: replace upstream GHA with GHCR OCI release + lint workflows

- release.yaml: package and push to oci://ghcr.io/sm-moshi/charts on tag push
- lint.yaml: helm lint + template on PRs and sm-moshi/main pushes
- Remove upstream-specific workflows (Docker Hub publish, stale issues, integration, unittest)
- Add CLAUDE.md with fork maintenance instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: replace GitHub Actions with Woodpecker CI pipelines

- .woodpecker/lint.yaml: helm lint + template on push/PR
- .woodpecker/release.yaml: package, push to ghcr.io/sm-moshi/charts,
  create GitHub release on tag push
- Remove .github/workflows/ (GHA no longer needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: use DHI helm 4.1.3 image, pinned by digest

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

build: mark chart as 1.19.0-rc2 to match appVersion v2.15.0-rc2

Chart version should reflect pre-release status while shipping RC images.
Will bump to 1.19.0 when Harbor v2.15.0 GA ships.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
isityael added a commit to isityael/harbor-helm that referenced this pull request Apr 14, 2026
Cherry-picked upstream PRs:
- goharbor#2310: fix secret drift for ArgoCD (fixes goharbor#2263)
- goharbor#2307: default image tag to chart appVersion
- goharbor#2314: fix rollingUpdate checks for jobservice/registry
- goharbor#2312: fix ArgoCD diff in httproute
- goharbor#2317: configurable health probe timeoutSeconds/failureThreshold
- goharbor#2330: parametrise gracePeriodTerminationSeconds + core startupProbe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: replace upstream GHA with GHCR OCI release + lint workflows

- release.yaml: package and push to oci://ghcr.io/sm-moshi/charts on tag push
- lint.yaml: helm lint + template on PRs and sm-moshi/main pushes
- Remove upstream-specific workflows (Docker Hub publish, stale issues, integration, unittest)
- Add CLAUDE.md with fork maintenance instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: replace GitHub Actions with Woodpecker CI pipelines

- .woodpecker/lint.yaml: helm lint + template on push/PR
- .woodpecker/release.yaml: package, push to ghcr.io/sm-moshi/charts,
  create GitHub release on tag push
- Remove .github/workflows/ (GHA no longer needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

ci: use DHI helm 4.1.3 image, pinned by digest

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

build: mark chart as 1.19.0-rc2 to match appVersion v2.15.0-rc2

Chart version should reflect pre-release status while shipping RC images.
Will bump to 1.19.0 when Harbor v2.15.0 GA ships.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@igorrudyk

Copy link
Copy Markdown

Please merge it

@github-actions

Copy link
Copy Markdown

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions Bot added the Stale label Jun 30, 2026
@alessio-pascolini

Copy link
Copy Markdown

Unstale

@github-actions github-actions Bot removed the Stale label Jul 2, 2026
@WoahitsJoe

Copy link
Copy Markdown

@MinerYang Any chance on getting this merged? It's causing replicaset revision spam

@WoahitsJoe

Copy link
Copy Markdown

@stonezdj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArgoCD: drift: randAlphaNum

5 participants