Skip to content

Digest pinning support for Trivy image. - #2370

Open
Vinnie161 wants to merge 1 commit into
goharbor:mainfrom
lidofinance:feature/digest-pinning-support-for-trivy
Open

Digest pinning support for Trivy image.#2370
Vinnie161 wants to merge 1 commit into
goharbor:mainfrom
lidofinance:feature/digest-pinning-support-for-trivy

Conversation

@Vinnie161

@Vinnie161 Vinnie161 commented May 12, 2026

Copy link
Copy Markdown

Summary

This change adds optional digest support for the Harbor Trivy adapter image.

Currently the Trivy StatefulSet always renders the image as:

  <repository>:<tag>

This makes it impossible to use digest-based image references such as:

  goharbor/trivy-adapter-photon@sha256:<digest>

The new trivy.image.digest value is optional and backward compatible:

  • when trivy.image.digest is empty, the chart keeps rendering <repository>:<tag>
  • when trivy.image.digest is set, the chart renders <repository>@<digest>

This allows users to pin the Trivy adapter image by immutable digest while preserving the existing tag-based behavior by default.

Signed-off-by: Vitaliy P <vpr@lido.fi>
@Vinnie161
Vinnie161 force-pushed the feature/digest-pinning-support-for-trivy branch from 539079b to f2ce44f Compare May 12, 2026 13:44
@MinerYang

MinerYang commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Let's discuss more in this thread
#2372 (comment)

Copilot AI 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.

Pull request overview

Adds optional digest pinning for the Harbor Trivy adapter image so chart users can render immutable repository@digest references while keeping the existing repository:tag behavior by default.

Changes:

  • Introduces trivy.image.digest (optional) in values.yaml, documented as taking precedence over trivy.image.tag.
  • Updates the Trivy StatefulSet template to render repository@digest when a digest is provided, otherwise repository:tag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
values.yaml Adds the new trivy.image.digest value and inline documentation for digest-over-tag behavior.
templates/trivy/trivy-sts.yaml Updates the Trivy container image reference rendering to support digest pinning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread values.yaml
Comment on lines +930 to +933
# The image digest to pull.
# If set, it takes precedence over the image tag.
# Example: sha256:...
digest: ""
containers:
- name: trivy
image: {{ .Values.trivy.image.repository }}:{{ .Values.trivy.image.tag }}
image: {{ .Values.trivy.image.repository }}{{- if .Values.trivy.image.digest }}@{{ .Values.trivy.image.digest }}{{- else }}:{{ .Values.trivy.image.tag }}{{- end }}
@MinerYang

MinerYang commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Hi @Vinnie161 ,

Sorry for the late response. Would you like to continue working on this PR and add a UT and update README for this configuration?

Thanks,
Miner

@Vinnie161

Copy link
Copy Markdown
Author

Hi, @MinerYang!
Sorry, I'm overloaded right now. I'll try to get back to this PR when I have some time.

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.

3 participants