pipeline
pipeline copied to clipboard
New tkn not working with old pipeline release
Expected Behavior
tkn client with vendor 0.62, not working with 0.61 release
Actual Behavior
tkn client should work fine.
Steps to Reproduce the Problem
- Install Pipeline Release 0.61.x
- Create Task
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: echo-task
spec:
steps:
- image: mirror.gcr.io/ubuntu
script: echo hello
- Install tkn client 0.38.0
- Do
tkn task start echo-taskand you will error like
Error: admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "artifacts"
Additional Info
- Kubernetes version:
1.30
-
Tekton Pipeline version:
Output of
tkn versionorkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
0.61
Can we add new field in spec such that empty json does not get added.
CLI reported issue https://github.com/tektoncd/cli/issues/2388
cc @vdemeester
I think the fix might be to update: https://github.com/tektoncd/pipeline/blob/main/pkg/apis/pipeline/v1/taskrun_types.go#L300L303 and make it a pointer so that it can be set to nil(?)
Artifacts *Artifacts
This assumption is based on the fact that all other fields are either slices or pointers which I suppose can be set to nil.
I think what's happening is that tkn start is supplying a field called Artifacts as if a user set it but its a status field and only intended to be set by the Tekton controller, not the end user.
If this makes sense, I can provide a fix before making a release @vdemeester @piyush-garg
@chitrangpatel yes, that the thing. tkn doesn't do anything specific, but as it is Artifact and not *Artifact, default value go sets in an empty array, which will be marshall with artifacts that is… not recognized in old versions. So yeah, we need a fix that changes it to a pointer, and we'll have to backport it to 0.62 as well I think.
/assign @chitrangpatel