@@ -209,17 +209,24 @@ type Options struct {
209
209
LivenessEndpointName string
210
210
211
211
// Port is the port that the webhook server serves at.
212
- // It is used to set webhook.Server.Port.
212
+ // It is used to set webhook.Server.Port if WebhookServer is not set .
213
213
Port int
214
214
// Host is the hostname that the webhook server binds to.
215
- // It is used to set webhook.Server.Host.
215
+ // It is used to set webhook.Server.Host if WebhookServer is not set .
216
216
Host string
217
217
218
218
// CertDir is the directory that contains the server key and certificate.
219
- // if not set, webhook server would look up the server key and certificate in
219
+ // If not set, webhook server would look up the server key and certificate in
220
220
// {TempDir}/k8s-webhook-server/serving-certs. The server key and certificate
221
221
// must be named tls.key and tls.crt, respectively.
222
+ // It is used to set webhook.Server.CertDir if WebhookServer is not set.
222
223
CertDir string
224
+
225
+ // WebhookServer is an externally configured webhook.Server. By default,
226
+ // a Manager will create a default server using Port, Host, and CertDir;
227
+ // if this is set, the Manager will use this server instead.
228
+ WebhookServer * webhook.Server
229
+
223
230
// Functions to all for a user to customize the values that will be injected.
224
231
225
232
// NewCache is the function that will create the cache to be used
@@ -370,6 +377,7 @@ func New(config *rest.Config, options Options) (Manager, error) {
370
377
port : options .Port ,
371
378
host : options .Host ,
372
379
certDir : options .CertDir ,
380
+ webhookServer : options .WebhookServer ,
373
381
leaseDuration : * options .LeaseDuration ,
374
382
renewDeadline : * options .RenewDeadline ,
375
383
retryPeriod : * options .RetryPeriod ,
0 commit comments