From 4a8e88e2957438be6e2acce7b9d593193de52333 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Wed, 1 Apr 2020 07:11:18 -0700 Subject: [PATCH] [master] Auto-update dependencies (#240) Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov --- Gopkg.lock | 8 +-- vendor/knative.dev/pkg/Gopkg.lock | 4 +- .../knative.dev/pkg/leaderelection/config.go | 50 ++++++++++--------- .../test-infra/scripts/e2e-tests.sh | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index afff1ec0..88480fde 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -966,7 +966,7 @@ [[projects]] branch = "master" - digest = "1:18f4c5453f19fef868e3da19f815840517c4bfa28e15fb2cccd504a9b96ce68d" + digest = "1:1cfbe38d639ea8c4aeb9f1b0b98ac80b0004ef612f0b48eb572ba6bb23bdc003" name = "knative.dev/pkg" packages = [ "apis", @@ -986,18 +986,18 @@ "reconciler", ] pruneopts = "T" - revision = "e2ee5bed78d74604ed87dcb761a6f6e10a2e355c" + revision = "94b2b6aaaf4b81c3b26b269bd477518094aa31a5" [[projects]] branch = "master" - digest = "1:41da78d06d64a1eb47a1d3f8209d33af386fa8f22d1b04b25825ae5cd187be1d" + digest = "1:5da0f15efcd7dafa6296be9cd4a630fcb5253cf202e54638299221ae7df419ab" name = "knative.dev/test-infra" packages = [ "scripts", "tools/dep-collector", ] pruneopts = "UT" - revision = "030e4e29cb8ba9502a06b667b1450f6a725371b1" + revision = "5bdfbd623938f0cc4a260bf06c503bbb0a76d6f9" [[projects]] digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" diff --git a/vendor/knative.dev/pkg/Gopkg.lock b/vendor/knative.dev/pkg/Gopkg.lock index ca503115..c470f55c 100644 --- a/vendor/knative.dev/pkg/Gopkg.lock +++ b/vendor/knative.dev/pkg/Gopkg.lock @@ -1362,14 +1362,14 @@ [[projects]] branch = "master" - digest = "1:2987a1db00b983af9e5d5281639a754fb6449eef01e6a375894829eaec17cb2a" + digest = "1:41da78d06d64a1eb47a1d3f8209d33af386fa8f22d1b04b25825ae5cd187be1d" name = "knative.dev/test-infra" packages = [ "scripts", "tools/dep-collector", ] pruneopts = "UT" - revision = "9a501343b4dafbac1a1a5dcfe2cb46975a78abb5" + revision = "030e4e29cb8ba9502a06b667b1450f6a725371b1" [[projects]] digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" diff --git a/vendor/knative.dev/pkg/leaderelection/config.go b/vendor/knative.dev/pkg/leaderelection/config.go index 1e547057..4bba700a 100644 --- a/vendor/knative.dev/pkg/leaderelection/config.go +++ b/vendor/knative.dev/pkg/leaderelection/config.go @@ -37,32 +37,35 @@ var ( // NewConfigFromMap returns a Config for the given map, or an error. func NewConfigFromMap(data map[string]string) (*Config, error) { - config := &Config{ - EnabledComponents: sets.NewString(), - } + config := defaultConfig() - if resourceLock := data["resourceLock"]; !validResourceLocks.Has(resourceLock) { - return nil, fmt.Errorf(`resourceLock: invalid value %q: valid values are "leases","configmaps","endpoints"`, resourceLock) - } else { + if resourceLock, ok := data["resourceLock"]; ok { + if !validResourceLocks.Has(resourceLock) { + return nil, fmt.Errorf(`resourceLock: invalid value %q: valid values are "leases","configmaps","endpoints"`, resourceLock) + } config.ResourceLock = resourceLock } - if leaseDuration, err := time.ParseDuration(data["leaseDuration"]); err != nil { - return nil, fmt.Errorf("leaseDuration: invalid duration: %q", data["leaseDuration"]) - } else { - config.LeaseDuration = leaseDuration - } - - if renewDeadline, err := time.ParseDuration(data["renewDeadline"]); err != nil { - return nil, fmt.Errorf("renewDeadline: invalid duration: %q", data["renewDeadline"]) - } else { - config.RenewDeadline = renewDeadline - } - - if retryPeriod, err := time.ParseDuration(data["retryPeriod"]); err != nil { - return nil, fmt.Errorf("retryPeriod: invalid duration: %q", data["retryPeriod"]) - } else { - config.RetryPeriod = retryPeriod + for _, d := range []struct { + key string + val *time.Duration + }{{ + "leaseDuration", + &config.LeaseDuration, + }, { + "renewDeadline", + &config.RenewDeadline, + }, { + "retryPeriod", + &config.RetryPeriod, + }} { + if v, ok := data[d.key]; ok { + dur, err := time.ParseDuration(v) + if err != nil { + return nil, fmt.Errorf("%s: invalid duration: %q", d.key, v) + } + *d.val = dur + } } // enabledComponents are not validated here, because they are dependent on @@ -82,7 +85,6 @@ func NewConfigFromConfigMap(configMap *corev1.ConfigMap) (*Config, error) { config := defaultConfig() return config, nil } - return NewConfigFromMap(configMap.Data) } @@ -154,5 +156,5 @@ func UniqueID() (string, error) { return "", err } - return (id + "_" + string(uuid.NewUUID())), nil + return id + "_" + string(uuid.NewUUID()), nil } diff --git a/vendor/knative.dev/test-infra/scripts/e2e-tests.sh b/vendor/knative.dev/test-infra/scripts/e2e-tests.sh index a78920dc..917f5ebf 100755 --- a/vendor/knative.dev/test-infra/scripts/e2e-tests.sh +++ b/vendor/knative.dev/test-infra/scripts/e2e-tests.sh @@ -93,7 +93,7 @@ function dump_cluster_state() { echo "*** Start of information dump ***" echo "***************************************" - local output="${ARTIFACTS}/k8s.dump.txt" + local output="${ARTIFACTS}/k8s.dump-$(basename ${E2E_SCRIPT}).txt" echo ">>> The dump is located at ${output}" for crd in $(kubectl api-resources --verbs=list -o name | sort); do