Create a central image utility package - #1103
Merged
Merged
Conversation
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>
mozesl-nokia
requested review from
efiacor,
kispaljr and
liamfallon
as code owners
July 6, 2026 08:33
✅ Deploy Preview for kpt-porch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a centralized Go utility package for OCI image reference handling and migrates existing image parsing/joining/semver-selection call sites to use it, reducing duplicated and inconsistent parsing logic across the codebase.
Changes:
- Added
pkg/util/imagewithParse,Join, andFindBestSemverMatch, plus unit tests. - Removed legacy image helpers and semver matching from
pkg/util/util.go(and corresponding tests). - Updated engine/runtime and function executor/controller code paths to use the new image utility.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/util/util.go | Removes legacy semver and image string helpers in favor of the new package. |
| pkg/util/util_test.go | Removes tests that covered the deleted semver helper. |
| pkg/util/image/types.go | Adds ParsedImage struct and helpers to reconstruct/present parsed references. |
| pkg/util/image/regex.go | Adds registry-detection regex (sourced from regclient) used by parsing logic. |
| pkg/util/image/image.go | Implements semver tag selection, join helper, and reference parsing. |
| pkg/util/image/image_test.go | Adds unit tests for semver selection and parsing behavior. |
| pkg/engine/builtinruntime.go | Switches builtin runner logic to use the new parsing + semver utilities. |
| pkg/engine/builtinruntime_test.go | Updates tests to use new join helper and adjusts logging expectations. |
| func/internal/podcachemanager.go | Switches function keying/joining to new parsing/join utilities. |
| func/internal/executableevaluator.go | Adjusts logging verbosity for explicit-tag execution path. |
| func/internal/executableevaluator_test.go | Updates join usage, log assertions, and ensures klog verbosity in tests. |
| controllers/functionconfigs/reconciler/functionconfigreconciler.go | Refactors cache lookups to use parsed image components and new semver helper. |
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>
Assisted-by: Cursor:composer-2.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
liamfallon
previously approved these changes
Jul 8, 2026
|
liamfallon
approved these changes
Jul 20, 2026
rendre-greyling
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Create a central image utility package
Originally part of #1019
Description
distributionandregclient, with some regex taken from the latterRelated Issue(s)
Type of Change
Checklist
Documentation added/updatedAdditional Notes (Optional)
distribution/referencetypes andgoogle/go-containerregistry/nametypesAI Disclosure
If so, please describe how: