Expected behavior
Function pipeline output includes version tag of the running/passed/failed function image as specified in the Kptfile.
Actual behavior
When using the tag attribute (with or without a semantic version constraint) or when no version tag is included in either tag or image (defaulting to "latest"), function pipeline output does not include the version tag of the executed image.
Information
Results from the introduction of the tag attribute in #4383. This is a problem especially when using a semantic version constraint, as there is no way to tell from the output what actual image version was selected and run.
Take this example Kptfile from the attached sample.zip:
apiVersion: kpt.dev/v1
kind: Kptfile
metadata:
name: app
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace
tag: "0.4.1 - 0.4.3"
configMap:
namespace: staging
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels
tag: "~0.2"
configMap:
tier: backend
Running kpt fn render results in the following output - note the lack of versions in the [RUNNING] and [PASS] lines:
Package: "sample"
[RUNNING] "ghcr.io/kptdev/krm-functions-catalog/set-namespace"
[PASS] "ghcr.io/kptdev/krm-functions-catalog/set-namespace" in 1.5s
[Results]: [info]: all matching namespaces are already "staging". no value changed, [info]: all `depends-on` annotations are up-to-date. no `namespace` changed
[RUNNING] "ghcr.io/kptdev/krm-functions-catalog/set-labels"
[PASS] "ghcr.io/kptdev/krm-functions-catalog/set-labels" in 1.4s
[Results]: [info]: set 6 labels in total
Successfully executed 2 function(s) in 1 package(s).
We should include the selected version tag in the image names both before ([RUNNING] lines) and after running ([PASS] or [FAIL] lines). In the case of a semantic version constraint, where the version tag is not yet resolved when the [RUNNING] line is printed, the semantic version constraint from the tag attribute should be included in full to indicate the use of the constraint.
Ideally, this should cover the following cases:
tag not set; exact version tag included in image
- OK in existing behaviour; should be preserved
tag not set; no version tag in image
- kpt resolution defaults to "latest" but "latest" is not included in output
- for completeness' sake, code change: append "latest" tag to
[RUNNING], [PASS], or [FAIL] lines in this case
tag set; no version tag in image
- code change: append value of
tag to image names in [RUNNING] lines
- code change: append resolved version tag to image names in
[PASS] or [FAIL] lines
tag set; exact version tag in image
- kpt behaviour has
tag value override any version set in image
- BUT the output will show the version from
image, whereas the actual function image was the one from tag!
- in this case, the value or resolved version from
tag must replace the one from image for the output:
- code change: in
[RUNNING] lines, replace version tag in image names with value of tag
- code change: in
[PASS] or [FAIL] lines, replace version tag in image names with resolved version tag
Steps to reproduce the behavior
- Build kpt from source on
main branch to obtain tag attribute and semantic version constraint functionality
- Download and unzip the attached sample kpt package, sample.zip
cd sample
kpt fn render, making sure to use the kpt binary built in step 1 (likely $GOPATH/bin/kpt)
- Observe confusing lack of function image version information in the kpt output
Expected behavior
Function pipeline output includes version tag of the running/passed/failed function image as specified in the Kptfile.
Actual behavior
When using the
tagattribute (with or without a semantic version constraint) or when no version tag is included in eithertagorimage(defaulting to "latest"), function pipeline output does not include the version tag of the executed image.Information
Results from the introduction of the
tagattribute in #4383. This is a problem especially when using a semantic version constraint, as there is no way to tell from the output what actual image version was selected and run.Take this example Kptfile from the attached sample.zip:
Running
kpt fn renderresults in the following output - note the lack of versions in the[RUNNING]and[PASS]lines:We should include the selected version tag in the image names both before (
[RUNNING]lines) and after running ([PASS]or[FAIL]lines). In the case of a semantic version constraint, where the version tag is not yet resolved when the[RUNNING]line is printed, the semantic version constraint from thetagattribute should be included in full to indicate the use of the constraint.Ideally, this should cover the following cases:
tagnot set; exact version tag included inimagetagnot set; no version tag inimage[RUNNING],[PASS], or[FAIL]lines in this casetagset; no version tag inimagetagto image names in[RUNNING]lines[PASS]or[FAIL]linestagset; exact version tag inimagetagvalue override any version set inimageimage, whereas the actual function image was the one fromtag!tagmust replace the one fromimagefor the output:[RUNNING]lines, replace version tag in image names with value oftag[PASS]or[FAIL]lines, replace version tag in image names with resolved version tagSteps to reproduce the behavior
mainbranch to obtaintagattribute and semantic version constraint functionalitycd samplekpt fn render, making sure to use the kpt binary built in step 1 (likely$GOPATH/bin/kpt)