tektoncd / triggers

Event triggering with Tekton!
Apache License 2.0
557 stars 419 forks source link

Cannot delete EventListener with servicePort configured #1561

Open m1n-q opened 1 year ago

m1n-q commented 1 year ago

Expected Behavior

Deletion should be performed normally.

Actual Behavior

Got an error:

Error from server (BadRequest): error when deleting "eventlistener-serviceconfig.yaml": admission webhook "validation.webhook.triggers.tekton.dev" denied the request: decoding request failed: cannot decode incoming old object: json: unknown field "servicePort"

Steps to Reproduce the Problem

  1. create EventListener resource with spec.resources.kubernetesResource.servicePort configured
  2. delete EventListener

Additional Info

Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.2", GitCommit:"fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b", GitTreeState:"clean", BuildDate:"2023-02-22T13:32:21Z", GoVersion:"go1.20.1", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.2", GitCommit:"fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b", GitTreeState:"clean", BuildDate:"2023-02-22T13:32:22Z", GoVersion:"go1.19.6", Compiler:"gc", Platform:"linux/amd64"}

It only works properly after the servicePort has been deleted with kubectl edit.

khrm commented 1 year ago

What's the triggers version, @m1n-q ?

m1n-q commented 1 year ago

@khrm

$ tkn version
Client version: 0.29.1
Pipeline version: v0.45.0
Triggers version: v0.23.0
tekton-robot commented 1 year ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

khrm commented 1 year ago

/remove-lifecycle stale

khrm commented 1 year ago

/lifecycle frozen

This needs to be fixed. Hopefully in the next release.

khrm commented 1 year ago

I am not able to recreate his issue. Does it exist in v0.24.0?

khrm commented 1 year ago

@m1n-q Can you check whether it exists now or not?

khrm commented 1 year ago

/remove lifecycle frozen

jsalatiel commented 2 months ago

Same problem

Client version: 0.38.0
Pipeline version: v0.62.0
Triggers version: v0.29.0

Cant create a eventListener with

  resources:
    kubernetesResource:
      serviceType: NodePort
      servicePort: '30147'

will get Error from server (BadRequest): error when replacing "eventListener.yml": admission webhook "webhook.triggers.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "servicePort"