Skip to content

fix: unify webhook listeners on path based endpoints - #304

Open
pepordev wants to merge 6 commits into
external-secrets:mainfrom
pepordev:fix/unify-webhook-listeners
Open

fix: unify webhook listeners on path based endpoints#304
pepordev wants to merge 6 commits into
external-secrets:mainfrom
pepordev:fix/unify-webhook-listeners

Conversation

@pepordev

@pepordev pepordev commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

fixes #242

I've test it out in our environments with multiples configurations using our keeper-security integration and it is working fine

Signed-off-by: Pedro Parra Ortega <parraortega.pedro@gmail.com>
Signed-off-by: Pedro Parra Ortega <parraortega.pedro@gmail.com>
@Skarlso
Skarlso self-requested a review April 16, 2026 07:20

@Skarlso Skarlso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial round done. I know this is mostly borrowed code. I tried to flag only criticals. Let's leave it off a bit better than we found it. :)

Comment thread internal/listener/manager.go Outdated
Comment thread internal/listener/webhook/server.go Outdated
Comment thread internal/listener/webhook/route.go
Comment thread internal/listener/webhook/route.go Outdated
Comment thread internal/listener/webhook/route.go Outdated
Comment thread api/v1alpha1/source_webhook_types.go
Comment thread internal/listener/webhook/route.go Outdated
Comment thread internal/listener/webhook/server.go
Comment thread internal/controller/reloader_controller.go Outdated
Comment thread docs/sources/webhook.md Outdated
pepordev added 3 commits June 22, 2026 07:40
Signed-off-by: Pedro <parraortega.pedro@gmail.com>
Signed-off-by: Pedro Parra Ortega <parraortega.pedro@gmail.com>
Signed-off-by: Pedro Parra Ortega <parraortega.pedro@gmail.com>
@Skarlso

Skarlso commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I'll fix the cve thing.

@Skarlso

Skarlso commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Done :) Should be on main.

@pepordev

Copy link
Copy Markdown
Contributor Author

Done :) Should be on main.

updated! thanks!

@Skarlso

Skarlso commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

will take a look at this today afternoon! Thanks

@Skarlso Skarlso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of more issues, but it's getting there! :) Nice! :)

Comment thread internal/listener/manager.go
message.retryAt = getNextRetryAt(r.config.RetryPolicy.Algorithm, message.currentRun)
}
select {
case r.retryQueue <- message:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are self-sending here... This will deadlock 🤔 Your only receiver is the same go routine. I'm wondering how this even works in any tests. 🤔 This should effectively die after like... the first retry.

}

// NewWebhookServer constructs a server; call Start to listen.
func NewWebhookServer(addr string, logger logr.Logger) *WebhookServer {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to implement the Leader election function otherwise only the leader can run this. 🤔

Comment on lines +70 to +72
# When true, /metrics is served over HTTPS (and requires Kubernetes auth for scrapers).
# When false, /metrics is plain HTTP — matches default Prometheus ServiceMonitor scraping.
secure: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Can't have false as default. Sorry.

@Skarlso

Skarlso commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@pepordev With the config thing out of the way, the rest looks okay expect for the default thing in my last comment.

@Skarlso

Skarlso commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

And the otherone with the deadlock. :_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

webhook source in configurations create new servers per config

2 participants