allow image references combining a tag and a digest#4579
Conversation
There was a problem hiding this comment.
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@taginput.
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>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The failing test passes without any issues in my environment. It does not seem to be related to the changes in this PR. Is the test itself flaky? |
Description
fix #4578
Motivation
The
name:tag@digestform is valid per the OCI/Docker reference grammar.