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

How can I use "withPipelineResourceBinding()" to define taskRun resources? #1987

Closed
jwkim1993 opened this issue Feb 5, 2020 · 6 comments · Fixed by #2103
Closed

How can I use "withPipelineResourceBinding()" to define taskRun resources? #1987

jwkim1993 opened this issue Feb 5, 2020 · 6 comments · Fixed by #2103
Labels

Comments

@jwkim1993
Copy link

Issue description
I recently use tekton-client extension to make taskRun with Java.

I tried to define new input resources, and I found withPipelineResourceBinding() function in ".withNewSpec().withNewInputs().addNewResource()".

There are "withName(), withNewResourceSpec()" functions in the above funtion, so that I thought this is to define resources.

However, when I use the function, a runtime error occurs.

Message addmission webhook "webhook.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "pipelineResourceBinding".

How could I use this function properly?

Or, if that function is not for resource definition, what is the right function?

Thanks for replying.

@majian159
Copy link

+1

@manusa manusa added the question label Apr 1, 2020
@rohanKanojia
Copy link
Member

@majian159 @jwkim1993 : Hi, we've updated our tekton client to v0.11.0-rc2 . Could you please check on the latest master if this is still an issue?

@rohanKanojia
Copy link
Member

@majian159 @jwkim1993 : I haven't tried this myself on a tekton setup, but I think you should be able to create a TaskRun like this(I found one TaskRun object in tekton docs:

      TaskRun taskRun = new TaskRunBuilder()
        .withNewMetadata().withName("read-repo-run").endMetadata()
        .withNewSpec()
        .withNewResources()
        .withInputs(new TaskResourceBindingBuilder()
          .withName("read-task")
          .withResourceRef(new PipelineResourceRefBuilder().withName("go-example-git").build())
          .build())
        .endResources()
        .endSpec()
        .build();
      client.taskRuns().inNamespace("default").create(taskRun);

Am I understanding your question correctly? Could you please share some code sample to elaborate your question a bit ?

@majian159
Copy link

TaskResourceBindingBuilder miss withName and withResourceRef.
image

only PipelineResourceBinding.
i can't find the definition of PipelineResourceBinding in tekton.
@rohanKanojia

@rohanKanojia
Copy link
Member

@majian159 : Which version are you trying it on? Actually tekton upgrade hasn't been released yet. Would it be possible for you to build project and test SNAPSHOT version?

@rohanKanojia
Copy link
Member

@majian159 : On SNAPSHOT version, I'm able to see these
Screenshot from 2020-04-02 16-06-42

Maybe I should add some example for this

rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Apr 2, 2020
…updated model

+ Added TaskRunCreate and TaskCreate example
+ Updated Tekton model to v0.11.0
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Apr 3, 2020
…updated model

+ Added TaskRunCreate and TaskCreate example
+ Updated Tekton model to v0.11.0
vasu19126 pushed a commit to vasu19126/kubernetes-client that referenced this issue Apr 15, 2020
…updated model

+ Added TaskRunCreate and TaskCreate example
+ Updated Tekton model to v0.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants