Skip to content

allow image references combining a tag and a digest#4579

Merged
liamfallon merged 1 commit into
kptdev:mainfrom
pddg:fix/issue4578
Jun 16, 2026
Merged

allow image references combining a tag and a digest#4579
liamfallon merged 1 commit into
kptdev:mainfrom
pddg:fix/issue4578

Conversation

@pddg

@pddg pddg commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

fix #4578

Motivation

The name:tag@digest form is valid per the OCI/Docker reference grammar.

Copilot AI review requested due to automatic review settings June 10, 2026 10:15
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. go Pull requests that update Go code labels Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates function image reference validation to use the upstream OCI/Docker reference parser and expands test coverage for tag+digest combinations.

Changes:

  • Replace custom regex-based image reference validation with github.com/distribution/reference.
  • Update validation documentation to describe the accepted reference grammar (tag, digest, or both).
  • Add tests covering tag+digest references and an invalid name@tag input.

Reviewed changes

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

File Description
pkg/api/kptfile/v1/validation.go Switches validation to distribution/reference.Parse and updates doc comment accordingly.
pkg/api/kptfile/v1/validation_test.go Adds test cases for tag+digest references and an invalid @v0.1.0 reference.

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

Comment thread pkg/api/kptfile/v1/validation.go Outdated
@pddg pddg force-pushed the fix/issue4578 branch 2 times, most recently from c00080c to 70dd193 Compare June 10, 2026 10:23
@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit ef9fe68
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a29393c5a3cae00086bf67d
😎 Deploy Preview https://deploy-preview-4579--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit c00080c
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a293a0ca56f750008021dbb
😎 Deploy Preview https://deploy-preview-4579--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 35affc3
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a30a12ed0904e0008c34c5f
😎 Deploy Preview https://deploy-preview-4579--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pddg

pddg commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

The failing test passes without any issues in my environment.

$ KRM_FN_RUNTIME=docker go test --tags=docker ./e2e/... -run TestFnRender/testdata/fn-render/out-of-place-fnchain-stdout
ok      github.com/kptdev/kpt/e2e       2.497s

It does not seem to be related to the changes in this PR. Is the test itself flaky?

@efiacor

efiacor commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The failing test passes without any issues in my environment.

$ KRM_FN_RUNTIME=docker go test --tags=docker ./e2e/... -run TestFnRender/testdata/fn-render/out-of-place-fnchain-stdout
ok      github.com/kptdev/kpt/e2e       2.497s

It does not seem to be related to the changes in this PR. Is the test itself flaky?

Yes, it looks like an image pull failure from ghcr. Re run passed.

@efiacor efiacor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks ok. Need to address any copilot comments before merge.

@dosubot dosubot Bot added the lgtm label Jun 11, 2026
Comment thread go.mod Outdated
@liamfallon liamfallon self-requested a review June 15, 2026 06:02
@liamfallon

Copy link
Copy Markdown
Contributor

There's something weird happening on the CI jobs, nothing to do with your PR. I'll check with the CI experts later to see what's wrong.

@liamfallon

Copy link
Copy Markdown
Contributor

@pddg please rebase this PR to pick up the CI fix from #4589 that we just merged.

Signed-off-by: Shoma Kokuryo <s.kokuryo@gmail.com>
@liamfallon liamfallon merged commit ad02e11 into kptdev:main Jun 16, 2026
12 checks passed
@liamfallon

Copy link
Copy Markdown
Contributor

Thanks for the contribution @pddg

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

Labels

go Pull requests that update Go code lgtm size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kptfile pipeline rejects image references that combine a tag and a digest (name:tag@sha256:...)

4 participants