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

✨ feat: add webhook CertWatcher and flags for custom certificate configuration #4429

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

camilamacedo86
Copy link
Member

  • Introduced CertWatcher for webhook server to dynamically reload certificates.
  • Added CLI flags (--webhook-cert-path, --webhook-cert-name, --webhook-cert-key) to allow users to provide custom certificate paths.
  • Updated manager to integrate CertWatcher into webhook TLS options.
  • Ensured backward compatibility with default self-signed certificates if no custom certs are provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 14, 2024
…uration

- Introduced CertWatcher for webhook server to dynamically reload certificates.
- Added CLI flags (--webhook-cert-path, --webhook-cert-name, --webhook-cert-key) to allow users to provide custom certificate paths.
- Updated manager to integrate CertWatcher into webhook TLS options.
- Ensured backward compatibility with default self-signed certificates if no custom certs are provided.
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

Just one nit, rest looks good!
Thanks @camilamacedo86!
/lgtm

var webhookCertWatcher *certwatcher.CertWatcher

// Initial webhook TLS options
webhookTLSOpts := append([]func(*tls.Config){}, tlsOpts...)
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
webhookTLSOpts := append([]func(*tls.Config){}, tlsOpts...)
webhookTLSOpts := tlsOpts

as the slice is already initialised in line 84, and we should be able to append to it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done that here: https://github.com/kubernetes-sigs/kubebuilder/pull/4400/files
Where we put all together and shape things

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, varshaprasad96

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [camilamacedo86,varshaprasad96]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 15, 2024
@k8s-ci-robot k8s-ci-robot merged commit e0b86dc into kubernetes-sigs:master Dec 15, 2024
25 checks passed
@camilamacedo86 camilamacedo86 deleted the webhook-watcher branch December 16, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants