Define a global for `reconciler.DefaultTimeout`. (#2597)

Serving currently uses a fixed constant for the context timeout on reconciliation, which is causing some bad interactions with certain policy webhooks.

Based on feedback on https://github.com/knative/serving/pull/13323 I am hoisting this into a shared variable, so that folks can turn it into a flag, so it is configurable.
This commit is contained in:
Matt Moore 2022-09-20 19:44:09 -07:00 committed by GitHub
parent df29e2a20a
commit d1d5c84907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -30,6 +30,11 @@ import (
const failedGenerationBump = "NewObservedGenFailure"
// DefaultTimeout is used in some downstream reconcilers to put a context
// deadline on reconciliation. It is a variable so that it can be exposed by
// entrypoints as a flag, e.g. via flag.DurationVar
var DefaultTimeout = 30 * time.Second
const (
// DoReconcileKind is the function name for reconciling the resource (as a leader).
DoReconcileKind = "ReconcileKind"