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

Tekton Triggers, v1beta1 API & EventListeners #4243

Closed
faust64 opened this issue Jul 1, 2022 · 4 comments · Fixed by #4382
Closed

Tekton Triggers, v1beta1 API & EventListeners #4243

faust64 opened this issue Jul 1, 2022 · 4 comments · Fixed by #4382
Assignees
Labels
component/extensions Deals with the extensions dependencies Pull requests that update a dependency file
Milestone

Comments

@faust64
Copy link

faust64 commented Jul 1, 2022

Describe the bug

As of last upgrading my clusters and Tekton operator, I'm now stuck with a broken controller.
Involves: tekton-pipelines 0.33.0, tekton-triggers 0.19.0 (and kubernetes 1.23.5)

We use fabric8 in a controller that watches for existing EventListeners. It relies on some v1alpha1 API version. While this was still valid in previous versions, this is no longer the case today: EventListeners CRD removed v1alpha1 and only has v1beta1.

I tried upgrading my tekton-client dependency, from 5.12.1 to 5.12.2, then 6.0.0-RC1. Either way, I'm told that package io.fabric8.tekton.triggers.v1beta1 does not exist

Am I doing it wrong?
Going through this repository, I found a couple files in https://github.com/fabric8io/kubernetes-client/tree/master/extensions/tekton/client/src/main/java/io/fabric8/tekton/client (V1alpha1APIGroupClient.java & V1beta1APIGroupClient.java), as well as some tests, https://github.com/fabric8io/kubernetes-client/tree/master/extensions/tekton/tests/src/test/java/io/fabric8/tekton/triggers
As far as I understand, there is no support yet for v1beta1.EventListeners today, am I right?

If so, would it be possible to fix this?

Fabric8 Kubernetes Client version

6.0.0-RC1

Steps to reproduce

Using some existing code, such as https://github.com/fabric8io/kubernetes-client/blob/master/extensions/tekton/tests/src/test/java/io/fabric8/tekton/triggers/v1alpha1/EventListenerTest.java

replace mentions from v1alpha1.EventListener with v1beta1.EventListener.
Build

Expected behavior

code builds
controller actually uses v1beta1 API dealing with EventListeners

Runtime

OpenShift

Kubernetes API Server version

other (please specify in additional context)

Environment

Linux

Fabric8 Kubernetes Client Logs

-- doesn't build

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /tmp/src/openshift-admission-controller/src/main/java/com/xxx/yyy/k8s/TektonAdmissionController.java:[10,42] package io.fabric8.tekton.triggers.v1beta1 does not exist
[ERROR] /tmp/src/openshift-admission-controller/src/main/java/com/xxx/yyy/k8s/TektonAdmissionController.java:[83,39] cannot find symbol
  symbol:   method eventListeners()
  location: interface io.fabric8.tekton.client.dsl.V1beta1APIGroupDSL
[ERROR] /tmp/src/openshift-admission-controller/src/main/java/com/xxx/yyy/k8s/TektonAdmissionController.java:[111,14] cannot find symbol
  symbol:   class EventListener
  location: class com.xxx.yyy.k8s.TektonAdmissionController
[ERROR] /tmp/src/openshift-admission-controller/src/main/java/com/xxx/yyy/k8s/TektonAdmissionController.java:[111,68] cannot find symbol
  symbol:   method eventListeners()
  location: interface io.fabric8.tekton.client.dsl.V1beta1APIGroupDSL
[ERROR] /tmp/src/openshift-admission-controller/src/main/java/com/xxx/yyy/k8s/TektonAdmissionController.java:[112,14] cannot find symbol
  symbol:   class EventListener
  location: class com.xxx.yyy.k8s.TektonAdmissionController
[INFO] 5 errors

Additional context

No response

@shawkins
Copy link
Contributor

shawkins commented Jul 1, 2022

Am I doing it wrong?

No, this is simply missing. The tekton-model-triggers generates only the v1alpha1 model. I'm not sure why a corresponding tekton-model-triggers-v1beta1 was not added when the base v1beta1 tekton model was added.

It should be straight-forward to clone / modify what is there for v1alpha1 support to provide the beta1 support. Or you could try the java generator on the tekton crds and see if you are good with switching to what it generates.

cc @andreaTP

@rohanKanojia
Copy link
Member

I guess our tekton model has gone a bit outdated (since tekton world has been moving so fast). Since we're providing explicit extension, we should add v1beta1 model as well. As Steven suggested it shouldn't be that hard, we're willing to provide code pointers if you're interested in fixing this.

@andreaTP
Copy link
Member

andreaTP commented Jul 1, 2022

Since this extension is outdated and we are going to release version 6.0, would it be worth exploring substituting the extension with the java-gen output?

@faust64 using the Java generator should be a viable option for you at the moment. I encourage you to try it out and give some feedback around it 🙁

@faust64
Copy link
Author

faust64 commented Jul 3, 2022

I'll let my colleagues know about that Java generator option.
We're still looking to fix this, a coworker took over as I have no experience with Java myself. So far, he commented out the bits where we interact with EventListeners. We'll give it another shot. Thanks for following up!

@manusa manusa added the component/extensions Deals with the extensions label Jul 19, 2022
@manusa manusa added this to the 6.1.0 milestone Jul 19, 2022
@manusa manusa added the dependencies Pull requests that update a dependency file label Jul 20, 2022
@manusa manusa modified the milestones: 6.1.0, 6.2.0 Aug 31, 2022
@rohanKanojia rohanKanojia self-assigned this Sep 2, 2022
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 2, 2022
)

+ Update tekton pipelines model to v0.39.0
+ Update tekton triggers model to v0.20.2
+ Split tekton triggers model into tekton-model-triggers-v1alpha1 and
  tekton-model-triggers-v1beta1

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 2, 2022
)

+ Update tekton pipelines model to v0.39.0
+ Update tekton triggers model to v0.20.2
+ Split tekton triggers model into tekton-model-triggers-v1alpha1 and
  tekton-model-triggers-v1beta1

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 2, 2022
)

+ Update tekton pipelines model to v0.39.0
+ Update tekton triggers model to v0.20.2
+ Split tekton triggers model into tekton-model-triggers-v1alpha1 and
  tekton-model-triggers-v1beta1

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 2, 2022
)

+ Update tekton pipelines model to v0.39.0
+ Update tekton triggers model to v0.20.2
+ Split tekton triggers model into tekton-model-triggers-v1alpha1 and
  tekton-model-triggers-v1beta1

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Sep 7, 2022
+ Update tekton pipelines model to v0.39.0
+ Update tekton triggers model to v0.20.2
+ Split tekton triggers model into tekton-model-triggers-v1alpha1 and
  tekton-model-triggers-v1beta1

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 7, 2022
…hanges (fabric8io#4243)

Follow up for fabric8io#4382 to add changelog and note about breaking change.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Sep 7, 2022
…hanges (#4243)

Follow up for #4382 to add changelog and note about breaking change.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/extensions Deals with the extensions dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants