Skip to content

Semantic versioning constraints for function images#4386

Open
mozesl-nokia wants to merge 11 commits intokptdev:mainfrom
nokia:semver
Open

Semantic versioning constraints for function images#4386
mozesl-nokia wants to merge 11 commits intokptdev:mainfrom
nokia:semver

Conversation

@mozesl-nokia
Copy link

Closes #4383

It is now possible to provide semantic version constraints in a new tag field based on the using the spec of https://github.com/Masterminds/semver. kpt fn eval is also supported with a new --tag flag.

I've also added documentation for the feature, including CLI.

Fixed mdtogo generation as well.

Copilot AI review requested due to automatic review settings February 12, 2026 14:49
@mozesl-nokia mozesl-nokia added documentation Improvements or additions to documentation enhancement New feature or request area/fn-runtime KRM function runtime go Pull requests that update Go code labels Feb 12, 2026
@netlify
Copy link

netlify bot commented Feb 12, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 1ae455b
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6992ed10d215e00008ca43e2
😎 Deploy Preview https://deploy-preview-4386--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tag on pkg/api/kptfile/v1.Function and threads it through function execution (including new kpt fn eval --tag support).
  • Implements remote tag listing + semver constraint resolution (regclient + Masterminds/semver) with unit tests.
  • Updates docs and e2e testdata/expectations (including KRM_FN_RUNTIME env 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@liamfallon liamfallon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
@dosubot dosubot bot added the lgtm label Feb 16, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fn-catalog Functions Catalog area/fn-runtime KRM function runtime documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update Go code lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Semantic Version Constraints for Pipelines

2 participants