Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Auto-update dependencies #3926

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ require (
k8s.io/apiserver v0.17.6
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451
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
sigs.k8s.io/yaml v1.2.0
)

Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1848,15 +1848,17 @@ 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=
knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE=
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=
Expand Down
9 changes: 4 additions & 5 deletions vendor/knative.dev/pkg/logging/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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.
Expand Down
30 changes: 14 additions & 16 deletions vendor/knative.dev/pkg/metrics/config_observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
package metrics

import (
"fmt"
"os"
"strings"
texttemplate "text/template"

corev1 "k8s.io/api/core/v1"
Expand All @@ -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.
Expand Down Expand Up @@ -72,6 +76,7 @@ type ObservabilityConfig struct {
func defaultConfig() *ObservabilityConfig {
return &ObservabilityConfig{
LoggingURLTemplate: DefaultLogURLTemplate,
RequestLogTemplate: DefaultRequestLogTemplate,
RequestMetricsBackend: defaultRequestMetricsBackend,
}
}
Expand All @@ -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),
Expand All @@ -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 != "" {
Expand All @@ -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"
}
18 changes: 17 additions & 1 deletion vendor/knative.dev/pkg/test/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os"
"os/exec"
"strings"
"time"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -55,7 +56,22 @@ func GetPods(kubeClientset *kubernetes.Clientset, app, namespace string) (*v1.Po
// Cleanup will clean the background process used for port forwarding
func Cleanup(pid int) error {
ps := os.Process{Pid: pid}
return ps.Kill()
if err := ps.Kill(); err != nil {
return err
}

errCh := make(chan error)
go func() {
_, err := ps.Wait()
errCh <- err
}()

select {
case err := <-errCh:
return err
case <-time.After(30 * time.Second):
return fmt.Errorf("timed out waiting for process %d to exit", pid)
}
}

// PortForward sets up local port forward to the pod specified by the "app" label in the given namespace
Expand Down
6 changes: 3 additions & 3 deletions vendor/knative.dev/test-infra/scripts/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ k8s.io/utils/buffer
k8s.io/utils/integer
k8s.io/utils/pointer
k8s.io/utils/trace
# knative.dev/pkg v0.0.0-20200822174146-f0f096d81292
# knative.dev/pkg v0.0.0-20200825005048-1fe808911e69
## explicit
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down Expand Up @@ -1153,7 +1153,7 @@ knative.dev/pkg/webhook/resourcesemantics
knative.dev/pkg/webhook/resourcesemantics/conversion
knative.dev/pkg/webhook/resourcesemantics/defaulting
knative.dev/pkg/webhook/resourcesemantics/validation
# knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03
# knative.dev/test-infra v0.0.0-20200825022047-cb4bb218c5e5
## explicit
knative.dev/test-infra/scripts
# sigs.k8s.io/yaml v1.2.0
Expand Down