Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tkn not working with old pipeline release #8225

Closed
piyush-garg opened this issue Aug 28, 2024 · 5 comments · Fixed by #8226
Closed

New tkn not working with old pipeline release #8225

piyush-garg opened this issue Aug 28, 2024 · 5 comments · Fixed by #8226
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@piyush-garg
Copy link
Contributor

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

  1. Install Pipeline Release 0.61.x
  2. Create Task
apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: echo-task
spec:
  steps:
  - image: mirror.gcr.io/ubuntu
    script: echo hello
  1. Install tkn client 0.38.0
  2. Do tkn task start echo-task and 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 version or kubectl 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 tektoncd/cli#2388

cc @vdemeester

@piyush-garg piyush-garg added the kind/bug Categorizes issue or PR as related to a bug. label Aug 28, 2024
@chitrangpatel
Copy link
Contributor

chitrangpatel commented Aug 28, 2024

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.

@chitrangpatel
Copy link
Contributor

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.

@chitrangpatel
Copy link
Contributor

If this makes sense, I can provide a fix before making a release @vdemeester @piyush-garg

@vdemeester
Copy link
Member

@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.

@piyush-garg
Copy link
Contributor Author

/assign @chitrangpatel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants