Local tag lister for semantic version constraint matching#4458
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ab44092 to
22e2bde
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements local tag listing for semantic version constraint matching, addressing issue #4457. It allows kpt to search for tags in local container images first before attempting to query remote registries, reducing unnecessary network calls and enabling testing with in-progress function versions.
Changes:
- Modified TagResolver to accept a slice of TagListers instead of a single lister, enabling fallback from local to remote tag sources
- Added LocalLister implementation that uses container CLI tools (docker/podman/nerdctl) to list local OCI image tags
- Moved RegClientLister from container.go to a new container_utils.go file
- Updated tag resolution logic to iterate through listers, logging errors and continuing to the next lister on failure
- Added Name() method to the TagLister interface
- Updated tests to reflect the new architecture and added comprehensive tests for the abbrevSlice function
- Minor style improvements: removed build tags and loop variable shadowing from container_test.go
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/fnruntime/tag_resolution.go | Modified TagResolver to use a slice of listers and updated the resolution logic to check each lister in order |
| internal/fnruntime/tag_resolution_test.go | Updated tests to use the new Listers field and added comprehensive tests for abbrevSlice; updated error expectations |
| internal/fnruntime/container.go | Removed RegClientLister code, removed regclientref import, updated to use new Listers slice |
| internal/fnruntime/container_utils.go | New file containing RegClientLister (moved) and LocalLister implementation with helper function linesToSlice |
| internal/fnruntime/container_test.go | Removed build tags and cleaned up loop variable shadowing |
| pkg/test/runner/runner.go | Removed extra blank line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
95fff62 to
2b3f122
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Fixes #4457
docker/podman/nerdctl image lswith a filter to search for tags locally.container_utils.goMight need doc updates, let's see if Dosu finds anything.