diff --git a/go.mod b/go.mod index bafc80b69..d98f95dfb 100644 --- a/go.mod +++ b/go.mod @@ -22,11 +22,11 @@ require ( k8s.io/cli-runtime v0.20.7 k8s.io/client-go v0.20.7 k8s.io/code-generator v0.20.7 - knative.dev/eventing v0.24.0 + knative.dev/eventing v0.24.1-0.20210702080639-90932eb671e0 knative.dev/hack v0.0.0-20210622141627-e28525d8d260 - knative.dev/networking v0.0.0-20210622182128-53f45d6d2cfa - knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80 - knative.dev/serving v0.24.0 + knative.dev/networking v0.0.0-20210705111547-ca0a601fc900 + knative.dev/pkg v0.0.0-20210701025203-30f9568e894e + knative.dev/serving v0.24.1-0.20210705154247-d207fa3a92ac sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index a58eccca8..3076e3140 100644 --- a/go.sum +++ b/go.sum @@ -1593,19 +1593,21 @@ k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/caching v0.0.0-20210622183028-95f67e075071/go.mod h1:9gwZcCBtmo9pi1oTgchXcdMNAXAYWklwDmO9uhDsIJE= -knative.dev/eventing v0.24.0 h1:CoaQwZBizxZyOFJUvFcyb7vYSvpYBmfb4IYRNWUdTPE= -knative.dev/eventing v0.24.0/go.mod h1:9xo0SWkIfpXrx0lvGQO7MUlPF8cu+QCMd2gGxj6wxrU= +knative.dev/caching v0.0.0-20210701025702-e6e703d9557b/go.mod h1:RZs6mvIaZendqv7O0ewst35K8o13Wqy5J7oMDjAdiu4= +knative.dev/eventing v0.24.1-0.20210702080639-90932eb671e0 h1:A3/G1uDuRLTU2vYAb8Po9F3CKZ1Svmqk5hfr5/dxTJ8= +knative.dev/eventing v0.24.1-0.20210702080639-90932eb671e0/go.mod h1:93VHah2XghrfrDFr4jSN4KdZS7RtoZuv4qR2Jn2B6x8= knative.dev/hack v0.0.0-20210622141627-e28525d8d260 h1:f2eMtOubAOc/Q7JlvFPDKXiPlJVK+VpX2Cot8hRzCgQ= knative.dev/hack v0.0.0-20210622141627-e28525d8d260/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack/schema v0.0.0-20210622141627-e28525d8d260/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0= -knative.dev/networking v0.0.0-20210622182128-53f45d6d2cfa h1:MprAGBX3eRaBZFRXC3ZjsnhnjttfprRVXdxmTeEzC2o= -knative.dev/networking v0.0.0-20210622182128-53f45d6d2cfa/go.mod h1:vwPACNE712tyoEG4fjyUIgfL4xkbXFugx8bxW+QrKn4= -knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80 h1:GHJ3lglE0/YHfBMMJqluqUNLOmsNXh7s7DBnfrkpRMM= +knative.dev/networking v0.0.0-20210705111547-ca0a601fc900 h1:pjC4YxKR0mH5/GTORkdyN2U2oNoCwICGrX6AReUG0LE= +knative.dev/networking v0.0.0-20210705111547-ca0a601fc900/go.mod h1:lT2n243XZb7K59q4FLtCuAeuboOjoJeLYvTxxfO5rIY= knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80/go.mod h1:kGegTnbZ+ljFjAE3E1+8wgaH2LMv8qYi+72o3F3cbdc= -knative.dev/reconciler-test v0.0.0-20210623134345-88c84739abd9/go.mod h1:4wqv2WyWUC5yhTesRUVwgjv/fHTHny1RYBfdB6tVDok= -knative.dev/serving v0.24.0 h1:MZIXR0r2FCXlTuQQXwLuM9+tV6pl2K6YUtK6tEtDB58= -knative.dev/serving v0.24.0/go.mod h1:l/dhsWs+Y8PAssBxaS/hN4HRQQGy4zxfVHD1xYjl3ns= +knative.dev/pkg v0.0.0-20210628225612-51cfaabbcdf6/go.mod h1:kGegTnbZ+ljFjAE3E1+8wgaH2LMv8qYi+72o3F3cbdc= +knative.dev/pkg v0.0.0-20210701025203-30f9568e894e h1:2TofgD72tjBuWN3a4Rg3uzrMu1OWOlh2KY2m0fsjwqQ= +knative.dev/pkg v0.0.0-20210701025203-30f9568e894e/go.mod h1:kGegTnbZ+ljFjAE3E1+8wgaH2LMv8qYi+72o3F3cbdc= +knative.dev/reconciler-test v0.0.0-20210630182710-2a6d91dfee1e/go.mod h1:4wqv2WyWUC5yhTesRUVwgjv/fHTHny1RYBfdB6tVDok= +knative.dev/serving v0.24.1-0.20210705154247-d207fa3a92ac h1:z9xRHZxze66dnlNunH7BwKpBQq4eyyeBJcVvrFRrDAI= +knative.dev/serving v0.24.1-0.20210705154247-d207fa3a92ac/go.mod h1:ktSG08SjDYoGEIPw9GzzS6njQjr6bpWXQuViOOtmLkg= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go b/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go index de861c32d..e7ea78925 100644 --- a/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go +++ b/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go @@ -28,6 +28,7 @@ var ( allowedAnnotations = sets.NewString( DisableAutoTLSAnnotationKey, CertificateClassAnnotationKey, + HTTPOptionAnnotationKey, ) ) diff --git a/vendor/knative.dev/networking/pkg/apis/networking/register.go b/vendor/knative.dev/networking/pkg/apis/networking/register.go index 59771e579..ec18c4bc0 100644 --- a/vendor/knative.dev/networking/pkg/apis/networking/register.go +++ b/vendor/knative.dev/networking/pkg/apis/networking/register.go @@ -35,9 +35,14 @@ const ( // Istio-based Ingress will reconcile into a VirtualService). IngressClassAnnotationKey = "networking.knative.dev/ingress.class" - // DisableAutoTLSAnnotationKey is the label key attached to a namespace to indicate that - // AutoTLS should not be enabled for it. + // DisableAutoTLSAnnotationKey is the annotation key attached to a Knative Service/DomainMapping + // to indicate that AutoTLS should not be enabled for it. DisableAutoTLSAnnotationKey = "networking.knative.dev/disableAutoTLS" + + // HTTPOptionAnnotationKey is the annotation key attached to a Knative Service/DomainMapping + // to indicate the HTTP option of it. + HTTPOptionAnnotationKey = "networking.knative.dev/httpOption" + // IngressLabelKey is the label key attached to underlying network programming // resources to indicate which Ingress triggered their creation. IngressLabelKey = GroupName + "/ingress" @@ -69,10 +74,6 @@ const ( // Cert-Manager-based Certificate will reconcile into a Cert-Manager Certificate). CertificateClassAnnotationKey = "networking.knative.dev/certificate.class" - // DeprecatedDisableWildcardCertLabelKey is the deprecated label key attached to a namespace to indicate that - // a wildcard certificate should be not created for it. - DeprecatedDisableWildcardCertLabelKey = GroupName + "/disableWildcardCert" - // DisableWildcardCertLabelKey is the label key attached to a namespace to indicate that // a wildcard certificate should be not created for it. DisableWildcardCertLabelKey = "networking.knative.dev/disableWildcardCert" diff --git a/vendor/knative.dev/pkg/controller/controller.go b/vendor/knative.dev/pkg/controller/controller.go index 9593eef28..593d00a47 100644 --- a/vendor/knative.dev/pkg/controller/controller.go +++ b/vendor/knative.dev/pkg/controller/controller.go @@ -57,6 +57,7 @@ var ( // when processing the controller's workqueue. Controller binaries // may adjust this process-wide default. For finer control, invoke // Run on the controller directly. + // TODO rename the const to Concurrency and deprecated this DefaultThreadsPerController = 2 ) @@ -203,6 +204,9 @@ type Impl struct { // which are not required to complete at the highest priority. workQueue *twoLaneQueue + // Concurrency - The number of workers to use when processing the controller's workqueue. + Concurrency int + // Sugared logger is easier to use but is not as performant as the // raw logger. In performance critical paths, call logger.Desugar() // and use the returned raw logger instead. In addition to the @@ -221,6 +225,7 @@ type ControllerOptions struct { //nolint // for backcompat. Logger *zap.SugaredLogger Reporter StatsReporter RateLimiter workqueue.RateLimiter + Concurrency int } // NewImpl instantiates an instance of our controller that will feed work to the @@ -244,12 +249,16 @@ func NewImplFull(r Reconciler, options ControllerOptions) *Impl { if options.Reporter == nil { options.Reporter = MustNewStatsReporter(options.WorkQueueName, options.Logger) } + if options.Concurrency == 0 { + options.Concurrency = DefaultThreadsPerController + } return &Impl{ Name: options.WorkQueueName, Reconciler: r, workQueue: newTwoLaneWorkQueue(options.WorkQueueName, options.RateLimiter), logger: options.Logger, statsReporter: options.Reporter, + Concurrency: options.Concurrency, } } @@ -723,9 +732,10 @@ func StartAll(ctx context.Context, controllers ...*Impl) { // Start all of the controllers. for _, ctrlr := range controllers { wg.Add(1) + concurrency := ctrlr.Concurrency go func(c *Impl) { defer wg.Done() - c.RunContext(ctx, DefaultThreadsPerController) + c.RunContext(ctx, concurrency) }(ctrlr) } wg.Wait() diff --git a/vendor/knative.dev/pkg/controller/options.go b/vendor/knative.dev/pkg/controller/options.go index 8d61835e6..dbacd7479 100644 --- a/vendor/knative.dev/pkg/controller/options.go +++ b/vendor/knative.dev/pkg/controller/options.go @@ -38,6 +38,9 @@ type Options struct { // DemoteFunc configures the demote function this reconciler uses DemoteFunc func(b reconciler.Bucket) + + // Concurrency - The number of workers to use when processing the controller's workqueue. + Concurrency int } // OptionsFn is a callback method signature that accepts an Impl and returns diff --git a/vendor/knative.dev/pkg/logging/warning_handler.go b/vendor/knative.dev/pkg/logging/warning_handler.go new file mode 100644 index 000000000..7ea7aeeff --- /dev/null +++ b/vendor/knative.dev/pkg/logging/warning_handler.go @@ -0,0 +1,33 @@ +/* +Copyright 2021 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. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logging + +import "go.uber.org/zap" + +// WarningHandler is a warning handler to forward client-go's warning logs into a zap logger. +type WarningHandler struct { + Logger *zap.SugaredLogger +} + +func (h *WarningHandler) HandleWarningHeader(code int, agent string, message string) { + // This condition is copied from K8s' default WarningLogger. + if code != 299 || len(message) == 0 { + return + } + + h.Logger.Warn("API Warning: " + message) +} diff --git a/vendor/knative.dev/pkg/ptr/value.go b/vendor/knative.dev/pkg/ptr/value.go new file mode 100644 index 000000000..148bf2105 --- /dev/null +++ b/vendor/knative.dev/pkg/ptr/value.go @@ -0,0 +1,91 @@ +/* +Copyright 2021 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. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ptr + +import "time" + +// Int32Value is a helper for turning pointers to integers into values for use +// in API types that want int32. +func Int32Value(i *int32) int32 { + if i == nil { + return 0 + } + return *i +} + +// Int64Value is a helper for turning pointers to integers into values for use +// in API types that want int64. +func Int64Value(i *int64) int64 { + if i == nil { + return 0 + } + return *i +} + +// Float32Value is a helper for turning pointers to floats into values for use +// in API types that want float32. +func Float32Value(f *float32) float32 { + if f == nil { + return 0 + } + return *f +} + +// Float64Value is a helper for turning pointers to floats into values for use +// in API types that want float64. +func Float64Value(f *float64) float64 { + if f == nil { + return 0 + } + return *f +} + +// BoolValue is a helper for turning pointers to bools into values for use in +// API types that want bool. +func BoolValue(b *bool) bool { + if b == nil { + return false + } + return *b +} + +// StringValue is a helper for turning pointers to strings into values for use +// in API types that want string. +func StringValue(s *string) string { + if s == nil { + return "" + } + return *s +} + +// DurationValue is a helper for turning *time.Duration into values for use in +// API types that want time.Duration. +func DurationValue(t *time.Duration) time.Duration { + if t == nil { + return 0 + } + return *t +} + +// TimeValue is a helper for turning *time.Time into values for use in API +// types that want API types that want time.Time. +func TimeValue(t *time.Time) time.Time { + if t == nil { + return time.Time{} + } + return *t +} diff --git a/vendor/knative.dev/pkg/test/spoof/spoof.go b/vendor/knative.dev/pkg/test/spoof/spoof.go index 48ffcffa8..0513f7e0f 100644 --- a/vendor/knative.dev/pkg/test/spoof/spoof.go +++ b/vendor/knative.dev/pkg/test/spoof/spoof.go @@ -208,7 +208,7 @@ func DefaultErrorRetryChecker(err error) (bool, error) { if isTCPTimeout(err) { return true, fmt.Errorf("retrying for TCP timeout: %w", err) } - // Retrying on DNS error, since we may be using xip.io or nip.io in tests. + // Retrying on DNS error, since we may be using sslip.io or nip.io in tests. if isDNSError(err) { return true, fmt.Errorf("retrying for DNS error: %w", err) } diff --git a/vendor/modules.txt b/vendor/modules.txt index deeadd96c..c0a68035a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -776,7 +776,7 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/eventing v0.24.0 +# knative.dev/eventing v0.24.1-0.20210702080639-90932eb671e0 ## explicit knative.dev/eventing/pkg/apis/config knative.dev/eventing/pkg/apis/duck @@ -805,12 +805,12 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2/fake # knative.dev/hack v0.0.0-20210622141627-e28525d8d260 ## explicit knative.dev/hack -# knative.dev/networking v0.0.0-20210622182128-53f45d6d2cfa +# knative.dev/networking v0.0.0-20210705111547-ca0a601fc900 ## explicit knative.dev/networking/pkg knative.dev/networking/pkg/apis/networking knative.dev/networking/pkg/apis/networking/v1alpha1 -# knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80 +# knative.dev/pkg v0.0.0-20210701025203-30f9568e894e ## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -856,7 +856,7 @@ knative.dev/pkg/tracing/propagation knative.dev/pkg/tracing/propagation/tracecontextb3 knative.dev/pkg/tracker knative.dev/pkg/unstructured -# knative.dev/serving v0.24.0 +# knative.dev/serving v0.24.1-0.20210705154247-d207fa3a92ac ## explicit knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1