From d33071147b2e1bc7e696015d2f1f6be5bf47b0f9 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 2 Jun 2022 10:13:25 +0200 Subject: [PATCH 1/3] Bump knative/pkg to release-1.5 This also updates it in `./hack/update-deps.sh` to be inline with what we fetch (before this PR, the VERSION there is not the one we depend on / vendor). Signed-off-by: Vincent Demeester --- go.mod | 2 +- go.sum | 4 +- hack/update-deps.sh | 2 +- vendor/knative.dev/pkg/apis/deprecated.go | 9 +- vendor/knative.dev/pkg/apis/field_error.go | 95 ++++++++++++++++++- .../pkg/injection/sharedmain/main.go | 19 +++- .../knative.dev/pkg/leaderelection/config.go | 19 ++++ .../knative.dev/pkg/leaderelection/context.go | 2 +- vendor/knative.dev/pkg/logging/config.go | 17 ++++ vendor/knative.dev/pkg/network/h2c.go | 13 +++ vendor/knative.dev/pkg/network/transports.go | 52 +++++++++- vendor/knative.dev/pkg/version/version.go | 2 +- .../validation/validation_admit.go | 44 ++++++--- vendor/modules.txt | 2 +- 14 files changed, 249 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 439982a7e27..1a01092a386 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( k8s.io/code-generator v0.23.5 k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf - knative.dev/pkg v0.0.0-20220329144915-0a1ec2e0d46c + knative.dev/pkg v0.0.0-20220524202603-19adf798efb8 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 26246a33199..b8d8048d1c1 100644 --- a/go.sum +++ b/go.sum @@ -2212,8 +2212,10 @@ k8s.io/utils v0.0.0-20220127004650-9b3446523e65/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= knative.dev/hack v0.0.0-20220328133751-f06773764ce3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/pkg v0.0.0-20220329144915-0a1ec2e0d46c h1:PLzCwnuPt+bjwiyYrRrsbmiBWR8a5cIwKtTd3LK1TqU= +knative.dev/hack v0.0.0-20220524153203-12d3e2a7addc/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/pkg v0.0.0-20220329144915-0a1ec2e0d46c/go.mod h1:0A5D5tOLettuVoi5x+0SLGRfrvVemXXtLH247WupPJk= +knative.dev/pkg v0.0.0-20220524202603-19adf798efb8 h1:7vZxPKJsJ4LkJTLiTy48nfykzfDi69OS4GKRs0qeSM4= +knative.dev/pkg v0.0.0-20220524202603-19adf798efb8/go.mod h1:pApypeWDkGrsMkUDkV6StWXS4CXhwGWuJEID9GGZY0Y= mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= diff --git a/hack/update-deps.sh b/hack/update-deps.sh index c9c901cfaa5..ccf01837bfb 100755 --- a/hack/update-deps.sh +++ b/hack/update-deps.sh @@ -22,7 +22,7 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri cd ${REPO_ROOT_DIR} -VERSION="release-0.23" +VERSION="release-1.5" # The list of dependencies that we track at HEAD and periodically # float forward in this repository. diff --git a/vendor/knative.dev/pkg/apis/deprecated.go b/vendor/knative.dev/pkg/apis/deprecated.go index fb73306faae..8f07e71b31b 100644 --- a/vendor/knative.dev/pkg/apis/deprecated.go +++ b/vendor/knative.dev/pkg/apis/deprecated.go @@ -36,12 +36,15 @@ func CheckDeprecated(ctx context.Context, obj interface{}) *FieldError { // CheckDeprecatedUpdate checks whether the provided named deprecated fields // are set in a context where deprecation is disallowed. // This is a json shallow check. We will recursively check inlined structs. -func CheckDeprecatedUpdate(ctx context.Context, obj, original interface{}) *FieldError { +func CheckDeprecatedUpdate(ctx context.Context, obj, original interface{}) (errs *FieldError) { if IsDeprecatedAllowed(ctx) { + // TODO: We should still run through the validation here, but do + // something like: + // defer func() { + // errs = errs.At(WarningLevel) + // }() return nil } - - var errs *FieldError objFields, objInlined := getPrefixedNamedFieldValues(deprecatedPrefix, obj) if nonZero(reflect.ValueOf(original)) { diff --git a/vendor/knative.dev/pkg/apis/field_error.go b/vendor/knative.dev/pkg/apis/field_error.go index 5ea51c0e473..ddd4838af21 100644 --- a/vendor/knative.dev/pkg/apis/field_error.go +++ b/vendor/knative.dev/pkg/apis/field_error.go @@ -28,18 +28,54 @@ import ( // a problem with the current field itself. const CurrentField = "" +// DiagnosticLevel is used to signal the severity of a particular diagnostic +// in the form of a FieldError. +type DiagnosticLevel int + +const ( + // ErrorLevel is used to signify fatal/blocking diagnostics, e.g. those + // that should block admission in a validating admission webhook. + ErrorLevel DiagnosticLevel = iota + + // WarningLevel is used to signify information/non-blocking diagnostics, + // e.g. those that should be surfaced as warnings in a validating admission + // webhook. + WarningLevel +) + +func (dl DiagnosticLevel) String() string { + switch dl { + case ErrorLevel: + return "Error" + case WarningLevel: + return "Warning" + + default: + return fmt.Sprintf("", dl) + } +} + // FieldError is used to propagate the context of errors pertaining to // specific fields in a manner suitable for use in a recursive walk, so // that errors contain the appropriate field context. // FieldError methods are non-mutating. // +k8s:deepcopy-gen=true type FieldError struct { + // Message holds the main diagnostic message carried by this FieldError Message string - Paths []string + + // Paths holds a list of paths to which this diagnostic pertains + Paths []string + + // Level holds the severity of the diagnostic. + // If empty, this defaults to ErrorLevel. + Level DiagnosticLevel + // Details contains an optional longer payload. // +optional Details string - errors []FieldError + + errors []FieldError } // FieldError implements error @@ -60,6 +96,7 @@ func (fe *FieldError) ViaField(prefix ...string) *FieldError { // along using .Also(). newErr := &FieldError{ Message: fe.Message, + Level: fe.Level, Details: fe.Details, } @@ -107,6 +144,54 @@ func (fe *FieldError) ViaFieldKey(field, key string) *FieldError { return fe.ViaKey(key).ViaField(field) } +// At is a way to alter the level of the diagnostics held in this FieldError. +// ErrMissingField("foo").At(WarningLevel) +func (fe *FieldError) At(l DiagnosticLevel) *FieldError { + if fe == nil { + return nil + } + // Copy over message and details, paths will be updated and errors come + // along using .Also(). + newErr := &FieldError{ + Message: fe.Message, + Level: l, + Details: fe.Details, + Paths: fe.Paths, + } + + for _, e := range fe.errors { + newErr = newErr.Also(e.At(l)) + } + return newErr +} + +// Filter is a way to access the set of diagnostics having a particular level. +// if err := x.Validate(ctx).Filter(ErrorLevel); err != nil { +// return err +// } +func (fe *FieldError) Filter(l DiagnosticLevel) *FieldError { + if fe == nil { + return nil + } + var newErr *FieldError + if l == fe.Level { + newErr = &FieldError{ + Message: fe.Message, + Level: fe.Level, + Details: fe.Details, + Paths: fe.Paths, + } + } + + for _, e := range fe.errors { + newErr = newErr.Also(e.Filter(l)) + } + if newErr.isEmpty() { + return nil + } + return newErr +} + // Also collects errors, returns a new collection of existing errors and new errors. func (fe *FieldError) Also(errs ...*FieldError) *FieldError { // Avoid doing any work, if we don't have to. @@ -154,6 +239,7 @@ func (fe *FieldError) normalized() []*FieldError { if fe.Message != "" { errors = append(errors, &FieldError{ Message: fe.Message, + Level: fe.Level, Paths: fe.Paths, Details: fe.Details, }) @@ -274,6 +360,9 @@ func merge(errs []*FieldError) []*FieldError { // Sort the flattened map. sort.Slice(newErrs, func(i, j int) bool { if newErrs[i].Message == newErrs[j].Message { + if newErrs[i].Details == newErrs[j].Details { + return newErrs[i].Level < newErrs[j].Level + } return newErrs[i].Details < newErrs[j].Details } return newErrs[i].Message < newErrs[j].Message @@ -285,7 +374,7 @@ func merge(errs []*FieldError) []*FieldError { // key returns the key using the fields .Message and .Details. func key(err *FieldError) string { - return fmt.Sprintf("%s-%s", err.Message, err.Details) + return fmt.Sprintf("%s-%s-%s", err.Level, err.Message, err.Details) } // Public helpers --- diff --git a/vendor/knative.dev/pkg/injection/sharedmain/main.go b/vendor/knative.dev/pkg/injection/sharedmain/main.go index 0420606b438..a57956ba893 100644 --- a/vendor/knative.dev/pkg/injection/sharedmain/main.go +++ b/vendor/knative.dev/pkg/injection/sharedmain/main.go @@ -59,10 +59,16 @@ func init() { maxprocs.Set() } -// GetLoggingConfig gets the logging config from either the file system if present -// or via reading a configMap from the API. +// GetLoggingConfig gets the logging config from the (in order): +// 1. provided context, +// 2. reading from the API server, +// 3. defaults (if not found). // The context is expected to be initialized with injection. func GetLoggingConfig(ctx context.Context) (*logging.Config, error) { + if cfg := logging.GetConfig(ctx); cfg != nil { + return cfg, nil + } + var loggingConfigMap *corev1.ConfigMap // These timeout and retry interval are set by heuristics. // e.g. istio sidecar needs a few seconds to configure the pod network. @@ -79,8 +85,15 @@ func GetLoggingConfig(ctx context.Context) (*logging.Config, error) { return logging.NewConfigFromConfigMap(loggingConfigMap) } -// GetLeaderElectionConfig gets the leader election config. +// GetLeaderElectionConfig gets the leader election config from the (in order): +// 1. provided context, +// 2. reading from the API server, +// 3. defaults (if not found). func GetLeaderElectionConfig(ctx context.Context) (*leaderelection.Config, error) { + if cfg := leaderelection.GetConfig(ctx); cfg != nil { + return cfg, nil + } + leaderElectionConfigMap, err := kubeclient.Get(ctx).CoreV1().ConfigMaps(system.Namespace()).Get(ctx, leaderelection.ConfigMapName(), metav1.GetOptions{}) if apierrors.IsNotFound(err) { return leaderelection.NewConfigFromConfigMap(nil) diff --git a/vendor/knative.dev/pkg/leaderelection/config.go b/vendor/knative.dev/pkg/leaderelection/config.go index 11010014a08..ba6e0c60ff5 100644 --- a/vendor/knative.dev/pkg/leaderelection/config.go +++ b/vendor/knative.dev/pkg/leaderelection/config.go @@ -17,6 +17,7 @@ limitations under the License. package leaderelection import ( + "context" "fmt" "os" "strconv" @@ -88,6 +89,24 @@ type Config struct { LeaseNamesPrefixMapping map[string]string } +type lecfg struct{} + +// WithConfig associates a leader election configuration with the +// context. +func WithConfig(ctx context.Context, cfg *Config) context.Context { + return context.WithValue(ctx, lecfg{}, cfg) +} + +// GetConfig gets the leader election config from the provided +// context. +func GetConfig(ctx context.Context) *Config { + untyped := ctx.Value(lecfg{}) + if untyped == nil { + return nil + } + return untyped.(*Config) +} + func (c *Config) GetComponentConfig(name string) ComponentConfig { return ComponentConfig{ Component: name, diff --git a/vendor/knative.dev/pkg/leaderelection/context.go b/vendor/knative.dev/pkg/leaderelection/context.go index 9e4a918226c..f52733ea303 100644 --- a/vendor/knative.dev/pkg/leaderelection/context.go +++ b/vendor/knative.dev/pkg/leaderelection/context.go @@ -273,7 +273,7 @@ func (ue *unopposedElector) Run(ctx context.Context) { func (ue *unopposedElector) InitialBuckets() []reconciler.Bucket { return []reconciler.Bucket{ - reconciler.UniversalBucket(), + ue.bkt, } } diff --git a/vendor/knative.dev/pkg/logging/config.go b/vendor/knative.dev/pkg/logging/config.go index 5dbf0a4e492..2cf81a8220f 100644 --- a/vendor/knative.dev/pkg/logging/config.go +++ b/vendor/knative.dev/pkg/logging/config.go @@ -17,6 +17,7 @@ limitations under the License. package logging import ( + "context" "encoding/json" "errors" "fmt" @@ -136,6 +137,22 @@ type Config struct { LoggingLevel map[string]zapcore.Level } +type lcfg struct{} + +// WithConfig associates a logging configuration with the context. +func WithConfig(ctx context.Context, cfg *Config) context.Context { + return context.WithValue(ctx, lcfg{}, cfg) +} + +// GetConfig gets the logging config from the provided context. +func GetConfig(ctx context.Context) *Config { + untyped := ctx.Value(lcfg{}) + if untyped == nil { + return nil + } + return untyped.(*Config) +} + func defaultConfig() *Config { return &Config{ LoggingLevel: make(map[string]zapcore.Level), diff --git a/vendor/knative.dev/pkg/network/h2c.go b/vendor/knative.dev/pkg/network/h2c.go index f950b9c34fc..6cc0fa733d9 100644 --- a/vendor/knative.dev/pkg/network/h2c.go +++ b/vendor/knative.dev/pkg/network/h2c.go @@ -54,3 +54,16 @@ func newH2CTransport(disableCompression bool) http.RoundTripper { }, } } + +// newH2Transport constructs a neew H2 transport. That transport will handles HTTPS traffic +// with TLS config. +func newH2Transport(disableCompression bool, tlsConf *tls.Config) http.RoundTripper { + return &http2.Transport{ + DisableCompression: disableCompression, + DialTLS: func(netw, addr string, tlsConf *tls.Config) (net.Conn, error) { + return DialTLSWithBackOff(context.Background(), + netw, addr, tlsConf) + }, + TLSClientConfig: tlsConf, + } +} diff --git a/vendor/knative.dev/pkg/network/transports.go b/vendor/knative.dev/pkg/network/transports.go index 26ce8239576..d48cd62151e 100644 --- a/vendor/knative.dev/pkg/network/transports.go +++ b/vendor/knative.dev/pkg/network/transports.go @@ -18,6 +18,7 @@ package network import ( "context" + "crypto/tls" "errors" "fmt" "net" @@ -45,7 +46,7 @@ func newAutoTransport(v1, v2 http.RoundTripper) http.RoundTripper { }) } -const sleepTO = 30 * time.Millisecond +const sleep = 30 * time.Millisecond var backOffTemplate = wait.Backoff{ Duration: 50 * time.Millisecond, @@ -54,6 +55,9 @@ var backOffTemplate = wait.Backoff{ Steps: 15, } +// ErrTimeoutDialing when the timeout is reached after set amount of time. +var ErrTimeoutDialing = errors.New("timed out dialing") + // DialWithBackOff executes `net.Dialer.DialContext()` with exponentially increasing // dial timeouts. In addition it sleeps with random jitter between tries. var DialWithBackOff = NewBackoffDialer(backOffTemplate) @@ -63,11 +67,21 @@ var DialWithBackOff = NewBackoffDialer(backOffTemplate) // between tries. func NewBackoffDialer(backoffConfig wait.Backoff) func(context.Context, string, string) (net.Conn, error) { return func(ctx context.Context, network, address string) (net.Conn, error) { - return dialBackOffHelper(ctx, network, address, backoffConfig, sleepTO) + return dialBackOffHelper(ctx, network, address, backoffConfig, nil) + } +} + +// DialTLSWithBackOff is same with DialWithBackOff but takes tls config. +var DialTLSWithBackOff = NewTLSBackoffDialer(backOffTemplate) + +// NewTLSBackoffDialer is same with NewBackoffDialer but takes tls config. +func NewTLSBackoffDialer(backoffConfig wait.Backoff) func(context.Context, string, string, *tls.Config) (net.Conn, error) { + return func(ctx context.Context, network, address string, tlsConf *tls.Config) (net.Conn, error) { + return dialBackOffHelper(ctx, network, address, backoffConfig, tlsConf) } } -func dialBackOffHelper(ctx context.Context, network, address string, bo wait.Backoff, sleep time.Duration) (net.Conn, error) { +func dialBackOffHelper(ctx context.Context, network, address string, bo wait.Backoff, tlsConf *tls.Config) (net.Conn, error) { dialer := &net.Dialer{ Timeout: bo.Duration, // Initial duration. KeepAlive: 5 * time.Second, @@ -75,7 +89,15 @@ func dialBackOffHelper(ctx context.Context, network, address string, bo wait.Bac } start := time.Now() for { - c, err := dialer.DialContext(ctx, network, address) + var ( + c net.Conn + err error + ) + if tlsConf == nil { + c, err = dialer.DialContext(ctx, network, address) + } else { + c, err = tls.DialWithDialer(dialer, network, address, tlsConf) + } if err != nil { var errNet net.Error if errors.As(err, &errNet) && errNet.Timeout() { @@ -91,7 +113,7 @@ func dialBackOffHelper(ctx context.Context, network, address string, bo wait.Bac return c, nil } elapsed := time.Since(start) - return nil, fmt.Errorf("timed out dialing after %.2fs", elapsed.Seconds()) + return nil, fmt.Errorf("%w %s after %.2fs", ErrTimeoutDialing, address, elapsed.Seconds()) } func newHTTPTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int) http.RoundTripper { @@ -105,6 +127,19 @@ func newHTTPTransport(disableKeepAlives, disableCompression bool, maxIdle, maxId return transport } +func newHTTPSTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int, tlsConf *tls.Config) http.RoundTripper { + transport := http.DefaultTransport.(*http.Transport).Clone() + transport.DialContext = DialWithBackOff + transport.DisableKeepAlives = disableKeepAlives + transport.MaxIdleConns = maxIdle + transport.MaxIdleConnsPerHost = maxIdlePerHost + transport.ForceAttemptHTTP2 = false + transport.DisableCompression = disableCompression + + transport.TLSClientConfig = tlsConf + return transport +} + // NewProberTransport creates a RoundTripper that is useful for probing, // since it will not cache connections. func NewProberTransport() http.RoundTripper { @@ -113,6 +148,13 @@ func NewProberTransport() http.RoundTripper { NewH2CTransport()) } +// NewProxyAutoTLSTransport is same with NewProxyAutoTransport but it has tls.Config to create HTTPS request. +func NewProxyAutoTLSTransport(maxIdle, maxIdlePerHost int, tlsConf *tls.Config) http.RoundTripper { + return newAutoTransport( + newHTTPSTransport(false /*disable keep-alives*/, true /*disable auto-compression*/, maxIdle, maxIdlePerHost, tlsConf), + newH2Transport(true /*disable auto-compression*/, tlsConf)) +} + // NewAutoTransport creates a RoundTripper that can use appropriate transport // based on the request's HTTP version. func NewAutoTransport(maxIdle, maxIdlePerHost int) http.RoundTripper { diff --git a/vendor/knative.dev/pkg/version/version.go b/vendor/knative.dev/pkg/version/version.go index b304f2b0a5e..39e34464b76 100644 --- a/vendor/knative.dev/pkg/version/version.go +++ b/vendor/knative.dev/pkg/version/version.go @@ -33,7 +33,7 @@ const ( // NOTE: If you are changing this line, please also update the minimum kubernetes // version listed here: // https://github.com/knative/docs/blob/mkdocs/docs/snippets/prerequisites.md - defaultMinimumVersion = "v1.21.0" + defaultMinimumVersion = "v1.22.0" ) func getMinimumVersion() string { diff --git a/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go b/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go index 0544d88a6b1..d1e7da94d39 100644 --- a/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go +++ b/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go @@ -60,7 +60,7 @@ func NewCallback(function func(context.Context, *unstructured.Unstructured) erro var _ webhook.AdmissionController = (*reconciler)(nil) // Admit implements AdmissionController -func (ac *reconciler) Admit(ctx context.Context, request *admissionv1.AdmissionRequest) *admissionv1.AdmissionResponse { +func (ac *reconciler) Admit(ctx context.Context, request *admissionv1.AdmissionRequest) (resp *admissionv1.AdmissionResponse) { if ac.withContext != nil { ctx = ac.withContext(ctx) } @@ -77,8 +77,19 @@ func (ac *reconciler) Admit(ctx context.Context, request *admissionv1.AdmissionR return webhook.MakeErrorStatus("decoding request failed: %v", err) } - if err := validate(ctx, resource, request); err != nil { - return webhook.MakeErrorStatus("validation failed: %v", err) + errors, warnings := validate(ctx, resource, request) + if warnings != nil { + // If there were warnings, then keep processing things, but augment + // whatever AdmissionResponse we send with the warnings. We cannot + // simply set `resp.Warnings` directly here because the return paths + // below all overwrite `resp`, but the `defer` affords us one final + // crack at things. + defer func() { + resp.Warnings = []string{warnings.Error()} + }() + } + if errors != nil { + return webhook.MakeErrorStatus("validation failed: %v", errors) } if err := ac.callback(ctx, request, gvk); err != nil { @@ -147,7 +158,7 @@ func (ac *reconciler) decodeRequestAndPrepareContext( return ctx, newObj, nil } -func validate(ctx context.Context, resource resourcesemantics.GenericCRD, req *admissionv1.AdmissionRequest) error { +func validate(ctx context.Context, resource resourcesemantics.GenericCRD, req *admissionv1.AdmissionRequest) (err error, warn error) { logger := logging.FromContext(ctx) // Only run validation for supported create and update validation. @@ -155,25 +166,32 @@ func validate(ctx context.Context, resource resourcesemantics.GenericCRD, req *a case admissionv1.Create, admissionv1.Update: // Supported verbs case admissionv1.Delete: - return nil // Validation handled by optional Callback, but not validatable. + return nil, nil // Validation handled by optional Callback, but not validatable. default: logger.Info("Unhandled webhook validation operation, letting it through ", req.Operation) - return nil + return nil, nil } // None of the validators will accept a nil value for newObj. if resource == nil { - return errMissingNewObject + return errMissingNewObject, nil } - if err := resource.Validate(ctx); err != nil { + if result := resource.Validate(ctx); result != nil { logger.Errorw("Failed the resource specific validation", zap.Error(err)) - // Return the error message as-is to give the validation callback - // discretion over (our portion of) the message that the user sees. - return err + // While we have the strong typing of apis.FieldError, partition the + // returned error into the error-level diagnostics and warning-level + // diagnostics, so that the admission response can embed things into + // the appropriate portions of the response. + // This is expanded like to to avoid problems with typed nils. + if errorResult := result.Filter(apis.ErrorLevel); errorResult != nil { + err = errorResult + } + if warningResult := result.Filter(apis.WarningLevel); warningResult != nil { + warn = warningResult + } } - - return nil + return err, warn } // callback runs optional callbacks on admission diff --git a/vendor/modules.txt b/vendor/modules.txt index 3a845568056..f433571cc46 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1162,7 +1162,7 @@ k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20220329144915-0a1ec2e0d46c +# knative.dev/pkg v0.0.0-20220524202603-19adf798efb8 ## explicit; go 1.17 knative.dev/pkg/apis knative.dev/pkg/apis/duck From 9c9b4951496f3b8c0e796e883b1d9db63f94e149 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 2 Jun 2022 12:15:18 +0200 Subject: [PATCH 2/3] Document that k8s 1.22 is the minimum required This updates all references of Kubernetes 1.21 as necessary, including the command for setting up K8s cluster. Signed-off-by: Vincent Demeester --- DEVELOPMENT.md | 4 ++-- docs/api-spec.md | 2 +- docs/install.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 8768292990c..6a800077b12 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -267,7 +267,7 @@ as follows. The recommended minimum development configuration is: -- Kubernetes version 1.21 or later +- Kubernetes version 1.22 or later - 4 (virtual) CPU nodes - 8 GB of (actual or virtualized) platform memory - Node autoscaling, up to 3 nodes @@ -326,7 +326,7 @@ optional: As a convenience, the [Tekton plumbing project](https://github.com/tek --machine-type=n1-standard-4 \ --image-type=cos \ --num-nodes=1 \ - --cluster-version=1.21 + --cluster-version=1.22 ``` > **Note**: The recommended [GCE machine type](https://cloud.google.com/compute/docs/machine-types) is `'n1-standard-4'`. diff --git a/docs/api-spec.md b/docs/api-spec.md index 3d6c9e55d05..409f9a0c32d 100644 --- a/docs/api-spec.md +++ b/docs/api-spec.md @@ -42,7 +42,7 @@ This document makes reference in a few places to different profiles for Tekton i The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). -There is no formal specification of the Kubernetes API and Resource Model. This document assumes Kubernetes 1.21 behavior; this behavior will typically be supported by many future Kubernetes versions. Additionally, this document may reference specific core Kubernetes resources; these references may be illustrative (i.e. an implementation on Kubernetes) or descriptive (i.e. this Kubernetes resource MUST be exposed). References to these core Kubernetes resources will be annotated as either illustrative or descriptive. +There is no formal specification of the Kubernetes API and Resource Model. This document assumes Kubernetes 1.22 behavior; this behavior will typically be supported by many future Kubernetes versions. Additionally, this document may reference specific core Kubernetes resources; these references may be illustrative (i.e. an implementation on Kubernetes) or descriptive (i.e. this Kubernetes resource MUST be exposed). References to these core Kubernetes resources will be annotated as either illustrative or descriptive. ## Modifying This Specification diff --git a/docs/install.md b/docs/install.md index 6dec367cbb8..455db40626c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -32,7 +32,7 @@ This guide explains how to install Tekton Pipelines. It covers the following top ## Before you begin -1. You must have a Kubernetes cluster running version 1.21 or later. +1. You must have a Kubernetes cluster running version 1.22 or later. If you don't already have a cluster, you can create one for testing with `kind`. [Install `kind`](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) and create a cluster by running [`kind create cluster`](https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster). This @@ -396,9 +396,9 @@ use of custom tasks in pipelines. most stable features to be used. Set it to "alpha" to allow [alpha features](#alpha-features) to be used. -- `embedded-status`: set this flag to "full" to enable full embedding of `TaskRun` and `Run` statuses in the +- `embedded-status`: set this flag to "full" to enable full embedding of `TaskRun` and `Run` statuses in the `PipelineRun` status. Set it to "minimal" to populate the `ChildReferences` field in the `PipelineRun` status with - name, kind, and API version information for each `TaskRun` and `Run` in the `PipelineRun` instead. Set it to "both" to + name, kind, and API version information for each `TaskRun` and `Run` in the `PipelineRun` instead. Set it to "both" to do both. For more information, see [Configuring usage of `TaskRun` and `Run` embedded statuses](pipelineruns.md#configuring-usage-of-taskrun-and-run-embedded-statuses). For example: From 4aad877ca4450e7576285e17b67363d2f5614d7d Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Tue, 26 Jul 2022 17:55:44 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20knative/pkg=20to=20release-1.6=20?= =?UTF-8?q?=F0=9F=98=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vincent Demeester --- go.mod | 12 +++++----- go.sum | 24 ++++++++++++------- hack/update-deps.sh | 2 +- pkg/client/clientset/versioned/clientset.go | 4 ++++ .../resource/clientset/versioned/clientset.go | 4 ++++ vendor/k8s.io/api/batch/v1/types.go | 3 +-- vendor/k8s.io/api/certificates/v1/types.go | 1 - vendor/k8s.io/api/core/v1/types.go | 19 ++++++--------- .../client/clientset/clientset/clientset.go | 4 ++++ .../k8s.io/client-go/kubernetes/clientset.go | 4 ++++ .../client-go/pkg/version/.gitattributes | 1 - .../tools/cache/thread_safe_store.go | 13 ++++------ .../generators/generator_for_clientset.go | 4 ++++ .../pkg/apis/duck/v1/zz_generated.deepcopy.go | 2 +- .../duck/v1beta1/zz_generated.deepcopy.go | 2 +- .../pkg/apis/zz_generated.deepcopy.go | 2 +- .../injection/apiextensions/client/client.go | 2 +- .../customresourcedefinition.go | 2 +- .../informers/factory/factory.go | 2 +- .../client/injection/kube/client/client.go | 2 +- .../client/injection/kube/client/fake/fake.go | 2 +- .../mutatingwebhookconfiguration.go | 2 +- .../validatingwebhookconfiguration.go | 2 +- .../informers/core/v1/configmap/configmap.go | 2 +- .../informers/core/v1/configmap/fake/fake.go | 2 +- .../informers/core/v1/limitrange/fake/fake.go | 2 +- .../core/v1/limitrange/limitrange.go | 2 +- .../core/v1/pod/filtered/fake/fake.go | 2 +- .../informers/core/v1/pod/filtered/pod.go | 2 +- .../core/v1/serviceaccount/fake/fake.go | 2 +- .../core/v1/serviceaccount/serviceaccount.go | 2 +- .../kube/informers/factory/factory.go | 2 +- .../kube/informers/factory/fake/fake.go | 2 +- .../filtered/fake/fake_filtered_factory.go | 2 +- .../factory/filtered/filtered_factory.go | 2 +- vendor/knative.dev/pkg/logging/config.go | 4 ++-- .../pkg/logging/zz_generated.deepcopy.go | 2 +- .../knative.dev/pkg/metrics/metrics_worker.go | 4 ++-- .../pkg/metrics/prometheus_exporter.go | 2 +- .../pkg/metrics/zz_generated.deepcopy.go | 2 +- .../pkg/tracker/zz_generated.deepcopy.go | 2 +- vendor/knative.dev/pkg/webhook/admission.go | 3 ++- .../defaulting/defaulting.go | 6 +++++ vendor/modules.txt | 12 +++++----- 44 files changed, 100 insertions(+), 76 deletions(-) delete mode 100644 vendor/k8s.io/client-go/pkg/version/.gitattributes diff --git a/go.mod b/go.mod index 1a01092a386..7dac7815adf 100644 --- a/go.mod +++ b/go.mod @@ -21,13 +21,13 @@ require ( go.uber.org/zap v1.21.0 golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b gomodules.xyz/jsonpatch/v2 v2.2.0 - k8s.io/api v0.23.5 - k8s.io/apimachinery v0.23.5 - k8s.io/client-go v0.23.5 - k8s.io/code-generator v0.23.5 + k8s.io/api v0.23.8 + k8s.io/apimachinery v0.23.8 + k8s.io/client-go v0.23.8 + k8s.io/code-generator v0.23.8 k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf - knative.dev/pkg v0.0.0-20220524202603-19adf798efb8 + knative.dev/pkg v0.0.0-20220705130606-e60d250dc637 sigs.k8s.io/yaml v1.3.0 ) @@ -142,7 +142,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.23.4 // indirect + k8s.io/apiextensions-apiserver v0.23.8 // indirect k8s.io/gengo v0.0.0-20220307231824-4627b89bbf1b // indirect k8s.io/klog/v2 v2.60.1-0.20220317184644-43cc75f9ae89 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect diff --git a/go.sum b/go.sum index b8d8048d1c1..b6bee299491 100644 --- a/go.sum +++ b/go.sum @@ -2151,36 +2151,43 @@ k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= -k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= -k8s.io/apiextensions-apiserver v0.23.4 h1:AFDUEu/yEf0YnuZhqhIFhPLPhhcQQVuR1u3WCh0rveU= +k8s.io/api v0.23.8 h1:tBMQ7z7s1NUUii649OaGe962xPacUzHwnGEj6Ahneu0= +k8s.io/api v0.23.8/go.mod h1:26VNldp5fRyiZ/tEO/3V8RJW+In1Aay3YkxsDzkvuWU= k8s.io/apiextensions-apiserver v0.23.4/go.mod h1:TWYAKymJx7nLMxWCgWm2RYGXHrGlVZnxIlGnvtfYu+g= +k8s.io/apiextensions-apiserver v0.23.8 h1:a8xlE5Jlpyjy7kTpABIt6uHLkt0714HuWnu1BARGQZE= +k8s.io/apiextensions-apiserver v0.23.8/go.mod h1:pcYtXkSRncXGgCCQSbTqppO3XMaLWdqlDisD4dUKQ/U= k8s.io/apimachinery v0.0.0-20190703205208-4cfb76a8bf76/go.mod h1:M2fZgZL9DbLfeJaPBCDqSqNsdsmLN+V29knYJnIXlMA= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apimachinery v0.23.8 h1:6Z+0LLvvPnAF6GXbUcBmzB1+b/AnDZpVd2N0MxUJcl0= +k8s.io/apimachinery v0.23.8/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= k8s.io/apiserver v0.23.4/go.mod h1:A6l/ZcNtxGfPSqbFDoxxOjEjSKBaQmE+UTveOmMkpNc= +k8s.io/apiserver v0.23.8/go.mod h1:/WVQG619hfUCgp3pazpqVspyC83NJemH5B0qxlZjNpw= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= k8s.io/client-go v0.23.3/go.mod h1:47oMd+YvAOqZM7pcQ6neJtBiFH7alOyfunYN48VsmwE= k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= -k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= +k8s.io/client-go v0.23.8 h1:0POvFP1/bN0DQYO41ks1tdzIBf9I+afqpUUNedyZ3T4= +k8s.io/client-go v0.23.8/go.mod h1:m9GosuTn6NlShCjb5XvrRlNDuHeIbGrsDLxjDoS6gec= k8s.io/code-generator v0.23.4/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= -k8s.io/code-generator v0.23.5 h1:xn3a6J5pUL49AoH6SPrOFtnB5cvdMl76f/bEY176R3c= k8s.io/code-generator v0.23.5/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/code-generator v0.23.8 h1:YHHiSaUd2uzLhUpzh1Wlsz20ah0BG6V3gYjkYSte8Gs= +k8s.io/code-generator v0.23.8/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= k8s.io/component-base v0.23.4/go.mod h1:8o3Gg8i2vnUXGPOwciiYlkSaZT+p+7gA9Scoz8y4W4E= +k8s.io/component-base v0.23.8/go.mod h1:rCj6EeaYLsNneVoFuSPL/AlEWmomc39j9M9i4NpR8r0= k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= @@ -2212,10 +2219,10 @@ k8s.io/utils v0.0.0-20220127004650-9b3446523e65/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= knative.dev/hack v0.0.0-20220328133751-f06773764ce3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/hack v0.0.0-20220524153203-12d3e2a7addc/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= +knative.dev/hack v0.0.0-20220701014203-65c463ac8c98/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/pkg v0.0.0-20220329144915-0a1ec2e0d46c/go.mod h1:0A5D5tOLettuVoi5x+0SLGRfrvVemXXtLH247WupPJk= -knative.dev/pkg v0.0.0-20220524202603-19adf798efb8 h1:7vZxPKJsJ4LkJTLiTy48nfykzfDi69OS4GKRs0qeSM4= -knative.dev/pkg v0.0.0-20220524202603-19adf798efb8/go.mod h1:pApypeWDkGrsMkUDkV6StWXS4CXhwGWuJEID9GGZY0Y= +knative.dev/pkg v0.0.0-20220705130606-e60d250dc637 h1:wvz8Y/b2Ubox0pbTLAbKags19UC72Ik+b/tIW2QP9/E= +knative.dev/pkg v0.0.0-20220705130606-e60d250dc637/go.mod h1:MxsV3ZGdrH87zv4O9HtxzbNwmiKcGwEP7UdriLINSn0= mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= @@ -2227,6 +2234,7 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.27/go.mod h1:tq2nT0Kx7W+/f2JVE+zxYtUhdjuELJkVpNz+x/QN5R4= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= diff --git a/hack/update-deps.sh b/hack/update-deps.sh index ccf01837bfb..5cfc3c4263e 100755 --- a/hack/update-deps.sh +++ b/hack/update-deps.sh @@ -22,7 +22,7 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri cd ${REPO_ROOT_DIR} -VERSION="release-1.5" +VERSION="release-1.6" # The list of dependencies that we track at HEAD and periodically # float forward in this repository. diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 0763f48419c..081e93512cf 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -77,6 +77,10 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + // share the transport between all clients httpClient, err := rest.HTTPClientFor(&configShallowCopy) if err != nil { diff --git a/pkg/client/resource/clientset/versioned/clientset.go b/pkg/client/resource/clientset/versioned/clientset.go index 4ea5b109585..9a624825bbb 100644 --- a/pkg/client/resource/clientset/versioned/clientset.go +++ b/pkg/client/resource/clientset/versioned/clientset.go @@ -61,6 +61,10 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + // share the transport between all clients httpClient, err := rest.HTTPClientFor(&configShallowCopy) if err != nil { diff --git a/vendor/k8s.io/api/batch/v1/types.go b/vendor/k8s.io/api/batch/v1/types.go index aec1cad8e20..13cebde3f1c 100644 --- a/vendor/k8s.io/api/batch/v1/types.go +++ b/vendor/k8s.io/api/batch/v1/types.go @@ -289,10 +289,9 @@ type UncountedTerminatedPods struct { Failed []types.UID `json:"failed,omitempty" protobuf:"bytes,2,rep,name=failed,casttype=k8s.io/apimachinery/pkg/types.UID"` } -// +enum type JobConditionType string -// These are valid conditions of a job. +// These are built-in conditions of a job. const ( // JobSuspended means the job has been suspended. JobSuspended JobConditionType = "Suspended" diff --git a/vendor/k8s.io/api/certificates/v1/types.go b/vendor/k8s.io/api/certificates/v1/types.go index a3900e1dca4..6403d460096 100644 --- a/vendor/k8s.io/api/certificates/v1/types.go +++ b/vendor/k8s.io/api/certificates/v1/types.go @@ -214,7 +214,6 @@ type CertificateSigningRequestStatus struct { } // RequestConditionType is the type of a CertificateSigningRequestCondition -// +enum type RequestConditionType string // Well-known condition types for certificate requests. diff --git a/vendor/k8s.io/api/core/v1/types.go b/vendor/k8s.io/api/core/v1/types.go index 80c5dd744c1..dcf83eccd00 100644 --- a/vendor/k8s.io/api/core/v1/types.go +++ b/vendor/k8s.io/api/core/v1/types.go @@ -522,7 +522,6 @@ type PersistentVolumeClaimSpec struct { } // PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type -// +enum type PersistentVolumeClaimConditionType string const ( @@ -2635,10 +2634,9 @@ const ( ) // PodConditionType is a valid value for PodCondition.Type -// +enum type PodConditionType string -// These are valid conditions of pod. +// These are built-in conditions of pod. An application may use a custom condition not listed here. const ( // ContainersReady indicates whether all containers in the pod are ready. ContainersReady PodConditionType = "ContainersReady" @@ -5055,11 +5053,10 @@ const ( NodeTerminated NodePhase = "Terminated" ) -// +enum type NodeConditionType string -// These are valid conditions of node. Currently, we don't have enough information to decide -// node condition. In the future, we will add more. The proposed set of conditions are: +// These are valid but not exhaustive conditions of node. A cloud provider may set a condition not listed here. +// The built-in set of conditions are: // NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable. const ( // NodeReady means kubelet is healthy and ready to accept pods. @@ -5094,10 +5091,9 @@ type NodeCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` } -// +enum type NodeAddressType string -// These are valid address type of node. +// These are built-in addresses type of node. A cloud provider may set a type not listed here. const ( // NodeHostName identifies a name of the node. Although every node can be assumed // to have a NodeAddress of this type, its exact syntax and semantics are not @@ -5267,10 +5263,9 @@ const ( NamespaceTerminatingCause metav1.CauseType = "NamespaceTerminating" ) -// +enum type NamespaceConditionType string -// These are valid conditions of a namespace. +// These are built-in conditions of a namespace. const ( // NamespaceDeletionDiscoveryFailure contains information about namespace deleter errors during resource discovery. NamespaceDeletionDiscoveryFailure NamespaceConditionType = "NamespaceDeletionDiscoveryFailure" @@ -5758,8 +5753,8 @@ type EventList struct { // List holds a list of objects, which may not be known by the server. type List metav1.List -// LimitType is a type of object that is limited -// +enum +// LimitType is a type of object that is limited. It can be Pod, Container, PersistentVolumeClaim or +// a fully qualified resource name. type LimitType string const ( diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go index 23f75d5d17d..65ae76067df 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go @@ -69,6 +69,10 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + // share the transport between all clients httpClient, err := rest.HTTPClientFor(&configShallowCopy) if err != nil { diff --git a/vendor/k8s.io/client-go/kubernetes/clientset.go b/vendor/k8s.io/client-go/kubernetes/clientset.go index 3e512a7c2e9..e46c0537f78 100644 --- a/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -413,6 +413,10 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + // share the transport between all clients httpClient, err := rest.HTTPClientFor(&configShallowCopy) if err != nil { diff --git a/vendor/k8s.io/client-go/pkg/version/.gitattributes b/vendor/k8s.io/client-go/pkg/version/.gitattributes deleted file mode 100644 index 7e349eff60b..00000000000 --- a/vendor/k8s.io/client-go/pkg/version/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -base.go export-subst diff --git a/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go b/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go index ea34e90355b..71d909d49e5 100644 --- a/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go +++ b/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go @@ -284,18 +284,15 @@ func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, ke c.indices[name] = index } + if len(indexValues) == 1 && len(oldIndexValues) == 1 && indexValues[0] == oldIndexValues[0] { + // We optimize for the most common case where indexFunc returns a single value which has not been changed + continue + } + for _, value := range oldIndexValues { - // We optimize for the most common case where index returns a single value. - if len(indexValues) == 1 && value == indexValues[0] { - continue - } c.deleteKeyFromIndex(key, value, index) } for _, value := range indexValues { - // We optimize for the most common case where index returns a single value. - if len(oldIndexValues) == 1 && value == oldIndexValues[0] { - continue - } c.addKeyToIndex(key, value, index) } } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go index b0212296c1c..cd7b1d0fc02 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go @@ -143,6 +143,10 @@ var newClientsetForConfigTemplate = ` func NewForConfig(c *$.Config|raw$) (*Clientset, error) { configShallowCopy := *c + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = $.DefaultKubernetesUserAgent|raw$() + } + // share the transport between all clients httpClient, err := $.RESTHTTPClientFor|raw$(&configShallowCopy) if err != nil { diff --git a/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go index dcde449401f..96638e5799d 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go index 2e7d702c458..743081b012f 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go index 512ebea2401..367d7941f8b 100644 --- a/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/apiextensions/client/client.go b/vendor/knative.dev/pkg/client/injection/apiextensions/client/client.go index 9c8d95a7c44..c44fdb2e370 100644 --- a/vendor/knative.dev/pkg/client/injection/apiextensions/client/client.go +++ b/vendor/knative.dev/pkg/client/injection/apiextensions/client/client.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1/customresourcedefinition/customresourcedefinition.go b/vendor/knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1/customresourcedefinition/customresourcedefinition.go index 3f48176e676..3d1e31f865d 100644 --- a/vendor/knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1/customresourcedefinition/customresourcedefinition.go +++ b/vendor/knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1/customresourcedefinition/customresourcedefinition.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/apiextensions/informers/factory/factory.go b/vendor/knative.dev/pkg/client/injection/apiextensions/informers/factory/factory.go index 92d4d95da1c..d3f0cdde2e3 100644 --- a/vendor/knative.dev/pkg/client/injection/apiextensions/informers/factory/factory.go +++ b/vendor/knative.dev/pkg/client/injection/apiextensions/informers/factory/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/client/client.go b/vendor/knative.dev/pkg/client/injection/kube/client/client.go index 1fc2956ff19..caf6cb79324 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/client/client.go +++ b/vendor/knative.dev/pkg/client/injection/kube/client/client.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/client/fake/fake.go b/vendor/knative.dev/pkg/client/injection/kube/client/fake/fake.go index 4360b0ec415..11d2f9fbf2d 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/client/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/kube/client/fake/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/mutatingwebhookconfiguration/mutatingwebhookconfiguration.go b/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/mutatingwebhookconfiguration/mutatingwebhookconfiguration.go index c9ca217ff06..9c395d26e4b 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/mutatingwebhookconfiguration/mutatingwebhookconfiguration.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/mutatingwebhookconfiguration/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/validatingwebhookconfiguration/validatingwebhookconfiguration.go b/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/validatingwebhookconfiguration/validatingwebhookconfiguration.go index d89501a0388..f4fee2dfd59 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/validatingwebhookconfiguration/validatingwebhookconfiguration.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/admissionregistration/v1/validatingwebhookconfiguration/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/configmap.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/configmap.go index e8d1516ca58..1dafbeb08b0 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/configmap.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/fake/fake.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/fake/fake.go index 475aa4f5842..22f41410867 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/fake/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/fake/fake.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/fake/fake.go index 0d5f06be923..d318aec6a1b 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/fake/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/limitrange.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/limitrange.go index a70fbb2e923..21f34cacfb5 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/limitrange.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/fake/fake.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/fake/fake.go index 43fb377317e..529c6de66fb 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/fake/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/pod.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/pod.go index 48803cac23e..6ed53e27c8a 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/pod.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/fake/fake.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/fake/fake.go index c635d2ce2e0..81c0c20000b 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/fake/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/serviceaccount.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/serviceaccount.go index 6cc5cd4da2b..4d9bbd809c4 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/serviceaccount.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go index c1c136755a1..8bcb84dcc3c 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/fake/fake.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/fake/fake.go index 2c61615135e..8a1c1b712fc 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/fake/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go index 3e71d496460..79713fe4b10 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go index fbd00f1bc7a..1012636627f 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/logging/config.go b/vendor/knative.dev/pkg/logging/config.go index 2cf81a8220f..de979368cc8 100644 --- a/vendor/knative.dev/pkg/logging/config.go +++ b/vendor/knative.dev/pkg/logging/config.go @@ -114,8 +114,8 @@ func newLoggerFromConfig(configJSON, levelOverride string, opts []zap.Option) (* return nil, zap.AtomicLevel{}, err } - logger.Info("Successfully created the logger.") - logger.Info("Logging level set to: " + loggingCfg.Level.String()) + logger.Debug("Successfully created the logger.") + logger.Debug("Logging level set to: " + loggingCfg.Level.String()) return logger, loggingCfg.Level, nil } diff --git a/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go index ac7d5e152c9..a752abd9b29 100644 --- a/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/metrics/metrics_worker.go b/vendor/knative.dev/pkg/metrics/metrics_worker.go index 0b7753acb27..6f2ccff256e 100644 --- a/vendor/knative.dev/pkg/metrics/metrics_worker.go +++ b/vendor/knative.dev/pkg/metrics/metrics_worker.go @@ -73,7 +73,7 @@ func (cmd *updateMetricsConfigWithExporter) handleCommand(w *metricsWorker) { ctx := cmd.ctx logger := logging.FromContext(ctx) if isNewExporterRequired(cmd.newConfig) { - logger.Info("Flushing the existing exporter before setting up the new exporter.") + logger.Debug("Flushing the existing exporter before setting up the new exporter.") flushGivenExporter(curMetricsExporter) e, f, err := newMetricsExporter(cmd.newConfig, logger) if err != nil { @@ -88,7 +88,7 @@ func (cmd *updateMetricsConfigWithExporter) handleCommand(w *metricsWorker) { cmd.done <- err return } - logger.Infof("Successfully updated the metrics exporter; old config: %v; new config %v", existingConfig, cmd.newConfig) + logger.Debugf("Successfully updated the metrics exporter; old config: %v; new config %v", existingConfig, cmd.newConfig) } setCurMetricsConfigUnlocked(cmd.newConfig) cmd.done <- nil diff --git a/vendor/knative.dev/pkg/metrics/prometheus_exporter.go b/vendor/knative.dev/pkg/metrics/prometheus_exporter.go index 7c177b12995..b5b39d9fcea 100644 --- a/vendor/knative.dev/pkg/metrics/prometheus_exporter.go +++ b/vendor/knative.dev/pkg/metrics/prometheus_exporter.go @@ -48,7 +48,7 @@ func newPrometheusExporter(config *metricsConfig, logger *zap.SugaredLogger) (vi logger.Errorw("Failed to create the Prometheus exporter.", zap.Error(err)) return nil, nil, err } - logger.Infof("Created Prometheus exporter with config: %v. Start the server for Prometheus exporter.", config) + logger.Debugf("Created Prometheus exporter with config: %v. Start the server for Prometheus exporter.", config) // Start the server for Prometheus scraping go func() { srv := startNewPromSrv(e, config.prometheusHost, config.prometheusPort) diff --git a/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go index e0108605b33..1d90e3a9dd0 100644 --- a/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go index 8e2f56b47cc..814f39909d0 100644 --- a/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Knative Authors +Copyright 2022 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/knative.dev/pkg/webhook/admission.go b/vendor/knative.dev/pkg/webhook/admission.go index ff14585f7c2..ea5518260ea 100644 --- a/vendor/knative.dev/pkg/webhook/admission.go +++ b/vendor/knative.dev/pkg/webhook/admission.go @@ -102,7 +102,8 @@ func admissionHandler(rootLogger *zap.SugaredLogger, stats StatsReporter, c Admi logkey.Operation, string(review.Request.Operation), logkey.Resource, review.Request.Resource.String(), logkey.SubResource, review.Request.SubResource, - logkey.UserInfo, fmt.Sprint(review.Request.UserInfo)) + logkey.UserInfo, review.Request.UserInfo.Username, + ) ctx := logging.WithLogger(r.Context(), logger) ctx = apis.WithHTTPRequest(ctx, r) diff --git a/vendor/knative.dev/pkg/webhook/resourcesemantics/defaulting/defaulting.go b/vendor/knative.dev/pkg/webhook/resourcesemantics/defaulting/defaulting.go index a8a30fae13d..90f9ec8c96c 100644 --- a/vendor/knative.dev/pkg/webhook/resourcesemantics/defaulting/defaulting.go +++ b/vendor/knative.dev/pkg/webhook/resourcesemantics/defaulting/defaulting.go @@ -245,6 +245,8 @@ func (ac *reconciler) reconcileMutatingWebhook(ctx context.Context, caCert []byt return fmt.Errorf("missing service reference for webhook: %s", wh.Name) } cur.ClientConfig.Service.Path = ptr.String(ac.Path()) + + cur.ReinvocationPolicy = ptrReinvocationPolicyType(admissionregistrationv1.IfNeededReinvocationPolicy) } if ok, err := kmp.SafeEqual(configuredWebhook, current); err != nil { @@ -471,3 +473,7 @@ func setDefaults(ctx context.Context, patches duck.JSONPatch, crd resourcesemant return append(patches, patch...), nil } + +func ptrReinvocationPolicyType(r admissionregistrationv1.ReinvocationPolicyType) *admissionregistrationv1.ReinvocationPolicyType { + return &r +} diff --git a/vendor/modules.txt b/vendor/modules.txt index f433571cc46..2252ca84dd0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -707,7 +707,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.23.5 +# k8s.io/api v0.23.8 ## explicit; go 1.16 k8s.io/api/admission/v1 k8s.io/api/admissionregistration/v1 @@ -755,7 +755,7 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apiextensions-apiserver v0.23.4 +# k8s.io/apiextensions-apiserver v0.23.8 ## explicit; go 1.16 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 @@ -771,7 +771,7 @@ k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensio k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1 -# k8s.io/apimachinery v0.23.5 +# k8s.io/apimachinery v0.23.8 ## explicit; go 1.16 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -821,7 +821,7 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/client-go v0.23.5 +# k8s.io/client-go v0.23.8 ## explicit; go 1.16 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1 @@ -1100,7 +1100,7 @@ k8s.io/client-go/util/jsonpath k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/code-generator v0.23.5 +# k8s.io/code-generator v0.23.8 ## explicit; go 1.16 k8s.io/code-generator/cmd/client-gen k8s.io/code-generator/cmd/client-gen/args @@ -1162,7 +1162,7 @@ k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20220524202603-19adf798efb8 +# knative.dev/pkg v0.0.0-20220705130606-e60d250dc637 ## explicit; go 1.17 knative.dev/pkg/apis knative.dev/pkg/apis/duck