1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00
Signed-off-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
shuting 2022-01-17 21:00:39 +08:00 committed by GitHub
parent 1af9e48b0d
commit de6c6f2199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,7 @@ var (
imageSignatureRepository string imageSignatureRepository string
clientRateLimitQPS float64 clientRateLimitQPS float64
clientRateLimitBurst int clientRateLimitBurst int
webhookRegistrationTimeout time.Duration
setupLog = log.Log.WithName("setup") setupLog = log.Log.WithName("setup")
) )
@ -102,6 +103,7 @@ func main() {
flag.Float64Var(&clientRateLimitQPS, "clientRateLimitQPS", 0, "Configure the maximum QPS to the master from Kyverno. Uses the client default if zero.") flag.Float64Var(&clientRateLimitQPS, "clientRateLimitQPS", 0, "Configure the maximum QPS to the master from Kyverno. Uses the client default if zero.")
flag.IntVar(&clientRateLimitBurst, "clientRateLimitBurst", 0, "Configure the maximum burst for throttle. Uses the client default if zero.") flag.IntVar(&clientRateLimitBurst, "clientRateLimitBurst", 0, "Configure the maximum burst for throttle. Uses the client default if zero.")
flag.DurationVar(&webhookRegistrationTimeout, "webhookRegistrationTimeout", 120*time.Second, "Timeout for webhook registration, e.g., 30s, 1m, 5m.")
if err := flag.Set("v", "2"); err != nil { if err := flag.Set("v", "2"); err != nil {
setupLog.Error(err, "failed to set log level") setupLog.Error(err, "failed to set log level")
os.Exit(1) os.Exit(1)
@ -392,7 +394,7 @@ func main() {
os.Exit(1) os.Exit(1)
} }
registerWrapperRetry := common.RetryFunc(time.Second, 30*time.Second, webhookCfg.Register, setupLog) registerWrapperRetry := common.RetryFunc(time.Second, webhookRegistrationTimeout, webhookCfg.Register, setupLog)
registerWebhookConfigurations := func() { registerWebhookConfigurations := func() {
certManager.InitTLSPemPair() certManager.InitTLSPemPair()