From bb62d94135a61557e16d7ec618b0066ac8c08ebf Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Tue, 25 Aug 2020 09:25:49 -0700 Subject: [PATCH] [master] Auto-update dependencies (#317) Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov --- go.mod | 4 +-- go.sum | 6 ++-- vendor/knative.dev/pkg/logging/config.go | 9 +++--- .../pkg/metrics/config_observability.go | 30 +++++++++---------- .../test-infra/scripts/e2e-tests.sh | 6 ++-- vendor/modules.txt | 4 +-- 6 files changed, 29 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 6b5b217d..6a2ed1f4 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,8 @@ require ( k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible k8s.io/code-generator v0.18.6 k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 - knative.dev/pkg v0.0.0-20200822174146-f0f096d81292 - knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03 + knative.dev/pkg v0.0.0-20200825005048-1fe808911e69 + knative.dev/test-infra v0.0.0-20200825022047-cb4bb218c5e5 ) replace ( diff --git a/go.sum b/go.sum index cc4fa020..70bf1ab2 100644 --- a/go.sum +++ b/go.sum @@ -1868,8 +1868,8 @@ knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaC knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY= knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= knative.dev/pkg v0.0.0-20200711004937-22502028e31a/go.mod h1:AqAJV6rYi8IGikDjJ/9ZQd9qKdkXVlesVnVjwx62YB8= -knative.dev/pkg v0.0.0-20200822174146-f0f096d81292 h1:PPGDq/mWT0FhqsmJL9B3rO2I+/wgN48sfGlWyqSx3Bk= -knative.dev/pkg v0.0.0-20200822174146-f0f096d81292/go.mod h1:VK46K0GB3wrFYqDinB5gh79csrWKBtd1GchBYVvtwkY= +knative.dev/pkg v0.0.0-20200825005048-1fe808911e69 h1:brp6D7fuJ0Wyn4gM0Axa9QByFSOvYLsbIQQKNnt3Iv4= +knative.dev/pkg v0.0.0-20200825005048-1fe808911e69/go.mod h1:VK46K0GB3wrFYqDinB5gh79csrWKBtd1GchBYVvtwkY= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU= knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE= @@ -1877,6 +1877,8 @@ knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT knative.dev/test-infra v0.0.0-20200707183444-aed09e56ddc7/go.mod h1:RjYAhXnZqeHw9+B0zsbqSPlae0lCvjekO/nw5ZMpLCs= knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03 h1:tBz8QL+H4chihsWHGDJ8/1xwHiFMDqRWHHid/qlfSoo= knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc= +knative.dev/test-infra v0.0.0-20200825022047-cb4bb218c5e5 h1:iqbpe5rccMW2r1Mu1Prw4gJ9xi7yqahmtxzckTUHBeI= +knative.dev/test-infra v0.0.0-20200825022047-cb4bb218c5e5/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc= 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/pkg/logging/config.go b/vendor/knative.dev/pkg/logging/config.go index 7cc7a3e1..2fbd235d 100644 --- a/vendor/knative.dev/pkg/logging/config.go +++ b/vendor/knative.dev/pkg/logging/config.go @@ -108,7 +108,7 @@ func newLoggerFromConfig(configJSON string, levelOverride string, opts []zap.Opt } logger.Info("Successfully created the logger.") - logger.Sugar().Infof("Logging level set to %v", loggingCfg.Level) + logger.Info("Logging level set to: " + loggingCfg.Level.String()) return logger, loggingCfg.Level, nil } @@ -232,11 +232,10 @@ func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicL // ConfigMapName gets the name of the logging ConfigMap func ConfigMapName() string { - cm := os.Getenv(configMapNameEnv) - if cm == "" { - return "config-logging" + if cm := os.Getenv(configMapNameEnv); cm != "" { + return cm } - return cm + return "config-logging" } // JsonToLoggingConfig converts a json string of a Config. diff --git a/vendor/knative.dev/pkg/metrics/config_observability.go b/vendor/knative.dev/pkg/metrics/config_observability.go index c284a257..12df827d 100644 --- a/vendor/knative.dev/pkg/metrics/config_observability.go +++ b/vendor/knative.dev/pkg/metrics/config_observability.go @@ -17,8 +17,8 @@ limitations under the License. package metrics import ( + "fmt" "os" - "strings" texttemplate "text/template" corev1 "k8s.io/api/core/v1" @@ -28,12 +28,16 @@ import ( const ( // The following is used to set the default log url template DefaultLogURLTemplate = "http://localhost:8001/api/v1/namespaces/knative-monitoring/services/kibana-logging/proxy/app/kibana#/discover?_a=(query:(match:(kubernetes.labels.knative-dev%2FrevisionUID:(query:'${REVISION_UID}',type:phrase))))" + // DefaultRequestLogTemplate is the default format for emitting request logs. + DefaultRequestLogTemplate = `{"httpRequest": {"requestMethod": "{{.Request.Method}}", "requestUrl": "{{js .Request.RequestURI}}", "requestSize": "{{.Request.ContentLength}}", "status": {{.Response.Code}}, "responseSize": "{{.Response.Size}}", "userAgent": "{{js .Request.UserAgent}}", "remoteIp": "{{js .Request.RemoteAddr}}", "serverIp": "{{.Revision.PodIP}}", "referer": "{{js .Request.Referer}}", "latency": "{{.Response.Latency}}s", "protocol": "{{.Request.Proto}}"}, "traceId": "{{index .Request.Header "X-B3-Traceid"}}"}` // The following is used to set the default metrics backend defaultRequestMetricsBackend = "prometheus" // The env var name for config-observability - configMapNameEnv = "CONFIG_OBSERVABILITY_NAME" + configMapNameEnv = "CONFIG_OBSERVABILITY_NAME" + reqLogTemplateKey = "logging.request-log-template" + enableReqLogKey = "logging.enable-request-log" ) // ObservabilityConfig contains the configuration defined in the observability ConfigMap. @@ -72,6 +76,7 @@ type ObservabilityConfig struct { func defaultConfig() *ObservabilityConfig { return &ObservabilityConfig{ LoggingURLTemplate: DefaultLogURLTemplate, + RequestLogTemplate: DefaultRequestLogTemplate, RequestMetricsBackend: defaultRequestMetricsBackend, } } @@ -83,7 +88,8 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab if err := cm.Parse(configMap.Data, cm.AsBool("logging.enable-var-log-collection", &oc.EnableVarLogCollection), cm.AsString("logging.revision-url-template", &oc.LoggingURLTemplate), - cm.AsString("logging.request-log-template", &oc.RequestLogTemplate), + cm.AsString(reqLogTemplateKey, &oc.RequestLogTemplate), + cm.AsBool(enableReqLogKey, &oc.EnableRequestLog), cm.AsBool("logging.enable-probe-request-log", &oc.EnableProbeRequestLog), cm.AsString("metrics.request-metrics-backend-destination", &oc.RequestMetricsBackend), cm.AsBool("profiling.enable", &oc.EnableProfiling), @@ -92,15 +98,8 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab return nil, err } - if raw, ok := configMap.Data["logging.enable-request-log"]; ok { - if strings.EqualFold(raw, "true") && oc.RequestLogTemplate != "" { - oc.EnableRequestLog = true - } - } else if oc.RequestLogTemplate != "" { - // TODO: remove this after 0.17 cuts, this is meant only for smooth transition to the new flag. - // Once 0.17 cuts we should set a proper default value and users will need to set the flag explicitly - // to enable request logging. - oc.EnableRequestLog = true + if oc.RequestLogTemplate == "" && oc.EnableRequestLog { + return nil, fmt.Errorf("%q was set to true, but no %q was specified", enableReqLogKey, reqLogTemplateKey) } if oc.RequestLogTemplate != "" { @@ -115,9 +114,8 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab // ConfigMapName gets the name of the metrics ConfigMap func ConfigMapName() string { - cm := os.Getenv(configMapNameEnv) - if cm == "" { - return "config-observability" + if cm := os.Getenv(configMapNameEnv); cm != "" { + return cm } - return cm + return "config-observability" } diff --git a/vendor/knative.dev/test-infra/scripts/e2e-tests.sh b/vendor/knative.dev/test-infra/scripts/e2e-tests.sh index 590adb1f..e644a5c3 100644 --- a/vendor/knative.dev/test-infra/scripts/e2e-tests.sh +++ b/vendor/knative.dev/test-infra/scripts/e2e-tests.sh @@ -129,15 +129,15 @@ function fail_test() { SKIP_TEARDOWNS=0 SKIP_ISTIO_ADDON=0 +E2E_SCRIPT="" # Parse flags and initialize the test cluster. function initialize() { local run_tests=0 local extra_kubetest2_flags=() local extra_cluster_creation_flags=() - local e2e_script - e2e_script="$(get_canonical_path "$0")" - local e2e_script_command=( "${e2e_script}" "--run-tests" ) + E2E_SCRIPT="$(get_canonical_path "$0")" + local e2e_script_command=( "${E2E_SCRIPT}" "--run-tests" ) cd "${REPO_ROOT_DIR}" while [[ $# -ne 0 ]]; do diff --git a/vendor/modules.txt b/vendor/modules.txt index b19b199e..8a8faee7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -752,7 +752,7 @@ k8s.io/kube-openapi/pkg/util/sets k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20200822174146-f0f096d81292 +# knative.dev/pkg v0.0.0-20200825005048-1fe808911e69 ## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck/ducktypes @@ -776,7 +776,7 @@ knative.dev/pkg/metrics/metricskey knative.dev/pkg/network knative.dev/pkg/reconciler knative.dev/pkg/system -# knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03 +# knative.dev/test-infra v0.0.0-20200825022047-cb4bb218c5e5 ## explicit knative.dev/test-infra/scripts knative.dev/test-infra/tools/dep-collector