Semantic versioning constraints for function images#4386
Semantic versioning constraints for function images#4386mozesl-nokia wants to merge 11 commits intokptdev:mainfrom
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Adds semantic version tag constraints for Kptfile pipeline functions and kpt fn eval, resolving to the highest matching remote OCI tag using the Masterminds semver constraint spec.
Changes:
- Introduces
tagonpkg/api/kptfile/v1.Functionand threads it through function execution (including newkpt fn eval --tagsupport). - Implements remote tag listing + semver constraint resolution (regclient + Masterminds/semver) with unit tests.
- Updates docs and e2e testdata/expectations (including
KRM_FN_RUNTIMEenv var naming and regenerated CLI docs).
Reviewed changes
Copilot reviewed 27 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| thirdparty/cmdconfig/commands/cmdeval/cmdeval.go | Adds --tag flag to kpt fn eval runner wiring. |
| pkg/test/runner/runner.go | Passes --tag through test runner to kpt fn eval. |
| pkg/test/runner/config.go | Adds tag to eval test case config schema. |
| pkg/api/kptfile/v1/types.go | Adds Function.Tag field and updates controller-gen directive. |
| main.go | Updates mdtogo go:generate inputs/paths for CLI docs generation. |
| internal/fnruntime/tag_resolution.go | New tag constraint resolution logic (semver + remote tag listing). |
| internal/fnruntime/tag_resolution_test.go | Unit tests for tag filtering/sorting and resolution behavior. |
| internal/fnruntime/runner.go | Threads Function.Tag into container runtime execution. |
| internal/fnruntime/container.go | Adds regclient-based tag lister and resolves image tag before container execution. |
| internal/docs/generated/overview/docs.go | Regenerated overview docs output (now missing CliShort). |
| internal/docs/generated/fndocs/docs.go | Regenerated function command docs including --tag documentation. |
| internal/docs/generated/rpkgdocs/docs.go | Removes generated rpkg docs output. |
| internal/docs/generated/repodocs/docs.go | Removes generated repo docs output. |
| go.mod | Adds semver + regclient deps; bumps cobra; indirect dep updates. |
| go.sum | Adds/updates checksums for new/updated dependencies. |
| e2e/testdata/fn-render/image-pull-policy-if-not-present/.expected/setup.sh | Updates expected env var usage to KRM_FN_RUNTIME. |
| e2e/testdata/fn-render/image-pull-policy-always/.expected/setup.sh | Updates expected env var usage to KRM_FN_RUNTIME. |
| e2e/testdata/fn-render/default-runtime/.expected/exec.sh | Updates expected env var usage to KRM_FN_RUNTIME. |
| e2e/testdata/fn-render/basicpipeline-semver/resources.yaml | New e2e package resources for semver-tag pipeline test. |
| e2e/testdata/fn-render/basicpipeline-semver/Kptfile | New e2e Kptfile using tag constraints for pipeline functions. |
| e2e/testdata/fn-render/basicpipeline-semver/.krmignore | Ignores .expected in new e2e test package. |
| e2e/testdata/fn-render/basicpipeline-semver/.expected/diff.patch | Expected output for new semver-tag pipeline test. |
| e2e/testdata/fn-render/basicpipeline-semver/.expected/config.yaml | Expected config for new semver-tag pipeline test. |
| e2e/testdata/fn-eval/simple-function-with-tag/resources.yaml | New e2e resources for fn eval with --tag. |
| e2e/testdata/fn-eval/simple-function-with-tag/.krmignore | Ignores .expected in new e2e test package. |
| e2e/testdata/fn-eval/simple-function-with-tag/.expected/diff.patch | Expected output for new fn eval --tag test. |
| e2e/testdata/fn-eval/simple-function-with-tag/.expected/config.yaml | Expected config for new fn eval --tag test. |
| e2e/testdata/fn-eval/image-pull-policy-if-not-present/.expected/setup.sh | Updates expected env var usage to KRM_FN_RUNTIME. |
| e2e/testdata/fn-eval/default-runtime/.expected/exec.sh | Updates expected env var usage to KRM_FN_RUNTIME. |
| documentation/content/en/reference/cli/fn/render/_index.md | Updates docs to use KRM_FN_RUNTIME. |
| documentation/content/en/reference/cli/fn/eval/_index.md | Documents --tag flag behavior. |
| documentation/content/en/book/04-using-functions/_index.md | Documents new tag field semantics with examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 32 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
liamfallon
left a comment
There was a problem hiding this comment.
Looks good, just one or two small things.
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>
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>
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>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 33 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #4383
It is now possible to provide semantic version constraints in a new
tagfield based on the using the spec of https://github.com/Masterminds/semver.kpt fn evalis also supported with a new--tagflag.I've also added documentation for the feature, including CLI.
Fixed mdtogo generation as well.