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

✨ Add webhook-cert-dir flag #4151

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

vincepri
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:
Adds the --webhook-cert-dir flag to customize where the certificates are stored, and passes it to the controller-runtime webhook handler.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 17, 2023
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 17, 2023
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b4221b5) 57.83% compared to head (b48d686) 57.87%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4151      +/-   ##
==========================================
+ Coverage   57.83%   57.87%   +0.03%     
==========================================
  Files         187      187              
  Lines       19197    19212      +15     
==========================================
+ Hits        11103    11118      +15     
  Misses       7466     7466              
  Partials      628      628              

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

main.go Outdated
@@ -224,6 +225,9 @@ func InitFlags(fs *pflag.FlagSet) {
"Webhook Server port, disabled by default. When enabled, the manager will only work as webhook server, no reconcilers are installed.",
)

fs.StringVar(&webhookCertDir, "webhook-cert-dir", "",
Copy link
Contributor

Choose a reason for hiding this comment

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

In CAPI, this flag has a default value. Does CAPZ need to do the same here?

https://github.com/kubernetes-sigs/cluster-api/blob/ef2a1df06e00934d82c3140445e9634201f7a9a1/main.go#L212-L213

"only used when webhook-port is specified."

Does this mean the value is ignored unless --webhook-port was overridden? The code just passes both values through regardless.

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied the flag, but dropped the default because I noticed it was already set in the Deployment yaml; can add it back if we prefer.

The comment is a bit confusing, I agree.

Copy link
Contributor

Choose a reason for hiding this comment

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

it was already set in the Deployment yaml;

Ah, I missed that. Thanks for updating, I think this is more clear.

Adds the --webhook-cert-dir flag to customize where the certificates are
stored, and passes it to the controller-runtime webhook handler.

Signed-off-by: Vince Prignano <[email protected]>
Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 18, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6b7833142ef9437947c8d93c849f40aed9f1c95d

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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:

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit 2d51882 into kubernetes-sigs:main Oct 19, 2023
10 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Oct 19, 2023
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants