diff --git a/go.mod b/go.mod index 6cba772e2..29bd73d3f 100644 --- a/go.mod +++ b/go.mod @@ -22,11 +22,11 @@ require ( k8s.io/cli-runtime v0.18.8 k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible k8s.io/code-generator v0.18.12 - knative.dev/eventing v0.19.1-0.20201202221809-1d3519c16565 + knative.dev/eventing v0.19.1-0.20201209153742-4f49cc70ea5f knative.dev/hack v0.0.0-20201201234937-fddbf732e450 - knative.dev/networking v0.0.0-20201203234509-4cd0793eed11 - knative.dev/pkg v0.0.0-20201204013209-b89ac2a63293 - knative.dev/serving v0.19.1-0.20201204004409-4bbc460995d6 + knative.dev/networking v0.0.0-20201210013742-d3109cc5f95d + knative.dev/pkg v0.0.0-20201210014142-0c53297607c6 + knative.dev/serving v0.19.1-0.20201210003942-0243c480fb67 sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index c0dbaaa8e..4421d4c12 100644 --- a/go.sum +++ b/go.sum @@ -1223,9 +1223,9 @@ k8s.io/legacy-cloud-providers v0.18.8/go.mod h1:tgp4xYf6lvjrWnjQwTOPvWQE9IVqSBGP k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/caching v0.0.0-20201202014037-fc10335afb00/go.mod h1:LWpD8X3fJcsDzfika4rzu1avRJqCmv2OOyTNoD8OHsQ= -knative.dev/eventing v0.19.1-0.20201202221809-1d3519c16565 h1:Xj/WF2mG4tyJvGEsuh6V311J/nwP3wPRJ1ioMO/Urs0= -knative.dev/eventing v0.19.1-0.20201202221809-1d3519c16565/go.mod h1:LeCXV+DSK6WMrgTJVE/Vyrpj5mo1BzbnpucjQh8zYf4= +knative.dev/caching v0.0.0-20201208013740-3ca9791186ed/go.mod h1:i+e4gaoBB34anvKMMiQDV86N7HbFYN6m+Op1IRhXXY8= +knative.dev/eventing v0.19.1-0.20201209153742-4f49cc70ea5f h1:ey20wwLRaPj5ynyonYAUe8f+EHcplS4XATBMyXEWr+s= +knative.dev/eventing v0.19.1-0.20201209153742-4f49cc70ea5f/go.mod h1:LeCXV+DSK6WMrgTJVE/Vyrpj5mo1BzbnpucjQh8zYf4= knative.dev/hack v0.0.0-20201112185459-01a34c573bd8 h1:RNbZsAjhswBPtl4C5C5gEFX5/GfWIOZQxfYD9DhkHdY= knative.dev/hack v0.0.0-20201112185459-01a34c573bd8/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20201118155651-b31d3bb6bff9/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= @@ -1233,20 +1233,21 @@ knative.dev/hack v0.0.0-20201120192952-353db687ec5b h1:Lc+AKgwhAZUD98mN++qTHeeaP knative.dev/hack v0.0.0-20201120192952-353db687ec5b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20201201234937-fddbf732e450 h1:IyitWF7OzfunCgE4b9ZsJAeIRoQ6JOyqDrz/19X4iS4= knative.dev/hack v0.0.0-20201201234937-fddbf732e450/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/networking v0.0.0-20201203005409-47ea2396c447/go.mod h1:9MYaP1/cs1zYvvvr+gda2XRW1e1WqmUE0xKVxkwmUXw= -knative.dev/networking v0.0.0-20201203234509-4cd0793eed11 h1:sogSEftyYRTNZ3g2Ynmvw8djj9X0RwBNa9GCDDLQMr4= -knative.dev/networking v0.0.0-20201203234509-4cd0793eed11/go.mod h1:vj8h8ODz+HnStJgIgvAY2pyc146SJA1CaB9iKFpSjiM= +knative.dev/networking v0.0.0-20201209014241-22a7e22628fc/go.mod h1:NPlekJSE5w2vw5mcu8zCBdHsiBq9U/waDbFXrEvpw6Q= +knative.dev/networking v0.0.0-20201210013742-d3109cc5f95d h1:KCeZc0rbmJioZvNDnQTxGXJ64OFHq4GO3s94SwN8JyA= +knative.dev/networking v0.0.0-20201210013742-d3109cc5f95d/go.mod h1:s+q5zIi9skLPnC7T3R6W4enZRnT8I/eIwWuys8gGJm4= knative.dev/pkg v0.0.0-20201117221452-0fccc54273ed h1:4LNEFhvD2Ya4WgCD3SC1WGXz81bjEvQgbcpe5XACI3I= knative.dev/pkg v0.0.0-20201117221452-0fccc54273ed/go.mod h1:nxlh3CUvx6WBPr1WKD96AHxFZPD2UKRDo9RUp8ILTyQ= knative.dev/pkg v0.0.0-20201130192436-e5346d90e980 h1:44zakwrFjbivCM/YR+ni70e9u1ELtwA7VF1HSmUcj+g= knative.dev/pkg v0.0.0-20201130192436-e5346d90e980/go.mod h1:wXZqP8MXCxb51yNFlecA13BwG7Hk370SWDFWV4dx4ug= -knative.dev/pkg v0.0.0-20201203005309-e45bbefd1d63/go.mod h1:efRLl6Z597X5r3TTt/I73cQIDDV1He6LMN1y4HQlkHU= -knative.dev/pkg v0.0.0-20201203193109-a536174bdf99/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8= -knative.dev/pkg v0.0.0-20201204013209-b89ac2a63293 h1:6iXRbYUw05l6vnKiUsZSE1HRbsc8hulSs9Y2mTGVMxM= -knative.dev/pkg v0.0.0-20201204013209-b89ac2a63293/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8= +knative.dev/pkg v0.0.0-20201207225040-7e918163fc4f/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8= +knative.dev/pkg v0.0.0-20201209011241-b1ac587fdd80/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8= +knative.dev/pkg v0.0.0-20201209172941-9b9407a76df1/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8= +knative.dev/pkg v0.0.0-20201210014142-0c53297607c6 h1:7fJ52FZ7BLwQf1NtK9SfRm16wdBCdwW5ZY/u3tOa904= +knative.dev/pkg v0.0.0-20201210014142-0c53297607c6/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8= knative.dev/reconciler-test v0.0.0-20201124190335-83a44efcdfef/go.mod h1:YSs1y1rgnjs8w39/drLIOQbWvZUQwqApvd+EizO8UsA= -knative.dev/serving v0.19.1-0.20201204004409-4bbc460995d6 h1:8oq1P5XKceDVdBk9sqIc6IvdRP7xV00CRKMWTo/kAzU= -knative.dev/serving v0.19.1-0.20201204004409-4bbc460995d6/go.mod h1:0V/DzxYUwB2dCUbn9V0BP2csI5r2ULLxQAGGNr6ZxB0= +knative.dev/serving v0.19.1-0.20201210003942-0243c480fb67 h1:rJCN0t5uVqeWyhkPlcDewY0YRf2kqRX1qLc3zzZXNT4= +knative.dev/serving v0.19.1-0.20201210003942-0243c480fb67/go.mod h1:nLguQ38lYYAKtJU9dcK0BE/Dpt/12eqhk9+NKsyNYVg= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/vendor/knative.dev/pkg/leaderelection/context.go b/vendor/knative.dev/pkg/leaderelection/context.go index 17a7a1b1f..d30ecd462 100644 --- a/vendor/knative.dev/pkg/leaderelection/context.go +++ b/vendor/knative.dev/pkg/leaderelection/context.go @@ -41,7 +41,7 @@ func WithDynamicLeaderElectorBuilder(ctx context.Context, kc kubernetes.Interfac b, _, err := NewStatefulSetBucketAndSet(int(cc.Buckets)) if err == nil { logger.Info("Running with StatefulSet leader election") - return withStatefulSetElectorBuilder(ctx, cc, b) + return WithStatefulSetElectorBuilder(ctx, cc, b) } logger.Info("Running with Standard leader election") return WithStandardLeaderElectorBuilder(ctx, kc, cc) @@ -57,10 +57,10 @@ func WithStandardLeaderElectorBuilder(ctx context.Context, kc kubernetes.Interfa }) } -// withStatefulSetElectorBuilder infuses a context with the ability to build +// WithStatefulSetElectorBuilder infuses a context with the ability to build // Electors which are assigned leadership based on the StatefulSet ordinal from // the provided component configuration. -func withStatefulSetElectorBuilder(ctx context.Context, cc ComponentConfig, bkt reconciler.Bucket) context.Context { +func WithStatefulSetElectorBuilder(ctx context.Context, cc ComponentConfig, bkt reconciler.Bucket) context.Context { return context.WithValue(ctx, builderKey{}, &statefulSetBuilder{ lec: cc, bkt: bkt, diff --git a/vendor/knative.dev/pkg/logging/config.go b/vendor/knative.dev/pkg/logging/config.go index 65b50395a..1effe1b35 100644 --- a/vendor/knative.dev/pkg/logging/config.go +++ b/vendor/knative.dev/pkg/logging/config.go @@ -62,9 +62,9 @@ func NewLogger(configJSON string, levelOverride string, opts ...zap.Option) (*za } } - logger, err2 := loggingCfg.Build(append(opts, zapdriver.WrapCore())...) - if err2 != nil { - panic(err2) + logger, err = loggingCfg.Build(append(opts, zapdriver.WrapCore())...) + if err != nil { + panic(err) } slogger := enrichLoggerWithCommitID(logger.Named(fallbackLoggerName)) @@ -74,13 +74,14 @@ func NewLogger(configJSON string, levelOverride string, opts ...zap.Option) (*za func enrichLoggerWithCommitID(logger *zap.Logger) *zap.SugaredLogger { commitID, err := changeset.Get() - if err == nil { - // Enrich logs with GitHub commit ID. - return logger.With(zap.String(logkey.GitHubCommitID, commitID)).Sugar() + if err != nil { + logger.Info("Fetch GitHub commit ID from kodata failed", zap.Error(err)) + return logger.Sugar() } - logger.Info("Fetch GitHub commit ID from kodata failed", zap.Error(err)) - return logger.Sugar() + // Enrich logs with GitHub commit ID. + return logger.With(zap.String(logkey.GitHubCommitID, commitID)).Sugar() + } // NewLoggerFromConfig creates a logger using the provided Config @@ -94,7 +95,7 @@ func NewLoggerFromConfig(config *Config, name string, opts ...zap.Option) (*zap. return logger.Named(name), level } -func newLoggerFromConfig(configJSON string, levelOverride string, opts []zap.Option) (*zap.Logger, zap.AtomicLevel, error) { +func newLoggerFromConfig(configJSON, levelOverride string, opts []zap.Option) (*zap.Logger, zap.AtomicLevel, error) { loggingCfg, err := zapConfigFromJSON(configJSON) if err != nil { return nil, zap.AtomicLevel{}, err @@ -179,7 +180,6 @@ func levelFromString(level string) (*zapcore.Level, error) { // when a config map is updated func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel, levelKey string) func(configMap *corev1.ConfigMap) { - return func(configMap *corev1.ConfigMap) { config, err := NewConfigFromConfigMap(configMap) if err != nil { diff --git a/vendor/knative.dev/pkg/profiling/server.go b/vendor/knative.dev/pkg/profiling/server.go index 9ac2c5f05..9d61c0981 100644 --- a/vendor/knative.dev/pkg/profiling/server.go +++ b/vendor/knative.dev/pkg/profiling/server.go @@ -20,6 +20,7 @@ import ( "fmt" "net/http" "net/http/pprof" + "os" "strconv" "go.uber.org/atomic" @@ -28,7 +29,11 @@ import ( ) const ( - // ProfilingPort specifies the port where profiling data is available when profiling is enabled + // ProfilingPortKey specified the name of an environment variable that + // may be used to override the default profiling port. + ProfilingPortKey = "PROFILING_PORT" + + // ProfilingPort specifies the default port where profiling data is available when profiling is enabled ProfilingPort = 8008 // profilingKey is the name of the key in config-observability config map @@ -100,8 +105,13 @@ func (h *Handler) UpdateFromConfigMap(configMap *corev1.ConfigMap) { // NewServer creates a new http server that exposes profiling data on the default profiling port func NewServer(handler http.Handler) *http.Server { + port := os.Getenv(ProfilingPortKey) + if port == "" { + port = strconv.Itoa(ProfilingPort) + } + return &http.Server{ - Addr: ":" + strconv.Itoa(ProfilingPort), + Addr: ":" + port, Handler: handler, } } diff --git a/vendor/knative.dev/pkg/test/spoof/spoof.go b/vendor/knative.dev/pkg/test/spoof/spoof.go index 9d00bad9e..48ffcffa8 100644 --- a/vendor/knative.dev/pkg/test/spoof/spoof.go +++ b/vendor/knative.dev/pkg/test/spoof/spoof.go @@ -96,7 +96,7 @@ func New( opts ...TransportOption) (*SpoofingClient, error) { endpoint, mapper, err := ResolveEndpoint(ctx, kubeClientset, domain, resolvable, endpointOverride) if err != nil { - return nil, fmt.Errorf("failed get the cluster endpoint: %w", err) + return nil, fmt.Errorf("failed to get the cluster endpoint: %w", err) } // Spoof the hostname at the resolver level diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_lifecycle.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_lifecycle.go index 0f9f9e494..4ab88d439 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_lifecycle.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_lifecycle.go @@ -27,6 +27,7 @@ var domainMappingCondSet = apis.NewLivingConditionSet( DomainMappingConditionDomainClaimed, DomainMappingConditionReferenceResolved, DomainMappingConditionIngressReady, + DomainMappingConditionCertificateProvisioned, ) // GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. @@ -57,6 +58,60 @@ func (dms *DomainMappingStatus) InitializeConditions() { domainMappingCondSet.Manage(dms).InitializeConditions() } +const ( + // AutoTLSNotEnabledMessage is the message which is set on the + // DomainMappingConditionCertificateProvisioned condition when it is set to True + // because AutoTLS was not enabled. + AutoTLSNotEnabledMessage = "autoTLS is not enabled" +) + +// MarkTLSNotEnabled sets DomainMappingConditionCertificateProvisioned to true when +// certificate provisioning was skipped because TLS was not enabled. +func (dms *DomainMappingStatus) MarkTLSNotEnabled(msg string) { + domainMappingCondSet.Manage(dms).MarkTrueWithReason(DomainMappingConditionCertificateProvisioned, + "TLSNotEnabled", msg) +} + +// MarkCertificateReady marks the DomainMappingConditionCertificateProvisioned +// condition to indicate that the Certificate is ready. +func (dms *DomainMappingStatus) MarkCertificateReady(name string) { + domainMappingCondSet.Manage(dms).MarkTrue(DomainMappingConditionCertificateProvisioned) +} + +// MarkCertificateNotReady marks the DomainMappingConditionCertificateProvisioned +// condition to indicate that the Certificate is not ready. +func (dms *DomainMappingStatus) MarkCertificateNotReady(name string) { + domainMappingCondSet.Manage(dms).MarkUnknown(DomainMappingConditionCertificateProvisioned, + "CertificateNotReady", + "Certificate %s is not ready.", name) +} + +// MarkCertificateNotOwned changes the DomainMappingConditionCertificateProvisioned +// status to be false with the reason being that there is an existing +// certificate with the name we wanted to use. +func (dms *DomainMappingStatus) MarkCertificateNotOwned(name string) { + domainMappingCondSet.Manage(dms).MarkFalse(DomainMappingConditionCertificateProvisioned, + "CertificateNotOwned", + "There is an existing certificate %s that we don't own.", name) +} + +// MarkCertificateProvisionFailed marks the +// DomainMappingConditionCertificateProvisioned condition to indicate that the +// Certificate provisioning failed. +func (dms *DomainMappingStatus) MarkCertificateProvisionFailed(name string) { + domainMappingCondSet.Manage(dms).MarkFalse(DomainMappingConditionCertificateProvisioned, + "CertificateProvisionFailed", + "Certificate %s failed to be provisioned.", name) +} + +// MarkHTTPDowngrade sets DomainMappingConditionCertificateProvisioned to true when plain +// HTTP is enabled even when Certificate is not ready. +func (dms *DomainMappingStatus) MarkHTTPDowngrade(name string) { + domainMappingCondSet.Manage(dms).MarkTrueWithReason(DomainMappingConditionCertificateProvisioned, + "HTTPDowngrade", + "Certificate %s is not ready downgrade HTTP.", name) +} + // MarkIngressNotConfigured changes the IngressReady condition to be unknown to reflect // that the Ingress does not yet have a Status. func (dms *DomainMappingStatus) MarkIngressNotConfigured() { diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_types.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_types.go index 8421afdf0..0fa82ca95 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_types.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/domainmapping_types.go @@ -106,6 +106,10 @@ const ( // DomainMappingConditionDomainClaimed reflects that the ClusterDomainClaim // for this DomainMapping exists, and is owned by this DomainMapping. DomainMappingConditionDomainClaimed apis.ConditionType = "DomainClaimed" + + // DomainMappingConditionCertificateProvisioned is set to False when the + // Knative Certificates fail to be provisioned for the DomainMapping. + DomainMappingConditionCertificateProvisioned apis.ConditionType = "CertificateProvisioned" ) // GetStatus retrieves the status of the DomainMapping. Implements the KRShaped interface. diff --git a/vendor/modules.txt b/vendor/modules.txt index 5f2ed5cf5..e16313537 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -845,7 +845,7 @@ k8s.io/kube-openapi/pkg/util/sets k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/trace -# knative.dev/eventing v0.19.1-0.20201202221809-1d3519c16565 +# knative.dev/eventing v0.19.1-0.20201209153742-4f49cc70ea5f ## explicit knative.dev/eventing/pkg/apis/config knative.dev/eventing/pkg/apis/configs @@ -878,12 +878,12 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha2/fake # knative.dev/hack v0.0.0-20201201234937-fddbf732e450 ## explicit knative.dev/hack -# knative.dev/networking v0.0.0-20201203234509-4cd0793eed11 +# knative.dev/networking v0.0.0-20201210013742-d3109cc5f95d ## explicit knative.dev/networking/pkg knative.dev/networking/pkg/apis/networking knative.dev/networking/pkg/apis/networking/v1alpha1 -# knative.dev/pkg v0.0.0-20201204013209-b89ac2a63293 +# knative.dev/pkg v0.0.0-20201210014142-0c53297607c6 ## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -927,7 +927,7 @@ knative.dev/pkg/tracing/config knative.dev/pkg/tracing/propagation knative.dev/pkg/tracing/propagation/tracecontextb3 knative.dev/pkg/tracker -# knative.dev/serving v0.19.1-0.20201204004409-4bbc460995d6 +# knative.dev/serving v0.19.1-0.20201210003942-0243c480fb67 ## explicit knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1