Skip to content

allow image references combining a tag and a digest#4579

Open
pddg wants to merge 1 commit into
kptdev:mainfrom
pddg:fix/issue4578
Open

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

Conversation

@pddg

@pddg pddg commented Jun 10, 2026

Copy link
Copy Markdown

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.

if !matched {
return fmt.Errorf("function name %q is invalid", name)
if _, err := reference.Parse(name); err != nil {
return fmt.Errorf("function name %q is invalid: %w", name, err)
Signed-off-by: Shoma Kokuryo <s.kokuryo@gmail.com>
@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 70dd193
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a293b1eff117b00085abf18
😎 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
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?

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 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:...)

2 participants