Skip to content

Commit

Permalink
🌱 main.go: add flags for webhook cert-name and -key (#3215)
Browse files Browse the repository at this point in the history
* main.go: add flags for webhook cert-name and -key

* main.go set real default webhook port
  • Loading branch information
chrischdi authored Oct 8, 2024
1 parent af2a123 commit a2bac7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 9 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ var (
defaultSyncPeriod = manager.DefaultSyncPeriod
defaultLeaderElectionID = manager.DefaultLeaderElectionID
defaultPodName = manager.DefaultPodName
defaultWebhookPort = manager.DefaultWebhookServiceContainerPort
)

// InitFlags initializes the flags.
Expand Down Expand Up @@ -199,11 +198,17 @@ func InitFlags(fs *pflag.FlagSet) {
fs.IntVar(&clusterCacheTrackerClientBurst, "clustercachetracker-client-burst", 30,
"Maximum number of queries that should be allowed in one burst from the cluster cache tracker clients to the Kubernetes API server of workload clusters.")

fs.IntVar(&webhookOpts.Port, "webhook-port", defaultWebhookPort,
"Webhook Server port")
fs.IntVar(&webhookOpts.Port, "webhook-port", 9443,
"Webhook Server port.")

fs.StringVar(&webhookOpts.CertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/",
"Webhook cert dir, only used when webhook-port is specified.")
"Webhook cert dir.")

fs.StringVar(&webhookOpts.CertName, "webhook-cert-name", "tls.crt",
"Webhook cert name.")

fs.StringVar(&webhookOpts.KeyName, "webhook-key-name", "tls.key",
"Webhook key name.")

fs.StringVar(&managerOpts.HealthProbeBindAddress, "health-addr", ":9440",
"The address the health endpoint binds to.",
Expand Down
4 changes: 0 additions & 4 deletions pkg/manager/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import "time"
const (
defaultPrefix = "capv-"

// DefaultWebhookServiceContainerPort is the default value for the eponymous
// manager option.
DefaultWebhookServiceContainerPort = 0

// DefaultSyncPeriod is the default value for the eponymous
// manager option.
DefaultSyncPeriod = time.Minute * 10
Expand Down

0 comments on commit a2bac7b

Please sign in to comment.