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

Optimize webhook.Server start procedure when tls.Config.GetCertificate is configured via Server.TLSOpts #2269

Closed
itomsawyer opened this issue Apr 10, 2023 · 1 comment · Fixed by #2291

Comments

@itomsawyer
Copy link

It's related to the issue #1936 .
If Server.TLSOpts is set to change the tls.Config.GetCertificate , webhook.Server.CertDir seems to be redundant.

For now , no matter if we config webhook.Server.CertDir or not , webhook.Server.Start will always try to create a certwatcher which load tls certificates from disk files. It's convenient for most users to setup a WebhookServer with certificates are able to be auto rotated. But for some user explicitly override the configuration of tls.Config.GetCertificate , it can be confused.

It's not uncommon for users that set tls.Config.GetCertificate is intend to replace the certwatcher with other implements of managing certificates rotation. (For example , Integration with spire) . The problem is that the certwatcher cannot be replaced in the first start of webhook.Server

certWatcher, err := certwatcher.New(certPath, keyPath)

That is to say, user with tls.Config.GetCertificate given will still prepare a paire of tls certificate files to make the webhook.Server start successfully.

I'm prefer to make a pr to change the start procedure of webhook.Server to make certwatcher a must only when the user is not use his/her custom implement.

Thx , any suggestions is welcomed.

@itomsawyer
Copy link
Author

@vincepri Good job.

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 a pull request may close this issue.

1 participant