Skip to content

Commit a2bac7b

Browse files
authored
🌱 main.go: add flags for webhook cert-name and -key (#3215)
* main.go: add flags for webhook cert-name and -key * main.go set real default webhook port
1 parent af2a123 commit a2bac7b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

‎main.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ var (
9696
defaultSyncPeriod = manager.DefaultSyncPeriod
9797
defaultLeaderElectionID = manager.DefaultLeaderElectionID
9898
defaultPodName = manager.DefaultPodName
99-
defaultWebhookPort = manager.DefaultWebhookServiceContainerPort
10099
)
101100

102101
// InitFlags initializes the flags.
@@ -199,11 +198,17 @@ func InitFlags(fs *pflag.FlagSet) {
199198
fs.IntVar(&clusterCacheTrackerClientBurst, "clustercachetracker-client-burst", 30,
200199
"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.")
201200

202-
fs.IntVar(&webhookOpts.Port, "webhook-port", defaultWebhookPort,
203-
"Webhook Server port")
201+
fs.IntVar(&webhookOpts.Port, "webhook-port", 9443,
202+
"Webhook Server port.")
204203

205204
fs.StringVar(&webhookOpts.CertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/",
206-
"Webhook cert dir, only used when webhook-port is specified.")
205+
"Webhook cert dir.")
206+
207+
fs.StringVar(&webhookOpts.CertName, "webhook-cert-name", "tls.crt",
208+
"Webhook cert name.")
209+
210+
fs.StringVar(&webhookOpts.KeyName, "webhook-key-name", "tls.key",
211+
"Webhook key name.")
207212

208213
fs.StringVar(&managerOpts.HealthProbeBindAddress, "health-addr", ":9440",
209214
"The address the health endpoint binds to.",

‎pkg/manager/constants.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ import "time"
2222
const (
2323
defaultPrefix = "capv-"
2424

25-
// DefaultWebhookServiceContainerPort is the default value for the eponymous
26-
// manager option.
27-
DefaultWebhookServiceContainerPort = 0
28-
2925
// DefaultSyncPeriod is the default value for the eponymous
3026
// manager option.
3127
DefaultSyncPeriod = time.Minute * 10

0 commit comments

Comments
 (0)