From 91d1932616a79470d80f981fcb39f62a9115a8ee Mon Sep 17 00:00:00 2001 From: knative-automation Date: Tue, 9 Nov 2021 02:08:43 -0800 Subject: [PATCH] upgrade to latest dependencies (#2345) bumping knative.dev/hack 29f86c2...96aac1c: > 96aac1c Add wait_until_object_exists library function (# 96) Signed-off-by: Knative Automation --- go.mod | 2 +- go.sum | 4 ++-- vendor/knative.dev/hack/library.sh | 26 ++++++++++++++++++++++++++ vendor/modules.txt | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 31dd1316e7..d84744b774 100644 --- a/go.mod +++ b/go.mod @@ -56,6 +56,6 @@ require ( k8s.io/code-generator v0.21.4 k8s.io/gengo v0.0.0-20210915205010-39e73c8a59cd k8s.io/klog v1.0.0 - knative.dev/hack v0.0.0-20211105231158-29f86c2653b5 + knative.dev/hack v0.0.0-20211108170701-96aac1c30be3 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 571b50fc9d..00b21a18d1 100644 --- a/go.sum +++ b/go.sum @@ -1136,8 +1136,8 @@ k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7Br k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/hack v0.0.0-20211105231158-29f86c2653b5 h1:9scsqLnVcUh6wnMY0vYo8MGBy1NAkjpjoukyhhkChU4= -knative.dev/hack v0.0.0-20211105231158-29f86c2653b5/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= +knative.dev/hack v0.0.0-20211108170701-96aac1c30be3 h1:oSvRgnKoU308k7aXbPV3iL5Zh5kBGM2Ptar4hyeda+A= +knative.dev/hack v0.0.0-20211108170701-96aac1c30be3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/knative.dev/hack/library.sh b/vendor/knative.dev/hack/library.sh index 4af73bec50..17ce662ed0 100644 --- a/vendor/knative.dev/hack/library.sh +++ b/vendor/knative.dev/hack/library.sh @@ -186,6 +186,32 @@ function wait_until_object_does_not_exist() { return 1 } +# Waits until the given object exists. +# Parameters: $1 - the kind of the object. +# $2 - object's name. +# $3 - namespace (optional). +function wait_until_object_exists() { + local KUBECTL_ARGS="get $1 $2" + local DESCRIPTION="$1 $2" + + if [[ -n $3 ]]; then + KUBECTL_ARGS="get -n $3 $1 $2" + DESCRIPTION="$1 $3/$2" + fi + echo -n "Waiting until ${DESCRIPTION} exists" + for i in {1..150}; do # timeout after 5 minutes + if kubectl ${KUBECTL_ARGS} > /dev/null 2>&1; then + echo -e "\n${DESCRIPTION} exists" + return 0 + fi + echo -n "." + sleep 2 + done + echo -e "\n\nERROR: timeout waiting for ${DESCRIPTION} to exist" + kubectl ${KUBECTL_ARGS} + return 1 +} + # Waits until all pods are running in the given namespace. # This function handles some edge cases that `kubectl wait` does not support, # and it provides nice debug info on the state of the pod if it failed, diff --git a/vendor/modules.txt b/vendor/modules.txt index 8a9d4be706..5cf646438e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1019,7 +1019,7 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/hack v0.0.0-20211105231158-29f86c2653b5 +# knative.dev/hack v0.0.0-20211108170701-96aac1c30be3 ## explicit knative.dev/hack # sigs.k8s.io/structured-merge-diff/v4 v4.1.2