Skip to content

Commit

Permalink
feat: add setting for address and port for webhooks (#631)
Browse files Browse the repository at this point in the history
Signed-off-by: Evsyukov Denis <[email protected]>
  • Loading branch information
juev authored Jul 18, 2024
1 parent 79b188e commit 078e0f1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/app/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ func DefineValidatingWebhookFlags(cmd *kingpin.CmdClause) {
Default("Fail").
Envar("VALIDATING_WEBHOOK_FAILURE_POLICY").
EnumVar(&ValidatingWebhookSettings.DefaultFailurePolicy, "Fail", "Ignore")
cmd.Flag("validating-webhook-listen-port",
"Defines default ListenPort for ValidatingWebhookConfiguration. "+
"Can be set with $VALIDATING_WEBHOOK_LISTEN_PORT.").
Default(ValidatingWebhookSettings.ListenPort).
Envar("VALIDATING_WEBHOOK_LISTEN_PORT").
StringVar(&ValidatingWebhookSettings.ListenPort)
cmd.Flag("validating-webhook-listen-address",
"Defines default ListenAddr for ValidatingWebhookConfiguration. "+
"Can be set with $VALIDATING_WEBHOOK_LISTEN_ADDRESS.").
Default(ValidatingWebhookSettings.ListenAddr).
Envar("VALIDATING_WEBHOOK_LISTEN_ADDRESS").
StringVar(&ValidatingWebhookSettings.ListenAddr)
}

// DefineConversionWebhookFlags defines flags for ConversionWebhook server.
Expand All @@ -86,4 +98,17 @@ func DefineConversionWebhookFlags(cmd *kingpin.CmdClause) {
cmd.Flag("conversion-webhook-client-ca", "A path to a server certificate for CRD.spec.conversion.webhook. Can be set with $CONVERSION_WEBHOOK_CLIENT_CA.").
Envar("CONVERSION_WEBHOOK_CLIENT_CA").
StringsVar(&ConversionWebhookSettings.ClientCAPaths)
cmd.Flag("conversion-webhook-listen-port",
"Defines default ListenPort for ConversionWebhookConfiguration. "+
"Can be set with $CONVERSION_WEBHOOK_LISTEN_PORT.").
Envar("CONVERSION_WEBHOOK_LISTEN_PORT").
Default(ConversionWebhookSettings.ListenPort).
StringVar(&ConversionWebhookSettings.ListenPort)
cmd.Flag("conversion-webhook-listen-address",
"Defines default ListenAddr for ConversionWebhookConfiguration. "+
"Can be set with $CONVERSION_WEBHOOK_LISTEN_ADDRESS.").
Default(ConversionWebhookSettings.ListenAddr).
Envar("CONVERSION_WEBHOOK_LISTEN_ADDRESS").
StringVar(&ConversionWebhookSettings.ListenAddr)

}

0 comments on commit 078e0f1

Please sign in to comment.