tektoncd / triggers

Event triggering with Tekton!
Apache License 2.0
552 stars 416 forks source link

Trigger interceptor updated the certificate on every restart #1638

Closed joaosilva15 closed 9 months ago

joaosilva15 commented 12 months ago

Expected Behavior

On startup the interceptor looks at the certificate and if the expiration is close, update it, if not leave it as it is.

Actual Behavior

On startup the interceptor checks for the certificate and, seems to me to always update it, and then proceeds to update the certificate on the cluster interceptors. During the time that it takes for the rest of the interceptors to start accepting the new certificate we get errors like

{"level":"error","ts":"2023-09-08T15:04:15.990Z","logger":"eventlistener","caller":"sink/sink.go:414","msg":"Post \"https://tekton-triggers-core-interceptors.tekton-pipelines.svc:8443/github\": x509: certificate signed by unknown authority (possibly because of \"x509: ECDSA verification failure\" while trying to verify candidate authority certificate \"tekton-triggers-core-interceptors.tekton-pipelines.svc\")","commit":"2ec8bc6-dirty","eventlistener":"listener","namespace":"namespace","/triggers-eventid":"b366a12c-c2ad-4b4b-bec1-8c4a0465e050","eventlistenerUID":"25b5ba7e-8b81-40c7-9582-43db48c0734a","/triggers-eventid":"b366a12c-c2ad-4b4b-bec1-8c4a0465e050","/trigger":"X","stacktrace":"github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger\n\tgithub.com/tektoncd/triggers/pkg/sink/sink.go:414\ngithub.com/tektoncd/triggers/pkg/sink.Sink.HandleEvent.func1\n\tgithub.com/tektoncd/triggers/pkg/sink/sink.go:202"}

This usually makes a few requests fail, and at times, I do not know why, this behaviour is prolonged by some time and we need to manually restart the interceptor pods.

Steps to Reproduce the Problem

  1. Start doing requests to an event listener that uses a cluster interceptor
  2. Kill one interceptor pod
  3. Some calls from the event listener will fail

Additional Info

Client version: 0.31.2 Pipeline version: v0.50.1 Triggers version: v0.24.1 Dashboard version: v0.38.0