From 61deb41400a870e1cad69f0833429bebbd3b14ff Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Wed, 14 Aug 2024 23:25:24 -0400 Subject: [PATCH 01/20] upgrade controller-runtime version --- go.mod | 75 ++++++++++++++------------- go.sum | 161 +++++++++++++++++++++++++++++++-------------------------- 2 files changed, 128 insertions(+), 108 deletions(-) diff --git a/go.mod b/go.mod index 85d847d7a..d071403da 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/codeready-toolchain/toolchain-e2e require ( - github.com/codeready-toolchain/api v0.0.0-20240530120602-c11598ccffb7 + github.com/codeready-toolchain/api v0.0.0-20240802163003-cce070815e69 github.com/codeready-toolchain/toolchain-common v0.0.0-20240530121312-98aad712838f github.com/davecgh/go-spew v1.1.1 - github.com/fatih/color v1.12.0 + github.com/fatih/color v1.15.0 github.com/ghodss/yaml v1.0.0 github.com/gofrs/uuid v3.3.0+incompatible github.com/google/go-cmp v0.5.9 @@ -14,21 +14,21 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/manifoldco/promptui v0.9.0 // using latest commit from 'github.com/openshift/api branch release-4.12' - github.com/openshift/api v0.0.0-20230213134911-7ba313770556 + github.com/openshift/api v0.0.0-20240304080513-3e8192a10b13 github.com/operator-framework/api v0.13.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 - github.com/prometheus/client_model v0.2.0 - github.com/prometheus/common v0.32.1 + github.com/prometheus/client_golang v1.15.1 + github.com/prometheus/client_model v0.4.0 + github.com/prometheus/common v0.42.0 github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf - github.com/spf13/cobra v1.4.0 + github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.9.0 - k8s.io/api v0.25.0 - k8s.io/apimachinery v0.25.0 - k8s.io/client-go v0.25.0 + k8s.io/api v0.27.2 + k8s.io/apimachinery v0.27.2 + k8s.io/client-go v0.27.2 k8s.io/kubectl v0.25.0 k8s.io/metrics v0.25.0 - sigs.k8s.io/controller-runtime v0.13.0 + sigs.k8s.io/controller-runtime v0.15.0 ) require github.com/google/uuid v1.6.0 @@ -39,38 +39,36 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Masterminds/sprig/v3 v3.2.2 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/emicklei/go-restful/v3 v3.8.0 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-github/v52 v52.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/gofuzz v1.1.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gosuri/uilive v0.0.4 // indirect github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/huandu/xstrings v1.3.1 // indirect github.com/imdario/mergo v0.3.12 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect @@ -79,11 +77,11 @@ require ( github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/jwx v1.2.29 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-runewidth v0.0.7 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/migueleliasweb/go-github-mock v0.0.18 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect @@ -92,9 +90,9 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/openshift/library-go v0.0.0-20230301092340-c13b89190a26 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/crypto v0.21.0 // indirect @@ -104,21 +102,26 @@ require ( golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/h2non/gock.v1 v1.0.14 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.0 // indirect - k8s.io/klog/v2 v2.70.1 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect - k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + k8s.io/apiextensions-apiserver v0.27.2 // indirect + k8s.io/component-base v0.27.2 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) go 1.20 + +replace ( + github.com/codeready-toolchain/api v0.0.0-20240530120602-c11598ccffb7 => github.com/ranakan19/api v0.0.0-20240802215814-2146811fbdf7 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240530121312-98aad712838f => github.com/ranakan19/toolchain-common v0.0.0-20240802220420-631693e0140d +) diff --git a/go.sum b/go.sum index 0f60b233f..3b2bac1cd 100644 --- a/go.sum +++ b/go.sum @@ -67,9 +67,7 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -102,8 +100,8 @@ github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6 github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -123,10 +121,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/api v0.0.0-20240530120602-c11598ccffb7 h1:o5JLcHCVS1BlZevw2mh1mH+iKwn9fLUrT1Ek8NFjvPY= -github.com/codeready-toolchain/api v0.0.0-20240530120602-c11598ccffb7/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240530121312-98aad712838f h1:2qfRfyh7wfEnnfxrUtQeQrvhzWlkBCN0B/UXv1YUMiA= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240530121312-98aad712838f/go.mod h1:cyHrUfvBYEtsf+FbqQYmR9y0AQi9QAVtM3SUWLA5bd4= +github.com/codeready-toolchain/api v0.0.0-20240802163003-cce070815e69 h1:e6up2k4O7QdG6hu0iOwNGap60b932N0JXlweDmmvCAQ= +github.com/codeready-toolchain/api v0.0.0-20240802163003-cce070815e69/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -139,7 +135,7 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -159,8 +155,8 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -180,16 +176,17 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -211,28 +208,32 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/gobuffalo/flect v0.2.3/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -280,8 +281,9 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -310,8 +312,9 @@ github.com/google/go-github/v52 v52.0.0/go.mod h1:WJV6VEEUPuMo5pXqqa2ZCZEdbQqua4 github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -326,6 +329,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -393,8 +397,9 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= @@ -423,6 +428,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -452,28 +459,33 @@ github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPK github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/migueleliasweb/go-github-mock v0.0.18 h1:0lWt9MYmZQGnQE2rFtjlft/YtD6hzxuN6JJRFpujzEI= github.com/migueleliasweb/go-github-mock v0.0.18/go.mod h1:CcgXcbMoRnf3rRVHqGssuBquZDIcaplxL2W6G+xs7kM= @@ -512,11 +524,9 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -529,7 +539,7 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -537,10 +547,10 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/openshift/api v0.0.0-20230213134911-7ba313770556 h1:7W2fOhJicyEff24VaF7ASNzPtYvr+iSCVft4SIBAzaE= -github.com/openshift/api v0.0.0-20230213134911-7ba313770556/go.mod h1:aQ6LDasvHMvHZXqLHnX2GRmnfTWCF/iIwz8EMTTIE9A= +github.com/openshift/api v0.0.0-20240304080513-3e8192a10b13 h1:KNaEkpcVi4XGb86cA6FMJ8Wia7KWAembCUv8blIksTY= +github.com/openshift/api v0.0.0-20240304080513-3e8192a10b13/go.mod h1:yimSGmjsI+XF1mr+AKBs2//fSXIOhhetHGbMlBEfXbs= github.com/openshift/library-go v0.0.0-20230301092340-c13b89190a26 h1:vXYT3dX03Fm5FCX1284aTGoa5qBZFp3zMnIVaV9WOdg= github.com/openshift/library-go v0.0.0-20230301092340-c13b89190a26/go.mod h1:KPBAXGaq7pPmA+1wUVtKr5Axg3R68IomWDkzaOxIhxM= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -564,34 +574,38 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/ranakan19/toolchain-common v0.0.0-20240802220420-631693e0140d h1:4iVzPpadHeYMab0IoHQDP/i/eDyszHIFLBeT8B7VmVc= +github.com/ranakan19/toolchain-common v0.0.0-20240802220420-631693e0140d/go.mod h1:dY9mptLCQXmWrDayrHhs6Ozrh0INQ/5Lqbcgywq2uy4= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf h1:fsZiv9XuFo8G7IyzFWjG02vqzJG7kSqFvD1Wiq3V/o8= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf/go.mod h1:FfTyeSCu+e2VLgeMh/1RFG8TSkVjKRPEyR6EmDt0RIw= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -606,8 +620,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -624,8 +639,8 @@ github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -651,6 +666,7 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -706,14 +722,14 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -817,7 +833,6 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -839,7 +854,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -928,10 +942,11 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1033,12 +1048,14 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= +gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc= +gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1158,8 +1175,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1176,7 +1194,6 @@ gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.0 h1:nLzhkFyl5bkblqYBoiWJUt5JkWOzmiaBtCxdJAqJd3U= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1205,29 +1222,29 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.1/go.mod h1:bh13rkTp3F1XEaLGykbyRD2QaTTzPm0e/BMd8ptFONY= -k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= -k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= +k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo= +k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apiextensions-apiserver v0.22.1/go.mod h1:HeGmorjtRmRLE+Q8dJu6AYRoZccvCMsghwS8XTUYb2c= -k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY= -k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E= +k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo= +k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= -k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= +k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg= +k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.22.1/go.mod h1:2mcM6dzSt+XndzVQJX21Gx0/Klo7Aen7i0Ai6tIa400= k8s.io/cli-runtime v0.22.1/go.mod h1:YqwGrlXeEk15Yn3em2xzr435UGwbrCw5x+COQoTYfoo= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.1/go.mod h1:BquC5A4UOo4qVDUtoc04/+Nxp1MeHcVc1HJm1KmG8kk= -k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= -k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= +k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= +k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= k8s.io/code-generator v0.22.1/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= k8s.io/component-base v0.22.1/go.mod h1:0D+Bl8rrnsPN9v0dyYvkqFfBeAd4u7n77ze+p8CMiPo= -k8s.io/component-base v0.25.0 h1:haVKlLkPCFZhkcqB6WCvpVxftrg6+FK5x1ZuaIDaQ5Y= -k8s.io/component-base v0.25.0/go.mod h1:F2Sumv9CnbBlqrpdf7rKZTmmd2meJq0HizeyY/yAFxk= +k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo= +k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo= k8s.io/component-helpers v0.22.1/go.mod h1:QvBcDbX+qU5I2tMZABBF5fRwAlQwiv771IGBHK9WYh4= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -1235,12 +1252,12 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= -k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kubectl v0.22.1/go.mod h1:mjAOgEbMNMtZWxnfM6jd+nPjPsaoLqO5xanc78WcSbw= k8s.io/kubectl v0.25.0 h1:/Wn1cFqo8ik3iee1EvpxYre3bkWsGLXzLQI6uCCAkQc= k8s.io/kubectl v0.25.0/go.mod h1:n16ULWsOl2jmQpzt2o7Dud1t4o0+Y186ICb4O+GwKAU= @@ -1250,19 +1267,19 @@ k8s.io/metrics v0.25.0/go.mod h1:HZZrbhuRX+fsDcRc3u59o2FbrKhqD67IGnoFECNmovc= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= 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= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/controller-runtime v0.10.0/go.mod h1:GCdh6kqV6IY4LK0JLwX0Zm6g233RtVGdb/f0+KSfprg= -sigs.k8s.io/controller-runtime v0.13.0 h1:iqa5RNciy7ADWnIc8QxCbOX5FEKVR3uxVxKHRMc2WIQ= -sigs.k8s.io/controller-runtime v0.13.0/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU= +sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk= sigs.k8s.io/controller-tools v0.6.2/go.mod h1:oaeGpjXn6+ZSEIQkUe/+3I40PNiDYp9aeawbt3xTgJ8= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqwEJqCKN9sSR0xSs= sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= From 9541f3ab39641efb4eeae4fa138dfa4933fbf7f4 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Tue, 27 Aug 2024 20:09:15 -0400 Subject: [PATCH 02/20] update mod --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 2cbf540e5..20508c6db 100644 --- a/go.mod +++ b/go.mod @@ -122,6 +122,6 @@ require ( go 1.20 replace ( - github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 => github.com/ranakan19/api v0.0.0-20240821174759-30e09d17170b - github.com/codeready-toolchain/toolchain-common v0.0.0-20240816011540-2184e6268b4a => github.com/ranakan19/toolchain-common v0.0.0-20240815204418-d488ba44374c + github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 => github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b + github.com/codeready-toolchain/toolchain-common v0.0.0-20240816011540-2184e6268b4a => github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 ) diff --git a/go.sum b/go.sum index 45b7c8e68..efb86a5bc 100644 --- a/go.sum +++ b/go.sum @@ -596,10 +596,10 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/ranakan19/api v0.0.0-20240821174759-30e09d17170b h1:97x0qSeZ8Z03mW//73JrHC1l1lHQ4MNdi4RZBUu5zaQ= -github.com/ranakan19/api v0.0.0-20240821174759-30e09d17170b/go.mod h1:blXQx8ZLooVqZ589EBtaAOmh13qLzGpDEnCBgjh9bv8= -github.com/ranakan19/toolchain-common v0.0.0-20240815204418-d488ba44374c h1:lCy8iQYLG2MZdBKOHkXqmJwJVmrm0eZvHjRlKMHRkIk= -github.com/ranakan19/toolchain-common v0.0.0-20240815204418-d488ba44374c/go.mod h1:dY9mptLCQXmWrDayrHhs6Ozrh0INQ/5Lqbcgywq2uy4= +github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b h1:CPe3x10IApZ7LeVmA2if3W5PXQiE4T6ieXZZoXKCUt8= +github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b/go.mod h1:blXQx8ZLooVqZ589EBtaAOmh13qLzGpDEnCBgjh9bv8= +github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 h1:7SUE4LHw/bjgpelzQFszo+JTGI+gJvyNYaDNjruEL98= +github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1/go.mod h1:OpJcfLA+KxeVV1tFR1AoLX2EG4wSFxaARP1jvnAOnwo= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf h1:fsZiv9XuFo8G7IyzFWjG02vqzJG7kSqFvD1Wiq3V/o8= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf/go.mod h1:FfTyeSCu+e2VLgeMh/1RFG8TSkVjKRPEyR6EmDt0RIw= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= From 4f41fbcae091bfb4e136495cf84f9b8e32d98716 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Wed, 28 Aug 2024 20:22:01 -0400 Subject: [PATCH 03/20] remove deprecated poll and waitforError --- setup/idlers/update_idler.go | 4 +- setup/metrics/gather.go | 3 +- setup/templates/template.go | 2 +- setup/users/create_users.go | 4 +- setup/wait/wait.go | 8 +- test/e2e/parallel/proxy_test.go | 8 +- .../e2e/parallel/registration_service_test.go | 2 +- testsupport/cleanup/clean.go | 4 +- testsupport/wait/awaitility.go | 46 ++-- testsupport/wait/host.go | 166 +++++++------- testsupport/wait/member.go | 204 +++++++++--------- 11 files changed, 226 insertions(+), 225 deletions(-) diff --git a/setup/idlers/update_idler.go b/setup/idlers/update_idler.go index f08f13a80..6b0ebf9e0 100644 --- a/setup/idlers/update_idler.go +++ b/setup/idlers/update_idler.go @@ -33,8 +33,8 @@ func UpdateTimeout(cl client.Client, username string, timeout time.Duration) err func getIdler(cl client.Client, name string) (*toolchainv1alpha1.Idler, error) { idler := &toolchainv1alpha1.Idler{} - err := k8swait.Poll(cfg.DefaultRetryInterval, cfg.DefaultTimeout, func() (bool, error) { - err := cl.Get(context.TODO(), types.NamespacedName{ + err := k8swait.PollUntilContextTimeout(context.TODO(), cfg.DefaultRetryInterval, cfg.DefaultTimeout, true, func(ctx context.Context) (bool, error) { + err := cl.Get(ctx, types.NamespacedName{ Name: name, }, idler) if errors.IsNotFound(err) { diff --git a/setup/metrics/gather.go b/setup/metrics/gather.go index 043797202..bd7e687b1 100644 --- a/setup/metrics/gather.go +++ b/setup/metrics/gather.go @@ -1,6 +1,7 @@ package metrics import ( + "context" "fmt" "math" "strings" @@ -104,7 +105,7 @@ func (g *Gatherer) StartGathering() chan struct{} { for _, q := range g.mqueries { var metricsErr error // added retry mechanism since temporary metrics errors have been observed, poll until the query returns a non-error result or the poll times out - err := k8sutil.Poll(cfg.DefaultRetryInterval, cfg.DefaultTimeout, func() (bool, error) { + err := k8sutil.PollUntilContextTimeout(context.TODO(), cfg.DefaultRetryInterval, cfg.DefaultTimeout, true, func(ctx context.Context) (bool, error) { metricsErr = g.sample(q) return metricsErr == nil, nil }) diff --git a/setup/templates/template.go b/setup/templates/template.go index e33f05d11..e1ef622c8 100644 --- a/setup/templates/template.go +++ b/setup/templates/template.go @@ -140,7 +140,7 @@ func applyObject(ctx context.Context, applycl *applyclientlib.ApplyClient, obj r // retry the apply in case it fails due to errors like the following: // unable to create resource of kind: Deployment, version: v1: Operation cannot be fulfilled on clusterresourcequotas.quota.openshift.io "for-zippy-1882-deployments": the object has been modified; please apply your changes to the latest version and try again - if err := k8swait.Poll(cfg.DefaultRetryInterval, 30*time.Second, func() (bool, error) { + if err := k8swait.PollUntilContextTimeout(context.TODO(), cfg.DefaultRetryInterval, 30*time.Second, true, func(context context.Context) (bool, error) { if _, applyErr := applycl.ApplyObject(ctx, obj); applyErr != nil { return false, applyErr } diff --git a/setup/users/create_users.go b/setup/users/create_users.go index 78f93fddb..ef68c76aa 100644 --- a/setup/users/create_users.go +++ b/setup/users/create_users.go @@ -51,9 +51,9 @@ func getMemberClusterName(cl client.Client, hostOperatorNamespace, memberOperato return memberClusterName, nil } var memberCluster toolchainv1alpha1.ToolchainCluster - err := k8swait.Poll(configuration.DefaultRetryInterval, configuration.DefaultTimeout, func() (bool, error) { + err := k8swait.PollUntilContextTimeout(context.TODO(), configuration.DefaultRetryInterval, configuration.DefaultTimeout, true, func(ctx context.Context) (bool, error) { clusters := &toolchainv1alpha1.ToolchainClusterList{} - if err := cl.List(context.TODO(), clusters, client.InNamespace(hostOperatorNamespace), client.MatchingLabels{ + if err := cl.List(ctx, clusters, client.InNamespace(hostOperatorNamespace), client.MatchingLabels{ "namespace": memberOperatorNamespace, }); err != nil { return false, err diff --git a/setup/wait/wait.go b/setup/wait/wait.go index 58d3fabd1..72342a8ed 100644 --- a/setup/wait/wait.go +++ b/setup/wait/wait.go @@ -27,8 +27,8 @@ func ForSpace(cl client.Client, space string) error { }, } - if err := k8swait.Poll(configuration.DefaultRetryInterval, configuration.DefaultTimeout, func() (bool, error) { - err := cl.Get(context.TODO(), types.NamespacedName{ + if err := k8swait.PollUntilContextTimeout(context.TODO(), configuration.DefaultRetryInterval, configuration.DefaultTimeout, true, func(ctx context.Context) (bool, error) { + err := cl.Get(ctx, types.NamespacedName{ Name: space, Namespace: configuration.HostOperatorNamespace, }, sp) @@ -64,7 +64,7 @@ func HasSubscriptionWithCriteria(cl client.Client, name, namespace string, crite } func ForSubscriptionWithCriteria(cl client.Client, name, namespace string, timeout time.Duration, criteria ...subCriteria) error { - if err := k8swait.Poll(configuration.DefaultRetryInterval, timeout, func() (bool, error) { + if err := k8swait.PollUntilContextTimeout(context.TODO(), configuration.DefaultRetryInterval, timeout, true, func(ctx context.Context) (bool, error) { return HasSubscriptionWithCriteria(cl, name, namespace, criteria...) }); err != nil { return errors.Wrapf(err, "could not find a Subscription with name '%s' in namespace '%s' that meets the expected criteria", name, namespace) @@ -90,7 +90,7 @@ func HasCSVWithCriteria(cl client.Client, name, namespace string, criteria ...cs } func ForCSVWithCriteria(cl client.Client, name, namespace string, timeout time.Duration, criteria ...csvCriteria) error { - if err := k8swait.Poll(configuration.DefaultRetryInterval, timeout, func() (bool, error) { + if err := k8swait.PollUntilContextTimeout(context.TODO(), configuration.DefaultRetryInterval, timeout, true, func(ctx context.Context) (bool, error) { return HasCSVWithCriteria(cl, name, namespace, criteria...) }); err != nil { return errors.Wrapf(err, "could not find a CSV with name '%s' in namespace '%s' that meets the expected criteria", name, namespace) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index fb113d405..11e105f60 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -114,8 +114,8 @@ func (u *proxyUser) getWorkspace(t *testing.T, hostAwait *wait.HostAwaitility, w workspace := &toolchainv1alpha1.Workspace{} var cause error // only wait up to 5 seconds because in some test cases the workspace is not expected to be found - _ = kubewait.Poll(wait.DefaultRetryInterval, 5*time.Second, func() (bool, error) { - cause = proxyCl.Get(context.TODO(), types.NamespacedName{Name: workspaceName}, workspace) + _ = kubewait.PollUntilContextTimeout(context.TODO(), wait.DefaultRetryInterval, 5*time.Second, true, func(ctx context.Context) (bool, error) { + cause = proxyCl.Get(ctx, types.NamespacedName{Name: workspaceName}, workspace) return cause == nil, nil }) @@ -1199,7 +1199,7 @@ func (w *wsWatcher) receiveHandler() { func (w *wsWatcher) WaitForApplication(expectedAppName string) (*appstudiov1.Application, error) { var foundApp *appstudiov1.Application - err := kubewait.Poll(wait.DefaultRetryInterval, wait.DefaultTimeout, func() (bool, error) { + err := kubewait.PollUntilContextTimeout(context.TODO(), wait.DefaultRetryInterval, wait.DefaultTimeout, true, func(ctx context.Context) (bool, error) { defer w.mu.RUnlock() w.mu.RLock() foundApp = w.receivedApps[expectedAppName] @@ -1209,7 +1209,7 @@ func (w *wsWatcher) WaitForApplication(expectedAppName string) (*appstudiov1.App } func (w *wsWatcher) WaitForApplicationDeletion(expectedAppName string) error { - err := kubewait.PollImmediate(wait.DefaultRetryInterval, wait.DefaultTimeout, func() (bool, error) { + err := kubewait.PollUntilContextTimeout(context.TODO(), wait.DefaultRetryInterval, wait.DefaultTimeout, true, func(ctx context.Context) (bool, error) { defer w.mu.RUnlock() w.mu.RLock() _, present := w.receivedApps[expectedAppName] diff --git a/test/e2e/parallel/registration_service_test.go b/test/e2e/parallel/registration_service_test.go index 653f331d6..9eced9a59 100644 --- a/test/e2e/parallel/registration_service_test.go +++ b/test/e2e/parallel/registration_service_test.go @@ -1024,7 +1024,7 @@ func assertRHODSClusterURL(t *testing.T, memberAwait *wait.MemberAwaitility, res func waitForUserSignupReadyInRegistrationService(t *testing.T, registrationServiceURL, name, bearerToken string) map[string]interface{} { t.Logf("waiting and verifying that UserSignup '%s' is ready according to registration service", name) var mp, mpStatus map[string]interface{} - err := k8swait.Poll(time.Second, time.Second*60, func() (done bool, err error) { + err := k8swait.PollUntilContextTimeout(context.TODO(), time.Second, time.Second*60, true, func(ctx context.Context) (done bool, err error) { mp, mpStatus = ParseSignupResponse(t, NewHTTPRequest(t).InvokeEndpoint("GET", registrationServiceURL+"/api/v1/signup", bearerToken, "", http.StatusOK).UnmarshalMap()) // check if `ready` field is set if _, ok := mpStatus["ready"]; !ok { diff --git a/testsupport/cleanup/clean.go b/testsupport/cleanup/clean.go index 6c0d73107..a25352182 100644 --- a/testsupport/cleanup/clean.go +++ b/testsupport/cleanup/clean.go @@ -129,8 +129,8 @@ func (c *cleanTask) cleanObject() { // wait until deletion is done c.t.Logf("waiting until %s: %s is completely deleted", kind, objToClean.GetName()) - err := wait.Poll(defaultRetryInterval, defaultTimeout, func() (done bool, err error) { - if err := c.client.Get(context.TODO(), test.NamespacedName(objToClean.GetNamespace(), objToClean.GetName()), objToClean); err != nil { + err := wait.PollUntilContextTimeout(context.TODO(), defaultRetryInterval, defaultTimeout, true, func(ctx context.Context) (done bool, err error) { + if err := c.client.Get(ctx, test.NamespacedName(objToClean.GetNamespace(), objToClean.GetName()), objToClean); err != nil { if errors.IsNotFound(err) { // if the object was UserSignup, then let's check that the MUR is deleted as well if murDeleted, err := c.verifyMurDeleted(isUserSignup, userSignup, false); !murDeleted || err != nil { diff --git a/testsupport/wait/awaitility.go b/testsupport/wait/awaitility.go index f69debc37..5bb073a46 100644 --- a/testsupport/wait/awaitility.go +++ b/testsupport/wait/awaitility.go @@ -132,10 +132,10 @@ func (a *Awaitility) baselineKey(t *testing.T, name string, labelAndValues ...st func (a *Awaitility) WaitForService(t *testing.T, name string) (corev1.Service, error) { t.Logf("waiting for Service '%s' in namespace '%s'", name, a.Namespace) var metricsSvc *corev1.Service - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { metricsSvc = &corev1.Service{} // retrieve the metrics service from the namespace - err = a.Client.Get(context.TODO(), + err = a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -158,7 +158,7 @@ func (a *Awaitility) WaitForToolchainClusterWithCondition(t *testing.T, namespac t.Logf("waiting for ToolchainCluster in namespace '%s'", namespace) var c toolchainv1alpha1.ToolchainCluster - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { var ready bool if c, ready, err = a.GetToolchainCluster(t, namespace, cdtype); ready { return true, nil @@ -237,8 +237,8 @@ func (a *Awaitility) WaitForRouteToBeAvailable(t *testing.T, ns, name, endpoint t.Logf("waiting for route '%s' in namespace '%s'", name, ns) route := routev1.Route{} // retrieve the route for the registration service - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { - if err = a.Client.Get(context.TODO(), + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { + if err = a.Client.Get(ctx, types.NamespacedName{ Namespace: ns, Name: name, @@ -328,7 +328,7 @@ func (a *Awaitility) GetMetricValueOrZero(t *testing.T, family string, labelAndV func (a *Awaitility) WaitUntiltMetricHasValue(t *testing.T, family string, expectedValue float64, labels ...string) { t.Logf("waiting for metric '%s{%v}' to reach '%v'", family, labels, expectedValue) var value float64 - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { value, err = metrics.GetMetricValue(a.RestConfig, a.MetricsURL, family, labels) // if error occurred, ignore and return `false` to keep waiting (may be due to endpoint temporarily unavailable) // unless the expected value is `0`, in which case the metric is bot exposed (value==0 and err!= nil), but it's fine too. @@ -342,7 +342,7 @@ func (a *Awaitility) WaitUntiltMetricHasValue(t *testing.T, family string, expec func (a *Awaitility) WaitUntilMetricHasValueOrMore(t *testing.T, family string, expectedValue float64, labels ...string) error { t.Logf("waiting for metric '%s{%v}' to reach '%v' or more", family, labels, expectedValue) var value float64 - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { value, err = metrics.GetMetricValue(a.RestConfig, a.MetricsURL, family, labels) // if error occurred, return `false` to keep waiting (may be due to endpoint temporarily unavailable) return value >= expectedValue && err == nil, nil @@ -358,7 +358,7 @@ func (a *Awaitility) WaitUntilMetricHasValueOrMore(t *testing.T, family string, func (a *Awaitility) WaitUntilMetricHasValueOrLess(t *testing.T, family string, expectedValue float64, labels ...string) error { t.Logf("waiting for metric '%s{%v}' to reach '%v' or less", family, labels, expectedValue) var value float64 - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { value, err = metrics.GetMetricValue(a.RestConfig, a.MetricsURL, family, labels) // if error occurred, return `false` to keep waiting (may be due to endpoint temporarily unavailable) return value <= expectedValue && err == nil, nil @@ -387,9 +387,9 @@ func (a *Awaitility) DeletePods(criteria ...client.ListOption) error { // GetMemoryUsage retrieves the memory usage (in KB) of a given the pod func (a *Awaitility) GetMemoryUsage(podname, ns string) (int64, error) { var containerMetrics k8smetrics.ContainerMetrics - if err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + if err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { podMetrics := k8smetrics.PodMetrics{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{ + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: ns, Name: podname, }, &podMetrics); err != nil && !apierrors.IsNotFound(err) { @@ -419,9 +419,9 @@ func (a *Awaitility) CreateNamespace(t *testing.T, name string) { } err := a.Client.Create(context.TODO(), ns) require.NoError(t, err) - err = wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { ns := &corev1.Namespace{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, ns); err != nil && apierrors.IsNotFound(err) { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, ns); err != nil && apierrors.IsNotFound(err) { return false, nil } else if err != nil { return false, err @@ -504,9 +504,9 @@ func (a *Awaitility) WaitForToolchainCluster(t *testing.T, criteria ...Toolchain t.Logf("waiting for toolchaincluster in namespace '%s' to match criteria", a.Namespace) var clusters *toolchainv1alpha1.ToolchainClusterList var cl *toolchainv1alpha1.ToolchainCluster - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { clusters = &toolchainv1alpha1.ToolchainClusterList{} - if err := a.Client.List(context.TODO(), clusters, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(ctx, clusters, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, obj := range clusters.Items { @@ -588,13 +588,13 @@ func UntilToolchainClusterHasNoTenantLabel() ToolchainClusterWaitCriterion { // Returns the updated ToolchainCluster func (a *Awaitility) UpdateToolchainCluster(t *testing.T, toolchainClusterName string, modifyToolchainCluster func(s *toolchainv1alpha1.ToolchainCluster)) (*toolchainv1alpha1.ToolchainCluster, error) { var tc *toolchainv1alpha1.ToolchainCluster - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { newToolchainCluster := &toolchainv1alpha1.ToolchainCluster{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: toolchainClusterName}, newToolchainCluster); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: toolchainClusterName}, newToolchainCluster); err != nil { return true, err } modifyToolchainCluster(newToolchainCluster) - if err := a.Client.Update(context.TODO(), newToolchainCluster); err != nil { + if err := a.Client.Update(ctx, newToolchainCluster); err != nil { t.Logf("error updating ToolchainCluster '%s': %s. Will retry again...", toolchainClusterName, err.Error()) return false, nil } @@ -690,13 +690,13 @@ func (w *Waiter[T]) FirstThat(predicates ...assertions.Predicate[client.Object]) // match status of each predicate per object latestResults := map[client.ObjectKey][]bool{} - err := wait.Poll(w.await.RetryInterval, w.await.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), w.await.RetryInterval, w.await.Timeout, true, func(ctx context.Context) (done bool, err error) { // because there is no generic way of figuring out the list type for some client.Object type, we need to go // down the low level route and use unstructured to get the list generically and unmarshal and cast the list // items. list := &unstructured.UnstructuredList{} list.SetGroupVersionKind(w.gvk) - if err := w.await.Client.List(context.TODO(), list, client.InNamespace(w.await.Namespace)); err != nil { + if err := w.await.Client.List(ctx, list, client.InNamespace(w.await.Namespace)); err != nil { return false, err } for _, obj := range list.Items { @@ -769,10 +769,10 @@ func (w *Waiter[T]) WithNameThat(name string, predicates ...assertions.Predicate var returnedObject T latestResults := []bool{} - err := wait.Poll(w.await.RetryInterval, w.await.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), w.await.RetryInterval, w.await.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &unstructured.Unstructured{} obj.SetGroupVersionKind(w.gvk) - if err := w.await.Client.Get(context.TODO(), client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { + if err := w.await.Client.Get(ctx, client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { if apierrors.IsNotFound(err) { return false, nil } @@ -820,10 +820,10 @@ func (w *Waiter[T]) WithNameThat(name string, predicates ...assertions.Predicate // WithNameDeleted waits for a single object with the provided name in the namespace of the awaitility to get deleted func (w *Waiter[T]) WithNameDeleted(name string) error { w.t.Logf("waiting for object of GVK '%s' with name '%s' in namespace '%s' to be deleted", w.gvk, name, w.await.Namespace) - err := wait.Poll(w.await.RetryInterval, w.await.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), w.await.RetryInterval, w.await.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &unstructured.Unstructured{} obj.SetGroupVersionKind(w.gvk) - if err := w.await.Client.Get(context.TODO(), client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { + if err := w.await.Client.Get(ctx, client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { if apierrors.IsNotFound(err) { return true, nil } diff --git a/testsupport/wait/host.go b/testsupport/wait/host.go index 1472657e8..c17c43977 100644 --- a/testsupport/wait/host.go +++ b/testsupport/wait/host.go @@ -146,9 +146,9 @@ func (a *HostAwaitility) InitMetrics(t *testing.T, memberClusterNames ...string) func (a *HostAwaitility) WaitForMasterUserRecord(t *testing.T, name string, criteria ...MasterUserRecordWaitCriterion) (*toolchainv1alpha1.MasterUserRecord, error) { t.Logf("waiting for MasterUserRecord '%s' in namespace '%s' to match criteria", name, a.Namespace) var mur *toolchainv1alpha1.MasterUserRecord - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -191,20 +191,20 @@ func (a *HostAwaitility) UpdateMasterUserRecordStatus(t *testing.T, murName stri // Returns the updated MasterUserRecord func (a *HostAwaitility) UpdateMasterUserRecord(t *testing.T, status bool, murName string, modifyMur func(mur *toolchainv1alpha1.MasterUserRecord)) (*toolchainv1alpha1.MasterUserRecord, error) { var m *toolchainv1alpha1.MasterUserRecord - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshMur := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: murName}, freshMur); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: murName}, freshMur); err != nil { return true, err } modifyMur(freshMur) if status { // Update status - if err := a.Client.Status().Update(context.TODO(), freshMur); err != nil { + if err := a.Client.Status().Update(ctx, freshMur); err != nil { t.Logf("error updating MasterUserRecord.Status '%s': %s. Will retry again...", murName, err.Error()) return false, nil } - } else if err := a.Client.Update(context.TODO(), freshMur); err != nil { + } else if err := a.Client.Update(ctx, freshMur); err != nil { t.Logf("error updating MasterUserRecord.Spec '%s': %s. Will retry again...", murName, err.Error()) return false, nil } @@ -219,14 +219,14 @@ func (a *HostAwaitility) UpdateMasterUserRecord(t *testing.T, status bool, murNa // Returns the updated UserSignup func (a *HostAwaitility) UpdateUserSignup(t *testing.T, userSignupName string, modifyUserSignup func(us *toolchainv1alpha1.UserSignup)) (*toolchainv1alpha1.UserSignup, error) { var userSignup *toolchainv1alpha1.UserSignup - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshUserSignup := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: userSignupName}, freshUserSignup); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: userSignupName}, freshUserSignup); err != nil { return true, err } modifyUserSignup(freshUserSignup) - if err := a.Client.Update(context.TODO(), freshUserSignup); err != nil { + if err := a.Client.Update(ctx, freshUserSignup); err != nil { t.Logf("error updating UserSignup '%s': %s. Will retry again...", userSignupName, err.Error()) return false, nil } @@ -241,13 +241,13 @@ func (a *HostAwaitility) UpdateUserSignup(t *testing.T, userSignupName string, m // Returns the updated Space func (a *HostAwaitility) UpdateSpace(t *testing.T, spaceName string, modifySpace func(s *toolchainv1alpha1.Space)) (*toolchainv1alpha1.Space, error) { var s *toolchainv1alpha1.Space - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpace := &toolchainv1alpha1.Space{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: spaceName}, freshSpace); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: spaceName}, freshSpace); err != nil { return true, err } modifySpace(freshSpace) - if err := a.Client.Update(context.TODO(), freshSpace); err != nil { + if err := a.Client.Update(ctx, freshSpace); err != nil { t.Logf("error updating Space '%s': %s. Will retry again...", spaceName, err.Error()) return false, nil } @@ -262,13 +262,13 @@ func (a *HostAwaitility) UpdateSpace(t *testing.T, spaceName string, modifySpace // Returns the updated SpaceBinding func (a *HostAwaitility) UpdateSpaceBinding(t *testing.T, spaceBindingName string, modifySpaceBinding func(s *toolchainv1alpha1.SpaceBinding)) (*toolchainv1alpha1.SpaceBinding, error) { var s *toolchainv1alpha1.SpaceBinding - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpaceBinding := &toolchainv1alpha1.SpaceBinding{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: spaceBindingName}, freshSpaceBinding); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: spaceBindingName}, freshSpaceBinding); err != nil { return true, err } modifySpaceBinding(freshSpaceBinding) - if err := a.Client.Update(context.TODO(), freshSpaceBinding); err != nil { + if err := a.Client.Update(ctx, freshSpaceBinding); err != nil { t.Logf("error updating SpaceBinding '%s': %s. Will retry again...", spaceBindingName, err.Error()) return false, nil } @@ -656,9 +656,9 @@ func UntilUserSignupHasCompliantUsername() UserSignupWaitCriterion { func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay time.Duration) error { t.Logf("waiting for resource cleanup") time.Sleep(initialDelay) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { usList := &toolchainv1alpha1.UserSignupList{} - if err := a.Client.List(context.TODO(), usList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(ctx, usList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, us := range usList.Items { @@ -668,7 +668,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } murList := &toolchainv1alpha1.MasterUserRecordList{} - if err := a.Client.List(context.TODO(), murList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(ctx, murList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, mur := range murList.Items { @@ -678,7 +678,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } spaceBindingList := &toolchainv1alpha1.SpaceBindingList{} - if err := a.Client.List(context.TODO(), spaceBindingList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(ctx, spaceBindingList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, spaceBinding := range spaceBindingList.Items { @@ -688,7 +688,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } spaceList := &toolchainv1alpha1.SpaceList{} - if err := a.Client.List(context.TODO(), spaceList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(ctx, spaceList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, space := range spaceList.Items { @@ -698,7 +698,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } nsTemplateSetList := &toolchainv1alpha1.NSTemplateSetList{} - if err := a.Client.List(context.TODO(), nsTemplateSetList); err != nil { + if err := a.Client.List(ctx, nsTemplateSetList); err != nil { return false, err } for _, nsTemplateSet := range nsTemplateSetList.Items { @@ -708,7 +708,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } namespaceList := &corev1.NamespaceList{} - if err := a.Client.List(context.TODO(), namespaceList); err != nil { + if err := a.Client.List(ctx, namespaceList); err != nil { return false, err } for _, namespace := range namespaceList.Items { @@ -724,9 +724,9 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay func (a *HostAwaitility) WaitForUserSignup(t *testing.T, name string, criteria ...UserSignupWaitCriterion) (*toolchainv1alpha1.UserSignup, error) { t.Logf("waiting for UserSignup '%s' in namespace '%s' to match criteria", name, a.Namespace) var userSignup *toolchainv1alpha1.UserSignup - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -747,11 +747,11 @@ func (a *HostAwaitility) WaitForUserSignupByUserIDAndUsername(t *testing.T, user t.Logf("waiting for UserSignup '%s' or '%s' in namespace '%s' to match criteria", userID, username, a.Namespace) encodedUsername := EncodeUserIdentifier(username) var userSignup *toolchainv1alpha1.UserSignup - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: userID}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: userID}, obj); err != nil { if errors.IsNotFound(err) { - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: encodedUsername}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: encodedUsername}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -775,9 +775,9 @@ func (a *HostAwaitility) WaitForUserSignupByUserIDAndUsername(t *testing.T, user func (a *HostAwaitility) WaitAndVerifyThatUserSignupIsNotCreated(t *testing.T, name string) { t.Logf("waiting and verifying that UserSignup '%s' in namespace '%s' is not created", name, a.Namespace) var userSignup *toolchainv1alpha1.UserSignup - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -796,9 +796,9 @@ func (a *HostAwaitility) WaitForBannedUser(t *testing.T, email string) (*toolcha t.Logf("waiting for BannedUser for user '%s' in namespace '%s'", email, a.Namespace) var bannedUser *toolchainv1alpha1.BannedUser labels := map[string]string{toolchainv1alpha1.BannedUserEmailHashLabelKey: hash.EncodeString(email)} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { bannedUserList := &toolchainv1alpha1.BannedUserList{} - if err = a.Client.List(context.TODO(), bannedUserList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { + if err = a.Client.List(ctx, bannedUserList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { if len(bannedUserList.Items) == 0 { return false, nil } @@ -830,9 +830,9 @@ func (a *HostAwaitility) DeleteToolchainStatus(t *testing.T, name string) error // WaitUntilBannedUserDeleted waits until the BannedUser with the given name is deleted (ie, not found) func (a *HostAwaitility) WaitUntilBannedUserDeleted(t *testing.T, name string) error { t.Logf("waiting until BannedUser '%s' in namespace '%s' is deleted", name, a.Namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { user := &toolchainv1alpha1.BannedUser{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, user); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, user); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -845,9 +845,9 @@ func (a *HostAwaitility) WaitUntilBannedUserDeleted(t *testing.T, name string) e // WaitUntilUserSignupDeleted waits until the UserSignup with the given name is deleted (ie, not found) func (a *HostAwaitility) WaitUntilUserSignupDeleted(t *testing.T, name string) error { t.Logf("waiting until UserSignup '%s' in namespace '%s is deleted", name, a.Namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { userSignup := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, userSignup); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, userSignup); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -860,9 +860,9 @@ func (a *HostAwaitility) WaitUntilUserSignupDeleted(t *testing.T, name string) e // WaitUntilMasterUserRecordAndSpaceBindingsDeleted waits until the MUR with the given name and its associated SpaceBindings are deleted (ie, not found) func (a *HostAwaitility) WaitUntilMasterUserRecordAndSpaceBindingsDeleted(t *testing.T, name string) error { t.Logf("waiting until MasterUserRecord '%s' in namespace '%s' is deleted", name, a.Namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { mur := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { if errors.IsNotFound(err) { // once the MUR is deleted, wait for the associated spacebindings to be deleted as well if err := a.WaitUntilSpaceBindingsWithLabelDeleted(t, toolchainv1alpha1.SpaceBindingMasterUserRecordLabelKey, name); err != nil { @@ -879,9 +879,9 @@ func (a *HostAwaitility) WaitUntilMasterUserRecordAndSpaceBindingsDeleted(t *tes // CheckMasterUserRecordIsDeleted checks that the MUR with the given name is not present and won't be created in the next 2 seconds func (a *HostAwaitility) CheckMasterUserRecordIsDeleted(t *testing.T, name string) { t.Logf("checking that MasterUserRecord '%s' in namespace '%s' is deleted", name, a.Namespace) - err := wait.Poll(a.RetryInterval, 2*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*time.Second, true, func(ctx context.Context) (done bool, err error) { mur := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -889,7 +889,7 @@ func (a *HostAwaitility) CheckMasterUserRecordIsDeleted(t *testing.T, name strin } return false, fmt.Errorf("the MasterUserRecord '%s' should not be present, but it is", name) }) - require.Equal(t, wait.ErrWaitTimeout, err) + require.Equal(t, wait.ErrorInterrupted(goerr.New("timed out waiting for the condition")), err) } func containsUserAccountStatus(uaStatuses []toolchainv1alpha1.UserAccountStatusEmbedded, uaStatus toolchainv1alpha1.UserAccountStatusEmbedded) bool { @@ -906,9 +906,9 @@ func containsUserAccountStatus(uaStatuses []toolchainv1alpha1.UserAccountStatusE func (a *HostAwaitility) WaitForUserTier(t *testing.T, name string, criteria ...UserTierWaitCriterion) (*toolchainv1alpha1.UserTier, error) { t.Logf("waiting until UserTier '%s' in namespace '%s' matches criteria", name, a.Namespace) tier := &toolchainv1alpha1.UserTier{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserTier{} - err = a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) + err = a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) if err != nil && !errors.IsNotFound(err) { // return the error return false, err @@ -990,9 +990,9 @@ func (a *HostAwaitility) WaitUntilBaseNSTemplateTierIsUpdated(t *testing.T) erro func (a *HostAwaitility) WaitForNSTemplateTier(t *testing.T, name string, criteria ...NSTemplateTierWaitCriterion) (*toolchainv1alpha1.NSTemplateTier, error) { t.Logf("waiting until NSTemplateTier '%s' in namespace '%s' matches criteria", name, a.Namespace) tier := &toolchainv1alpha1.NSTemplateTier{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.NSTemplateTier{} - err = a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) + err = a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) if err != nil && !errors.IsNotFound(err) { // return the error return false, err @@ -1043,9 +1043,9 @@ func (a *HostAwaitility) WaitForNSTemplateTierAndCheckTemplates(t *testing.T, na func (a *HostAwaitility) WaitForTierTemplate(t *testing.T, name string) (*toolchainv1alpha1.TierTemplate, error) { // nolint:unparam tierTemplate := &toolchainv1alpha1.TierTemplate{} t.Logf("waiting until TierTemplate '%s' exists in namespace '%s'...", name, a.Namespace) - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.TierTemplate{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1213,11 +1213,11 @@ func (a *HostAwaitility) printNotificationWaitCriterionDiffs(t *testing.T, actua func (a *HostAwaitility) WaitForNotifications(t *testing.T, username, notificationType string, numberOfNotifications int, criteria ...NotificationWaitCriterion) ([]toolchainv1alpha1.Notification, error) { t.Logf("waiting for notifications to match criteria for user '%s'", username) var notifications []toolchainv1alpha1.Notification - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { labels := map[string]string{toolchainv1alpha1.NotificationUserNameLabelKey: username, toolchainv1alpha1.NotificationTypeLabelKey: notificationType} opts := client.MatchingLabels(labels) notificationList := &toolchainv1alpha1.NotificationList{} - if err := a.Client.List(context.TODO(), notificationList, opts); err != nil { + if err := a.Client.List(ctx, notificationList, opts); err != nil { return false, err } notifications = notificationList.Items @@ -1237,9 +1237,9 @@ func (a *HostAwaitility) WaitForNotifications(t *testing.T, username, notificati func (a *HostAwaitility) WaitForNotificationWithName(t *testing.T, notificationName, notificationType string, criteria ...NotificationWaitCriterion) (toolchainv1alpha1.Notification, error) { t.Logf("waiting for notification with name '%s'", notificationName) notification := &toolchainv1alpha1.Notification{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { notification = &toolchainv1alpha1.Notification{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1264,9 +1264,9 @@ func (a *HostAwaitility) WaitForNotificationWithName(t *testing.T, notificationN func (a *HostAwaitility) WaitForNotificationToNotBeCreated(t *testing.T, notificationName string) error { t.Logf("waiting to check notification with name '%s' is NOT created", notificationName) notification := &toolchainv1alpha1.Notification{} - err := wait.Poll(a.RetryInterval, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { notification = &toolchainv1alpha1.Notification{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1277,7 +1277,7 @@ func (a *HostAwaitility) WaitForNotificationToNotBeCreated(t *testing.T, notific if err == nil { return fmt.Errorf("notification '%s' was found, but it was expected to not be created/present: \n %v", notificationName, notification) } - if goerr.Is(err, wait.ErrWaitTimeout) { + if goerr.Is(err, wait.ErrorInterrupted(goerr.New("timed out waiting for the condition"))) { return nil } return err @@ -1286,11 +1286,11 @@ func (a *HostAwaitility) WaitForNotificationToNotBeCreated(t *testing.T, notific // WaitUntilNotificationsDeleted waits until the Notification for the given user is deleted (ie, not found) func (a *HostAwaitility) WaitUntilNotificationsDeleted(t *testing.T, username, notificationType string) error { t.Logf("waiting until notifications have been deleted for user '%s'", username) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { labels := map[string]string{toolchainv1alpha1.NotificationUserNameLabelKey: username, toolchainv1alpha1.NotificationTypeLabelKey: notificationType} opts := client.MatchingLabels(labels) notificationList := &toolchainv1alpha1.NotificationList{} - if err := a.Client.List(context.TODO(), notificationList, opts); err != nil { + if err := a.Client.List(ctx, notificationList, opts); err != nil { return false, err } return len(notificationList.Items) == 0, nil @@ -1300,9 +1300,9 @@ func (a *HostAwaitility) WaitUntilNotificationsDeleted(t *testing.T, username, n // WaitUntilNotificationWithNameDeleted waits until the Notification with the given name is deleted (ie, not found) func (a *HostAwaitility) WaitUntilNotificationWithNameDeleted(t *testing.T, notificationName string) error { t.Logf("waiting for notification with name '%s' to get deleted", notificationName) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { notification := &toolchainv1alpha1.Notification{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1493,10 +1493,10 @@ func (a *HostAwaitility) WaitForToolchainStatus(t *testing.T, criteria ...Toolch // there should only be one toolchain status with the name toolchain-status name := "toolchain-status" toolchainStatus := &toolchainv1alpha1.ToolchainStatus{} - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.ToolchainStatus{} // retrieve the toolchainstatus from the host namespace - err = a.Client.Get(context.TODO(), + err = a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -1519,8 +1519,8 @@ func (a *HostAwaitility) WaitForToolchainStatus(t *testing.T, criteria ...Toolch } func (a *HostAwaitility) waitForResource(t *testing.T, namespace, name string, object client.Object) { - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { - if err := a.Client.Get(context.TODO(), test.NamespacedName(namespace, name), object); err != nil { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { + if err := a.Client.Get(ctx, test.NamespacedName(namespace, name), object); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1659,10 +1659,10 @@ func (a *HostAwaitility) WaitForToolchainConfig(t *testing.T, criteria ...Toolch // there should only be one ToolchainConfig with the name "config" name := "config" var toolchainConfig *toolchainv1alpha1.ToolchainConfig - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.ToolchainConfig{} // retrieve the ToolchainConfig from the host namespace - if err := a.Client.Get(context.TODO(), + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -1750,10 +1750,10 @@ func (a *HostAwaitility) UpdateToolchainConfig(t *testing.T, options ...testconf // resource periodically which can cause errors like `Operation cannot be fulfilled on toolchainconfigs.toolchain.dev.openshift.com "config": the object has been modified; please apply your changes to the latest version and try again` // in some cases. Retrying mitigates the potential for test flakiness due to this behaviour. func (a *HostAwaitility) updateToolchainConfigWithRetry(t *testing.T, updatedConfig *toolchainv1alpha1.ToolchainConfig) error { - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { config := a.GetToolchainConfig(t) config.Spec = updatedConfig.Spec - if err := a.Client.Update(context.TODO(), config); err != nil { + if err := a.Client.Update(ctx, config); err != nil { t.Logf("Retrying ToolchainConfig update due to error: %s", err.Error()) return false, nil } @@ -1801,7 +1801,7 @@ func (a *HostAwaitility) CreateAPIProxyClient(t *testing.T, userToken, proxyURL // updated yet and we try to create the client too quickly so retry to reduce flakiness. var proxyCl client.Client var initProxyClError error - waitErr := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + waitErr := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { proxyCl, initProxyClError = client.New(proxyKubeConfig, client.Options{Scheme: s}) return initProxyClError == nil, nil }) @@ -1837,10 +1837,10 @@ func matchSpaceWaitCriterion(actual *toolchainv1alpha1.Space, criteria ...SpaceW func (a *HostAwaitility) WaitForSpace(t *testing.T, name string, criteria ...SpaceWaitCriterion) (*toolchainv1alpha1.Space, error) { t.Logf("waiting for Space '%s' with matching criteria", name) var space *toolchainv1alpha1.Space - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Space{} // retrieve the Space from the host namespace - if err := a.Client.Get(context.TODO(), + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -1864,9 +1864,9 @@ func (a *HostAwaitility) WaitForSpace(t *testing.T, name string, criteria ...Spa func (a *HostAwaitility) WaitForProxyPlugin(t *testing.T, name string) (*toolchainv1alpha1.ProxyPlugin, error) { t.Logf("waiting for ProxyPlugin %q", name) var proxyPlugin *toolchainv1alpha1.ProxyPlugin - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.ProxyPlugin{} - if err = a.Client.Get(context.TODO(), + if err = a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2119,9 +2119,9 @@ func UntilSpaceHasStatusTargetCluster(expected string) SpaceWaitCriterion { func (a *HostAwaitility) WaitUntilSpaceAndSpaceBindingsDeleted(t *testing.T, name string) error { t.Logf("waiting until Space '%s' in namespace '%s' is deleted", name, a.Namespace) var s *toolchainv1alpha1.Space - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Space{} - if err := a.Client.Get(context.TODO(), + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2148,9 +2148,9 @@ func (a *HostAwaitility) WaitUntilSpaceAndSpaceBindingsDeleted(t *testing.T, nam // WaitUntilSpaceBindingDeleted waits until the SpaceBinding with the given name is deleted (ie, not found) func (a *HostAwaitility) WaitUntilSpaceBindingDeleted(name string) error { - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { mur := &toolchainv1alpha1.SpaceBinding{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -2165,10 +2165,10 @@ func (a *HostAwaitility) WaitUntilSpaceBindingsWithLabelDeleted(t *testing.T, ke labels := map[string]string{key: value} t.Logf("waiting until SpaceBindings with labels '%v' in namespace '%s' are deleted", labels, a.Namespace) var spaceBindingList *toolchainv1alpha1.SpaceBindingList - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { // retrieve the SpaceBinding from the host namespace spaceBindingList = &toolchainv1alpha1.SpaceBindingList{} - if err = a.Client.List(context.TODO(), spaceBindingList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { + if err = a.Client.List(ctx, spaceBindingList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { return false, err } return len(spaceBindingList.Items) == 0, nil @@ -2209,10 +2209,10 @@ func (a *HostAwaitility) WaitForSubSpace(t *testing.T, spaceRequestName, spaceRe toolchainv1alpha1.ParentSpaceLabelKey: parentSpaceName, } - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { // retrieve the subSpace from the host namespace spaceList := &toolchainv1alpha1.SpaceList{} - if err = a.Client.List(context.TODO(), spaceList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { + if err = a.Client.List(ctx, spaceList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { return false, err } if len(spaceList.Items) == 0 { @@ -2235,7 +2235,7 @@ func (a *HostAwaitility) WaitForSubSpace(t *testing.T, spaceRequestName, spaceRe func (a *HostAwaitility) WaitForSpaceBinding(t *testing.T, murName, spaceName string, criteria ...SpaceBindingWaitCriterion) (*toolchainv1alpha1.SpaceBinding, error) { var spaceBinding *toolchainv1alpha1.SpaceBinding - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (bool, error) { // retrieve the SpaceBinding from the host namespace var err error if spaceBinding, err = a.GetSpaceBindingByListing(murName, spaceName); err != nil { @@ -2405,10 +2405,10 @@ func matchSocialEventWaitCriterion(actual *toolchainv1alpha1.SocialEvent, criter func (a *HostAwaitility) WaitForSocialEvent(t *testing.T, name string, criteria ...SocialEventWaitCriterion) (*toolchainv1alpha1.SocialEvent, error) { t.Logf("waiting for SocialEvent '%s' in namespace '%s' to match criteria", name, a.Namespace) var event *toolchainv1alpha1.SocialEvent - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.SocialEvent{} // retrieve the Space from the host namespace - if err := a.Client.Get(context.TODO(), + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2516,7 +2516,7 @@ func (a *HostAwaitility) CreateSpaceAndSpaceBinding(t *testing.T, mur *toolchain var spaceBinding *toolchainv1alpha1.SpaceBinding var spaceCreated *toolchainv1alpha1.Space testutil.LogWithTimestamp(t, fmt.Sprintf("Creating Space %s (prefix: %s) and SpaceBinding with role %s for %s", space.Name, space.GenerateName, spaceRole, mur.Name)) - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { // create the space spaceToCreate := space.DeepCopy() if err := a.Create(spaceToCreate); err != nil { @@ -2538,7 +2538,7 @@ func (a *HostAwaitility) CreateSpaceAndSpaceBinding(t *testing.T, mur *toolchain // let's see if space was provisioned as expected spaceCreated = &toolchainv1alpha1.Space{} - err = a.Client.Get(context.TODO(), client.ObjectKeyFromObject(spaceToCreate), spaceCreated) + err = a.Client.Get(ctx, client.ObjectKeyFromObject(spaceToCreate), spaceCreated) if err != nil { if errors.IsNotFound(err) { testutil.LogWithTimestamp(t, fmt.Sprintf("The created Space %s is not present in namespace %s", spaceToCreate.Name, spaceToCreate.Namespace)) diff --git a/testsupport/wait/member.go b/testsupport/wait/member.go index 17b6591ac..3b9c19008 100644 --- a/testsupport/wait/member.go +++ b/testsupport/wait/member.go @@ -248,9 +248,9 @@ func UntilUserAccountIsCreatedAfter(timestamp metav1.Time) UserAccountWaitCriter // WaitForUserAccount waits until there is a UserAccount available with the given name, expected spec and the set of status conditions func (a *MemberAwaitility) WaitForUserAccount(t *testing.T, name string, criteria ...UserAccountWaitCriterion) (*toolchainv1alpha1.UserAccount, error) { var userAccount *toolchainv1alpha1.UserAccount - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserAccount{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -275,9 +275,9 @@ type SpaceRequestWaitCriterion struct { // WaitForSpaceRequest waits until there is a SpaceRequest available with the given name, namespace, spec and the set of status conditions func (a *MemberAwaitility) WaitForSpaceRequest(t *testing.T, namespacedName types.NamespacedName, criteria ...SpaceRequestWaitCriterion) (*toolchainv1alpha1.SpaceRequest, error) { var spaceRequest *toolchainv1alpha1.SpaceRequest - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.SpaceRequest{} - if err := a.Client.Get(context.TODO(), namespacedName, obj); err != nil { + if err := a.Client.Get(ctx, namespacedName, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -460,9 +460,9 @@ type SpaceBindingRequestWaitCriterion struct { // WaitForSpaceBindingRequest waits until there is a SpaceBindingRequest available with the given name, namespace, spec and the set of status conditions func (a *MemberAwaitility) WaitForSpaceBindingRequest(t *testing.T, namespacedName types.NamespacedName, criteria ...SpaceBindingRequestWaitCriterion) (*toolchainv1alpha1.SpaceBindingRequest, error) { var spaceBindingRequest *toolchainv1alpha1.SpaceBindingRequest - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.SpaceBindingRequest{} - if err := a.Client.Get(context.TODO(), namespacedName, obj); err != nil { + if err := a.Client.Get(ctx, namespacedName, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -725,9 +725,9 @@ func UntilNSTemplateSetHasProvisionedNamespaces(expected []toolchainv1alpha1.Spa func (a *MemberAwaitility) WaitForNSTmplSet(t *testing.T, name string, criteria ...NSTemplateSetWaitCriterion) (*toolchainv1alpha1.NSTemplateSet, error) { t.Logf("waiting for NSTemplateSet '%s' to match criteria", name) var nsTmplSet *toolchainv1alpha1.NSTemplateSet - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.NSTemplateSet{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -746,9 +746,9 @@ func (a *MemberAwaitility) WaitForNSTmplSet(t *testing.T, name string, criteria // WaitUntilNSTemplateSetDeleted waits until the NSTemplateSet with the given name is deleted (ie, is not found) func (a *MemberAwaitility) WaitUntilNSTemplateSetDeleted(t *testing.T, name string) error { t.Logf("waiting for until NSTemplateSet '%s' in namespace '%s' is deleted", name, a.Namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { nsTmplSet := &toolchainv1alpha1.NSTemplateSet{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, nsTmplSet); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, nsTmplSet); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -836,10 +836,10 @@ func (a *MemberAwaitility) WaitForNamespace(t *testing.T, owner, tmplRef, tierNa } t.Logf("waiting for namespace with custom criteria and labels %v", labels) var ns *corev1.Namespace - err = wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { nss := &corev1.NamespaceList{} opts := client.MatchingLabels(labels) - if err := a.Client.List(context.TODO(), nss, opts); err != nil { + if err := a.Client.List(ctx, nss, opts); err != nil { return false, err } if len(nss.Items) != 1 { @@ -870,9 +870,9 @@ func (a *MemberAwaitility) WaitForNamespace(t *testing.T, owner, tmplRef, tierNa // WaitForNamespaceWithName waits until a namespace with the given name func (a *MemberAwaitility) WaitForNamespaceWithName(t *testing.T, name string, criteria ...LabelWaitCriterion) (*corev1.Namespace, error) { ns := &corev1.Namespace{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Namespace{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -924,9 +924,9 @@ func (a *MemberAwaitility) printNamespaceLabelCriterionDiffs(t *testing.T, actua // WaitForNamespaceInTerminating waits until a namespace with the given name has a deletion timestamp and in Terminating Phase func (a *MemberAwaitility) WaitForNamespaceInTerminating(t *testing.T, nsName string) (*corev1.Namespace, error) { ns := &corev1.Namespace{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Namespace{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: nsName}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: nsName}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -969,9 +969,9 @@ func (a *MemberAwaitility) printRoleBindingWaitCriterionDiffs(t *testing.T, actu func (a *MemberAwaitility) WaitForRoleBinding(t *testing.T, namespace *corev1.Namespace, name string, criteria ...LabelWaitCriterion) (*rbacv1.RoleBinding, error) { t.Logf("waiting for RoleBinding '%s' in namespace '%s'", name, namespace.Name) roleBinding := &rbacv1.RoleBinding{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &rbacv1.RoleBinding{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -992,9 +992,9 @@ func (a *MemberAwaitility) WaitForRoleBinding(t *testing.T, namespace *corev1.Na // WaitUntilRoleBindingDeleted waits until a RoleBinding with the given name does not exist anymore in the given namespace func (a *MemberAwaitility) WaitUntilRoleBindingDeleted(t *testing.T, namespace *corev1.Namespace, name string) error { t.Logf("waiting for RoleBinding '%s' in namespace '%s' to be deleted", name, namespace.Name) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { roleBinding := &rbacv1.RoleBinding{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, roleBinding); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, roleBinding); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1007,9 +1007,9 @@ func (a *MemberAwaitility) WaitUntilRoleBindingDeleted(t *testing.T, namespace * func (a *MemberAwaitility) WaitForServiceAccount(t *testing.T, namespace string, name string, criteria ...LabelWaitCriterion) (*corev1.ServiceAccount, error) { t.Logf("waiting for ServiceAccount '%s' in namespace '%s'", name, namespace) serviceAccount := &corev1.ServiceAccount{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ServiceAccount{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1029,12 +1029,12 @@ func (a *MemberAwaitility) WaitForServiceAccount(t *testing.T, namespace string, func (a *MemberAwaitility) WaitForLimitRange(t *testing.T, namespace *corev1.Namespace, name string) (*corev1.LimitRange, error) { t.Logf("waiting for LimitRange '%s' in namespace '%s'", name, namespace.Name) lr := &corev1.LimitRange{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.LimitRange{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { allLRs := &corev1.LimitRangeList{} - if err := a.Client.List(context.TODO(), allLRs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { + if err := a.Client.List(ctx, allLRs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { return false, err } return false, nil @@ -1054,12 +1054,12 @@ func (a *MemberAwaitility) WaitForLimitRange(t *testing.T, namespace *corev1.Nam func (a *MemberAwaitility) WaitForNetworkPolicy(t *testing.T, namespace *corev1.Namespace, name string) (*netv1.NetworkPolicy, error) { t.Logf("waiting for NetworkPolicy '%s' in namespace '%s'", name, namespace.Name) np := &netv1.NetworkPolicy{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &netv1.NetworkPolicy{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { allNPs := &netv1.NetworkPolicyList{} - if err := a.Client.List(context.TODO(), allNPs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { + if err := a.Client.List(ctx, allNPs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { return false, err } return false, nil @@ -1079,9 +1079,9 @@ func (a *MemberAwaitility) WaitForNetworkPolicy(t *testing.T, namespace *corev1. func (a *MemberAwaitility) WaitForRole(t *testing.T, namespace *corev1.Namespace, name string, criteria ...LabelWaitCriterion) (*rbacv1.Role, error) { t.Logf("waiting for Role '%s' in namespace '%s'", name, namespace.Name) role := &rbacv1.Role{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &rbacv1.Role{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1100,9 +1100,9 @@ func (a *MemberAwaitility) WaitForRole(t *testing.T, namespace *corev1.Namespace // WaitUntilRoleDeleted waits until a Role with the given name does not exist anymore in the given namespace func (a *MemberAwaitility) WaitUntilRoleDeleted(t *testing.T, namespace *corev1.Namespace, name string) error { t.Logf("waiting for Role '%s' in namespace '%s' to be deleted", name, namespace.Name) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { role := &rbacv1.Role{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, role); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, role); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1177,13 +1177,13 @@ func (a *MemberAwaitility) printClusterResourceQuotaWaitCriterionDiffs(t *testin func (a *MemberAwaitility) WaitForClusterResourceQuota(t *testing.T, name string, criteria ...ClusterResourceQuotaWaitCriterion) (*quotav1.ClusterResourceQuota, error) { t.Logf("waiting for ClusterResourceQuota '%s' to match criteria", name) quota := "av1.ClusterResourceQuota{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := "av1.ClusterResourceQuota{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, obj); err != nil { if errors.IsNotFound(err) { quotaList := "av1.ClusterResourceQuotaList{} ls := codereadyToolchainProviderLabel - if err := a.Client.List(context.TODO(), quotaList, client.MatchingLabels(ls)); err != nil { + if err := a.Client.List(ctx, quotaList, client.MatchingLabels(ls)); err != nil { return false, err } return false, nil @@ -1242,9 +1242,9 @@ func (a *MemberAwaitility) printResourceQuotaWaitCriterionDiffs(t *testing.T, ac func (a *MemberAwaitility) WaitForResourceQuota(t *testing.T, namespace, name string, criteria ...ResourceQuotaWaitCriterion) (*corev1.ResourceQuota, error) { t.Logf("waiting for ResourceQuota '%s' in %s to match criteria", name, namespace) quota := &corev1.ResourceQuota{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ResourceQuota{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1354,9 +1354,9 @@ func IdlerHasLabel(key, value string) IdlerWaitCriterion { func (a *MemberAwaitility) WaitForIdler(t *testing.T, name string, criteria ...IdlerWaitCriterion) (*toolchainv1alpha1.Idler, error) { t.Logf("waiting for Idler '%s' to match criteria", name) idler := &toolchainv1alpha1.Idler{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Idler{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1375,13 +1375,13 @@ func (a *MemberAwaitility) WaitForIdler(t *testing.T, name string, criteria ...I // UpdateIdlerSpec tries to update the Idler.Spec until success func (a *MemberAwaitility) UpdateIdlerSpec(t *testing.T, idler *toolchainv1alpha1.Idler) (*toolchainv1alpha1.Idler, error) { var result *toolchainv1alpha1.Idler - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Idler{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: idler.Name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: idler.Name}, obj); err != nil { return false, err } obj.Spec = idler.Spec - if err := a.Client.Update(context.TODO(), obj); err != nil { + if err := a.Client.Update(ctx, obj); err != nil { t.Logf("trying to update Idler %s. Error: %s. Will try to update again.", idler.Name, err.Error()) return false, nil } @@ -1396,13 +1396,13 @@ func (a *MemberAwaitility) UpdateIdlerSpec(t *testing.T, idler *toolchainv1alpha // Returns the updated Namespace func (a *MemberAwaitility) UpdateNamespace(t *testing.T, nsName string, modifyNamespace func(ns *corev1.Namespace)) (*corev1.Namespace, error) { var ns *corev1.Namespace - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshNs := &corev1.Namespace{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: nsName}, freshNs); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: nsName}, freshNs); err != nil { return true, err } modifyNamespace(freshNs) - if err := a.Client.Update(context.TODO(), freshNs); err != nil { + if err := a.Client.Update(ctx, freshNs); err != nil { t.Logf("error updating Namespace '%s': %s. Will retry again...", nsName, err.Error()) return false, nil } @@ -1417,13 +1417,13 @@ func (a *MemberAwaitility) UpdateNamespace(t *testing.T, nsName string, modifyNa // Returns the updated ServiceAccount func (a *MemberAwaitility) UpdateServiceAccount(t *testing.T, namespace, saName string, modifySA func(sa *corev1.ServiceAccount)) (*corev1.ServiceAccount, error) { var sa *corev1.ServiceAccount - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSA := &corev1.ServiceAccount{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: saName}, freshSA); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: saName}, freshSA); err != nil { return true, err } modifySA(freshSA) - if err := a.Client.Update(context.TODO(), freshSA); err != nil { + if err := a.Client.Update(ctx, freshSA); err != nil { t.Logf("error updating ServiceAccount '%s': %s. Will retry again...", saName, err.Error()) return false, nil } @@ -1438,13 +1438,13 @@ func (a *MemberAwaitility) UpdateServiceAccount(t *testing.T, namespace, saName // Returns the updated SpaceRequest func (a *MemberAwaitility) UpdateSpaceRequest(t *testing.T, spaceRequestNamespacedName types.NamespacedName, modifySpaceRequest func(s *toolchainv1alpha1.SpaceRequest)) (*toolchainv1alpha1.SpaceRequest, error) { var sr *toolchainv1alpha1.SpaceRequest - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpaceRequest := &toolchainv1alpha1.SpaceRequest{} - if err := a.Client.Get(context.TODO(), spaceRequestNamespacedName, freshSpaceRequest); err != nil { + if err := a.Client.Get(ctx, spaceRequestNamespacedName, freshSpaceRequest); err != nil { return true, err } modifySpaceRequest(freshSpaceRequest) - if err := a.Client.Update(context.TODO(), freshSpaceRequest); err != nil { + if err := a.Client.Update(ctx, freshSpaceRequest); err != nil { t.Logf("error updating SpaceRequest '%s' in namespace '%s': %s. Will retry again...", spaceRequestNamespacedName.Name, spaceRequestNamespacedName.Name, err.Error()) return false, nil } @@ -1459,13 +1459,13 @@ func (a *MemberAwaitility) UpdateSpaceRequest(t *testing.T, spaceRequestNamespac // Returns the updated SpaceBindingRequest func (a *MemberAwaitility) UpdateSpaceBindingRequest(t *testing.T, spaceBindingRequestNamespacedName types.NamespacedName, modifySpaceBindingRequest func(s *toolchainv1alpha1.SpaceBindingRequest)) (*toolchainv1alpha1.SpaceBindingRequest, error) { var sr *toolchainv1alpha1.SpaceBindingRequest - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpaceBindingRequest := &toolchainv1alpha1.SpaceBindingRequest{} - if err := a.Client.Get(context.TODO(), spaceBindingRequestNamespacedName, freshSpaceBindingRequest); err != nil { + if err := a.Client.Get(ctx, spaceBindingRequestNamespacedName, freshSpaceBindingRequest); err != nil { return true, err } modifySpaceBindingRequest(freshSpaceBindingRequest) - if err := a.Client.Update(context.TODO(), freshSpaceBindingRequest); err != nil { + if err := a.Client.Update(ctx, freshSpaceBindingRequest); err != nil { t.Logf("error updating SpaceBindingRequest '%s' in namespace '%s': %s. Will retry again...", spaceBindingRequestNamespacedName.Name, spaceBindingRequestNamespacedName.Name, err.Error()) return false, err } @@ -1478,9 +1478,9 @@ func (a *MemberAwaitility) UpdateSpaceBindingRequest(t *testing.T, spaceBindingR // WaitUntilSpaceBindingRequestDeleted waits until a SpaceBindingRequest with the given name does not exist anymore in the given namespace func (a *MemberAwaitility) WaitUntilSpaceBindingRequestDeleted(t *testing.T, spaceBindingRequest *toolchainv1alpha1.SpaceBindingRequest) error { t.Logf("waiting for SpaceBindingRequest '%s' in namespace '%s' to be deleted", spaceBindingRequest.GetName(), spaceBindingRequest.GetNamespace()) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { sbr := &toolchainv1alpha1.SpaceBindingRequest{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: spaceBindingRequest.GetName(), Namespace: spaceBindingRequest.GetNamespace()}, sbr); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: spaceBindingRequest.GetName(), Namespace: spaceBindingRequest.GetNamespace()}, sbr); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1493,8 +1493,8 @@ func (a *MemberAwaitility) WaitUntilSpaceBindingRequestDeleted(t *testing.T, spa // Create tries to create the object until success // Workaround for https://github.com/kubernetes/kubernetes/issues/67761 func (a *MemberAwaitility) Create(t *testing.T, obj client.Object) error { - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { - if err := a.Client.Create(context.TODO(), obj); err != nil { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { + if err := a.Client.Create(ctx, obj); err != nil { t.Logf("trying to create %+v. Error: %s. Will try to create again.", obj, err.Error()) return false, nil } @@ -1538,9 +1538,9 @@ func (a *MemberAwaitility) printPodWaitCriterionDiffs(t *testing.T, actual *core func (a *MemberAwaitility) WaitForPod(t *testing.T, namespace, name string, criteria ...PodWaitCriterion) (*corev1.Pod, error) { t.Logf("waiting for Pod '%s' in namespace '%s' with matching criteria", name, namespace) var pod *corev1.Pod - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Pod{} - if err = a.Client.Get(context.TODO(), types.NamespacedName{ + if err = a.Client.Get(ctx, types.NamespacedName{ Namespace: namespace, Name: name, }, obj); err != nil { @@ -1565,9 +1565,9 @@ func (a *MemberAwaitility) WaitForPod(t *testing.T, namespace, name string, crit func (a *MemberAwaitility) WaitForConfigMap(t *testing.T, namespace, name string) (*corev1.ConfigMap, error) { t.Logf("waiting for ConfigMap '%s' in namespace '%s'", name, namespace) var cm *corev1.ConfigMap - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ConfigMap{} - if err = a.Client.Get(context.TODO(), types.NamespacedName{ + if err = a.Client.Get(ctx, types.NamespacedName{ Namespace: namespace, Name: name, }, obj); err != nil { @@ -1588,9 +1588,9 @@ func (a *MemberAwaitility) WaitForConfigMap(t *testing.T, namespace, name string func (a *MemberAwaitility) WaitForSecret(t *testing.T, name string) (*corev1.Secret, error) { t.Logf("waiting for Secret '%s' in namespace '%s'", name, a.Namespace) var cm *corev1.Secret - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Secret{} - if err = a.Client.Get(context.TODO(), types.NamespacedName{ + if err = a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, }, obj); err != nil { @@ -1611,10 +1611,10 @@ func (a *MemberAwaitility) WaitForSecret(t *testing.T, name string) (*corev1.Sec func (a *MemberAwaitility) WaitForPods(t *testing.T, namespace string, n int, criteria ...PodWaitCriterion) ([]corev1.Pod, error) { t.Logf("waiting for Pods in namespace '%s' with matching criteria", namespace) pods := make([]corev1.Pod, 0, n) - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { pds := make([]corev1.Pod, 0, n) foundPods := &corev1.PodList{} - if err := a.Client.List(context.TODO(), foundPods, client.InNamespace(namespace)); err != nil { + if err := a.Client.List(ctx, foundPods, client.InNamespace(namespace)); err != nil { return false, err } pods: @@ -1638,9 +1638,9 @@ func (a *MemberAwaitility) WaitForPods(t *testing.T, namespace string, n int, cr // WaitUntilPodsDeleted waits until the pods are deleted from the given namespace func (a *MemberAwaitility) WaitUntilPodsDeleted(t *testing.T, namespace string, criteria ...PodWaitCriterion) error { t.Logf("waiting until Pods with matching criteria in namespace '%s' are deleted", namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { foundPods := &corev1.PodList{} - if err := a.Client.List(context.TODO(), foundPods, &client.ListOptions{Namespace: namespace}); err != nil { + if err := a.Client.List(ctx, foundPods, &client.ListOptions{Namespace: namespace}); err != nil { return false, err } if len(foundPods.Items) == 0 { @@ -1659,9 +1659,9 @@ func (a *MemberAwaitility) WaitUntilPodsDeleted(t *testing.T, namespace string, // WaitUntilPodDeleted waits until the pod with the given name is deleted from the given namespace func (a *MemberAwaitility) WaitUntilPodDeleted(t *testing.T, namespace, name string) error { t.Logf("waiting until Pod '%s' in namespace '%s' is deleted", name, namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Pod{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1746,8 +1746,8 @@ func checkPriorityClass(pod *corev1.Pod, name string, priority int) bool { func (a *MemberAwaitility) WaitUntilWebhookDeleted(t *testing.T) error { t.Logf("waiting until webhook member-operator-webhook in namespace '%s' is deleted", a.Namespace) deployment := &appsv1.Deployment{} - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { - if err := a.Client.Get(context.TODO(), test.NamespacedName(a.Namespace, "member-operator-webhook"), deployment); err != nil { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { + if err := a.Client.Get(ctx, test.NamespacedName(a.Namespace, "member-operator-webhook"), deployment); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1760,14 +1760,14 @@ func (a *MemberAwaitility) WaitUntilWebhookDeleted(t *testing.T) error { // WaitUntilNamespaceDeleted waits until the namespace with the given name is deleted (ie, is not found) func (a *MemberAwaitility) WaitUntilNamespaceDeleted(t *testing.T, username, typeName string) error { t.Logf("waiting until namespace for user '%s' and type '%s' is deleted", username, typeName) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { labels := map[string]string{ toolchainv1alpha1.SpaceLabelKey: username, toolchainv1alpha1.TypeLabelKey: typeName, } opts := client.MatchingLabels(labels) namespaceList := &corev1.NamespaceList{} - if err := a.Client.List(context.TODO(), namespaceList, opts); err != nil { + if err := a.Client.List(ctx, namespaceList, opts); err != nil { return false, err } if len(namespaceList.Items) < 1 { @@ -1780,9 +1780,9 @@ func (a *MemberAwaitility) WaitUntilNamespaceDeleted(t *testing.T, username, typ // WaitUntilSecretsDeleted waits until the secrets with the given labels are deleted (ie, is not found) func (a *MemberAwaitility) WaitUntilSecretsDeleted(t *testing.T, namespace string, labels client.MatchingLabels) error { t.Logf("waiting until secrets with lables '%v' in namespace '%s' is deleted", labels, namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { secretList := &corev1.SecretList{} - if err := a.Client.List(context.TODO(), secretList, labels); err != nil { + if err := a.Client.List(ctx, secretList, labels); err != nil { return false, err } if len(secretList.Items) < 1 { @@ -1827,9 +1827,9 @@ func (a *MemberAwaitility) printUserWaitCriterionDiffs(t *testing.T, actual *use func (a *MemberAwaitility) WaitForUser(t *testing.T, name string, criteria ...UserWaitCriterion) (*userv1.User, error) { t.Logf("waiting for User '%s'", name) user := &userv1.User{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { user = &userv1.User{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, user); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, user); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1893,9 +1893,9 @@ func matchIdentityWaitCriterion(actual *userv1.Identity, criteria ...IdentityWai func (a *MemberAwaitility) WaitForIdentity(t *testing.T, name string, criteria ...IdentityWaitCriterion) (*userv1.Identity, error) { t.Logf("waiting for Identity '%s'", name) identity := &userv1.Identity{} - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { identity = &userv1.Identity{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, identity); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, identity); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1937,9 +1937,9 @@ func UntilIdentityHasLabel(key, value string) IdentityWaitCriterion { // WaitUntilUserAccountDeleted waits until the UserAccount with the given name is not found func (a *MemberAwaitility) WaitUntilUserAccountDeleted(t *testing.T, name string) error { t.Logf("waiting until UserAccount '%s' in namespace '%s' is deleted", name, a.Namespace) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { ua := &toolchainv1alpha1.UserAccount{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, ua); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, ua); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1952,9 +1952,9 @@ func (a *MemberAwaitility) WaitUntilUserAccountDeleted(t *testing.T, name string // WaitUntilUserDeleted waits until the User with the given name is not found func (a *MemberAwaitility) WaitUntilUserDeleted(t *testing.T, name string) error { t.Logf("waiting until User is deleted '%s'", name) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { user := &userv1.User{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, user); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, user); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1970,9 +1970,9 @@ func (a *MemberAwaitility) WaitUntilUserDeleted(t *testing.T, name string) error // WaitUntilIdentityDeleted waits until the Identity with the given name is not found func (a *MemberAwaitility) WaitUntilIdentityDeleted(t *testing.T, name string) error { t.Logf("waiting until Identity is deleted '%s'", name) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { identity := &userv1.Identity{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, identity); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, identity); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1997,13 +1997,13 @@ func (a *MemberAwaitility) GetConsoleURL(t *testing.T) string { // WaitUntilClusterResourceQuotasDeleted waits until all ClusterResourceQuotas with the given owner label are deleted (ie, none is found) func (a *MemberAwaitility) WaitUntilClusterResourceQuotasDeleted(t *testing.T, username string) error { t.Logf("waiting for deletion of ClusterResourceQuotas for user '%s'", username) - return wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { labels := map[string]string{ toolchainv1alpha1.SpaceLabelKey: username, } opts := client.MatchingLabels(labels) quotaList := "av1.ClusterResourceQuotaList{} - if err := a.Client.List(context.TODO(), quotaList, opts); err != nil { + if err := a.Client.List(ctx, quotaList, opts); err != nil { return false, err } if len(quotaList.Items) == 0 { @@ -2109,10 +2109,10 @@ func (a *MemberAwaitility) WaitForMemberStatus(t *testing.T, criteria ...MemberS t.Logf("waiting for MemberStatus '%s' to match criteria", name) // there should only be one member status with the name toolchain-member-status var memberStatus *toolchainv1alpha1.MemberStatus - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { // retrieve the memberstatus from the member namespace obj := &toolchainv1alpha1.MemberStatus{} - err = a.Client.Get(context.TODO(), + err = a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2162,10 +2162,10 @@ func (a *MemberAwaitility) WaitForMemberOperatorConfig(t *testing.T, hostAwait * name := "config" t.Logf("waiting for MemberOperatorConfig '%s'", name) memberOperatorConfig := &toolchainv1alpha1.MemberOperatorConfig{} - err := wait.Poll(a.RetryInterval, 2*a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.MemberOperatorConfig{} // retrieve the MemberOperatorConfig from the member namespace - err = a.Client.Get(context.TODO(), + err = a.Client.Get(ctx, types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2223,8 +2223,8 @@ func (a *MemberAwaitility) waitForUsersPodPriorityClass(t *testing.T) { } func (a *MemberAwaitility) waitForResource(t *testing.T, namespace, name string, object client.Object) { - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { - if err := a.Client.Get(context.TODO(), test.NamespacedName(namespace, name), object); err != nil { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { + if err := a.Client.Get(ctx, test.NamespacedName(namespace, name), object); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -2530,7 +2530,7 @@ func (a *MemberAwaitility) WaitForExpectedNumberOfClusterResources(t *testing.T, func (a *MemberAwaitility) waitForExpectedNumberOfResources(expected int, list func() (int, error)) (int, error) { var actual int - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { a, err := list() if err != nil { return false, err @@ -2543,9 +2543,9 @@ func (a *MemberAwaitility) waitForExpectedNumberOfResources(expected int, list f func (a *MemberAwaitility) UpdatePod(t *testing.T, namespace, podName string, modifyPod func(pod *corev1.Pod)) (*corev1.Pod, error) { var m *corev1.Pod - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshPod := &corev1.Pod{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: podName}, freshPod); err != nil { + if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: podName}, freshPod); err != nil { return true, err } @@ -2562,16 +2562,16 @@ func (a *MemberAwaitility) UpdatePod(t *testing.T, namespace, podName string, mo func (a *MemberAwaitility) UpdateConfigMap(t *testing.T, namespace, cmName string, modifyCM func(*corev1.ConfigMap)) (*corev1.ConfigMap, error) { var cm *corev1.ConfigMap - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ConfigMap{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{ + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: namespace, Name: cmName}, obj); err != nil { return true, err } modifyCM(obj) - if err := a.Client.Update(context.TODO(), obj); err != nil { + if err := a.Client.Update(ctx, obj); err != nil { t.Logf("error updating ConfigMap '%s' Will retry again...", cmName) return false, nil // nolint:nilerr } @@ -2584,9 +2584,9 @@ func (a *MemberAwaitility) UpdateConfigMap(t *testing.T, namespace, cmName strin func (a *MemberAwaitility) WaitForEnvironment(t *testing.T, namespace, name string, criteria ...LabelWaitCriterion) (*appstudiov1.Environment, error) { t.Logf("waiting for Environment resource '%s' to exist in namespace '%s'", name, namespace) var env *appstudiov1.Environment - err := wait.Poll(a.RetryInterval, a.Timeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &appstudiov1.Environment{} - if err := a.Client.Get(context.TODO(), types.NamespacedName{ + if err := a.Client.Get(ctx, types.NamespacedName{ Namespace: namespace, Name: name}, obj); errors.IsNotFound(err) { From d721a7979a16aa8d8f9d1b62cd5fe54715c13d4f Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Tue, 3 Sep 2024 22:17:42 -0400 Subject: [PATCH 04/20] replace timeout error check with context deadline check --- setup/operators/operators_test.go | 7 +++---- setup/wait/wait_test.go | 6 +++--- testsupport/wait/host.go | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/setup/operators/operators_test.go b/setup/operators/operators_test.go index 9c3a7a6da..735a4becb 100644 --- a/setup/operators/operators_test.go +++ b/setup/operators/operators_test.go @@ -85,7 +85,7 @@ func TestEnsureOperatorsInstalled(t *testing.T) { err := EnsureOperatorsInstalled(context.TODO(), cl, scheme, []string{"installtemplates/kiali.yaml"}) // then - require.ErrorContains(t, err, "could not find a Subscription with name 'kiali-ossm' in namespace 'openshift-operators' that meets the expected criteria: timed out waiting for the condition") + require.ErrorContains(t, err, "could not find a Subscription with name 'kiali-ossm' in namespace 'openshift-operators' that meets the expected criteria: context deadline exceeded") }) t.Run("error when getting csv", func(t *testing.T) { @@ -107,7 +107,7 @@ func TestEnsureOperatorsInstalled(t *testing.T) { err := EnsureOperatorsInstalled(context.TODO(), cl, scheme, []string{"installtemplates/kiali.yaml"}) // then - require.EqualError(t, err, "failed to find CSV 'kiali-operator.v1.24.7' with Phase 'Succeeded': could not find a CSV with name 'kiali-operator.v1.24.7' in namespace 'openshift-operators' that meets the expected criteria: timed out waiting for the condition") + require.EqualError(t, err, "failed to find CSV 'kiali-operator.v1.24.7' with Phase 'Succeeded': could not find a CSV with name 'kiali-operator.v1.24.7' in namespace 'openshift-operators' that meets the expected criteria: context deadline exceeded") }) t.Run("csv has wrong phase", func(t *testing.T) { @@ -131,9 +131,8 @@ func TestEnsureOperatorsInstalled(t *testing.T) { err = EnsureOperatorsInstalled(context.TODO(), cl, scheme, []string{"installtemplates/kiali.yaml"}) // then - require.EqualError(t, err, "failed to find CSV 'kiali-operator.v1.24.7' with Phase 'Succeeded': could not find a CSV with name 'kiali-operator.v1.24.7' in namespace 'openshift-operators' that meets the expected criteria: timed out waiting for the condition") + require.EqualError(t, err, "failed to find CSV 'kiali-operator.v1.24.7' with Phase 'Succeeded': could not find a CSV with name 'kiali-operator.v1.24.7' in namespace 'openshift-operators' that meets the expected criteria: context deadline exceeded") }) - t.Run("no subscription in template", func(t *testing.T) { // given cl := test.NewFakeClient(t) diff --git a/setup/wait/wait_test.go b/setup/wait/wait_test.go index 0d2a855f4..c4f425be4 100644 --- a/setup/wait/wait_test.go +++ b/setup/wait/wait_test.go @@ -51,7 +51,7 @@ func TestForSpace(t *testing.T) { // then require.Error(t, err) - assert.EqualError(t, err, "space 'user0001' is not ready yet: timed out waiting for the condition") + assert.EqualError(t, err, "space 'user0001' is not ready yet: context deadline exceeded") }) }) } @@ -181,7 +181,7 @@ func TestForSubscriptionWithCriteria(t *testing.T) { err := wait.ForSubscriptionWithCriteria(cl, "test-prefix", "test-ns", configuration.DefaultTimeout) // then - require.EqualError(t, err, `could not find a Subscription with name 'test-prefix' in namespace 'test-ns' that meets the expected criteria: timed out waiting for the condition`) + require.EqualError(t, err, `could not find a Subscription with name 'test-prefix' in namespace 'test-ns' that meets the expected criteria: context deadline exceeded`) }) t.Run("client error", func(t *testing.T) { @@ -324,7 +324,7 @@ func TestForCSVWithCriteria(t *testing.T) { err := wait.ForCSVWithCriteria(cl, "test-prefix", "test-ns", time.Millisecond) // then - require.EqualError(t, err, `could not find a CSV with name 'test-prefix' in namespace 'test-ns' that meets the expected criteria: timed out waiting for the condition`) + require.EqualError(t, err, `could not find a CSV with name 'test-prefix' in namespace 'test-ns' that meets the expected criteria: context deadline exceeded`) }) t.Run("client error", func(t *testing.T) { diff --git a/testsupport/wait/host.go b/testsupport/wait/host.go index c17c43977..232075705 100644 --- a/testsupport/wait/host.go +++ b/testsupport/wait/host.go @@ -889,7 +889,7 @@ func (a *HostAwaitility) CheckMasterUserRecordIsDeleted(t *testing.T, name strin } return false, fmt.Errorf("the MasterUserRecord '%s' should not be present, but it is", name) }) - require.Equal(t, wait.ErrorInterrupted(goerr.New("timed out waiting for the condition")), err) + require.Equal(t, wait.ErrorInterrupted(goerr.New("context deadline exceeded")), err) } func containsUserAccountStatus(uaStatuses []toolchainv1alpha1.UserAccountStatusEmbedded, uaStatus toolchainv1alpha1.UserAccountStatusEmbedded) bool { @@ -1277,7 +1277,7 @@ func (a *HostAwaitility) WaitForNotificationToNotBeCreated(t *testing.T, notific if err == nil { return fmt.Errorf("notification '%s' was found, but it was expected to not be created/present: \n %v", notificationName, notification) } - if goerr.Is(err, wait.ErrorInterrupted(goerr.New("timed out waiting for the condition"))) { + if goerr.Is(err, wait.ErrorInterrupted(goerr.New("context deadline exceeded"))) { return nil } return err From 6a7f9f1341a0ca41e994aa64098b702edd3da4b4 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Wed, 4 Sep 2024 00:17:00 -0400 Subject: [PATCH 05/20] use context error instead --- testsupport/wait/host.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsupport/wait/host.go b/testsupport/wait/host.go index 232075705..11e41919a 100644 --- a/testsupport/wait/host.go +++ b/testsupport/wait/host.go @@ -889,7 +889,7 @@ func (a *HostAwaitility) CheckMasterUserRecordIsDeleted(t *testing.T, name strin } return false, fmt.Errorf("the MasterUserRecord '%s' should not be present, but it is", name) }) - require.Equal(t, wait.ErrorInterrupted(goerr.New("context deadline exceeded")), err) + require.Equal(t, context.DeadlineExceeded, err) } func containsUserAccountStatus(uaStatuses []toolchainv1alpha1.UserAccountStatusEmbedded, uaStatus toolchainv1alpha1.UserAccountStatusEmbedded) bool { @@ -1277,7 +1277,7 @@ func (a *HostAwaitility) WaitForNotificationToNotBeCreated(t *testing.T, notific if err == nil { return fmt.Errorf("notification '%s' was found, but it was expected to not be created/present: \n %v", notificationName, notification) } - if goerr.Is(err, wait.ErrorInterrupted(goerr.New("context deadline exceeded"))) { + if goerr.Is(err, context.DeadlineExceeded) { return nil } return err From d851aa154b2a5dc0a3ddea73938645ba13433e5a Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Wed, 4 Sep 2024 23:49:09 -0400 Subject: [PATCH 06/20] try matching interval time to client-go --- testsupport/wait/awaitility.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsupport/wait/awaitility.go b/testsupport/wait/awaitility.go index 5bb073a46..2ef5a3f58 100644 --- a/testsupport/wait/awaitility.go +++ b/testsupport/wait/awaitility.go @@ -40,7 +40,7 @@ import ( ) const ( - DefaultRetryInterval = time.Millisecond * 100 // make it short because a "retry interval" is waited before the first test + DefaultRetryInterval = time.Millisecond * 50 // make it short because a "retry interval" is waited before the first test DefaultTimeout = time.Second * 120 MemberNsVar = "MEMBER_NS" MemberNsVar2 = "MEMBER_NS_2" From d578dd1841f26ac6853f057c4f7406d3fe5e1e32 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Fri, 6 Sep 2024 01:25:43 -0400 Subject: [PATCH 07/20] try using new context within PollUntilCOntextTimeout to be used with Get, revert retryInterval --- testsupport/wait/awaitility.go | 2 +- testsupport/wait/host.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testsupport/wait/awaitility.go b/testsupport/wait/awaitility.go index 2ef5a3f58..5bb073a46 100644 --- a/testsupport/wait/awaitility.go +++ b/testsupport/wait/awaitility.go @@ -40,7 +40,7 @@ import ( ) const ( - DefaultRetryInterval = time.Millisecond * 50 // make it short because a "retry interval" is waited before the first test + DefaultRetryInterval = time.Millisecond * 100 // make it short because a "retry interval" is waited before the first test DefaultTimeout = time.Second * 120 MemberNsVar = "MEMBER_NS" MemberNsVar2 = "MEMBER_NS_2" diff --git a/testsupport/wait/host.go b/testsupport/wait/host.go index 11e41919a..f1e1cba16 100644 --- a/testsupport/wait/host.go +++ b/testsupport/wait/host.go @@ -1266,7 +1266,7 @@ func (a *HostAwaitility) WaitForNotificationToNotBeCreated(t *testing.T, notific notification := &toolchainv1alpha1.Notification{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { notification = &toolchainv1alpha1.Notification{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { if errors.IsNotFound(err) { return false, nil } From 0fbde88b06dcab49fbee4c1d82f499b2e481547e Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Fri, 6 Sep 2024 10:04:34 -0400 Subject: [PATCH 08/20] correct version of common in replace after merge --- go.mod | 2 +- go.sum | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a3fd3975a..efdcd71db 100644 --- a/go.mod +++ b/go.mod @@ -123,5 +123,5 @@ go 1.20 replace ( github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 => github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b - github.com/codeready-toolchain/toolchain-common v0.0.0-20240816011540-2184e6268b4a => github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240826144207-8833deda63a9 => github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 ) diff --git a/go.sum b/go.sum index 899d5ddbd..efb86a5bc 100644 --- a/go.sum +++ b/go.sum @@ -121,10 +121,6 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 h1:uEH8HAM81QZBccuqQpGKJUoJQe28+DFSYi/mRKZDYrA= -github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240826144207-8833deda63a9 h1:QvFitl9RXiO8tUAwo83zdt8pMi2uoBUu6kblc/1oeno= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240826144207-8833deda63a9/go.mod h1:aIbki5CFsykeqZn2/ZwvUb3Krx2f2Tbq58R6MGnk6H8= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= From 9a98bd503dbacbaaf08b2224ef328e53391d2847 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Thu, 12 Sep 2024 19:18:21 -0400 Subject: [PATCH 09/20] remove propagated context when api client call is being made with pollUntillContextTimeoout --- setup/idlers/update_idler.go | 2 +- setup/users/create_users.go | 2 +- setup/wait/wait.go | 2 +- test/e2e/parallel/proxy_test.go | 2 +- testsupport/cleanup/clean.go | 2 +- testsupport/wait/awaitility.go | 24 +++---- testsupport/wait/host.go | 88 ++++++++++++------------- testsupport/wait/member.go | 112 ++++++++++++++++---------------- 8 files changed, 117 insertions(+), 117 deletions(-) diff --git a/setup/idlers/update_idler.go b/setup/idlers/update_idler.go index 6b0ebf9e0..bc889e105 100644 --- a/setup/idlers/update_idler.go +++ b/setup/idlers/update_idler.go @@ -34,7 +34,7 @@ func UpdateTimeout(cl client.Client, username string, timeout time.Duration) err func getIdler(cl client.Client, name string) (*toolchainv1alpha1.Idler, error) { idler := &toolchainv1alpha1.Idler{} err := k8swait.PollUntilContextTimeout(context.TODO(), cfg.DefaultRetryInterval, cfg.DefaultTimeout, true, func(ctx context.Context) (bool, error) { - err := cl.Get(ctx, types.NamespacedName{ + err := cl.Get(context.TODO(), types.NamespacedName{ Name: name, }, idler) if errors.IsNotFound(err) { diff --git a/setup/users/create_users.go b/setup/users/create_users.go index ef68c76aa..6b45757d2 100644 --- a/setup/users/create_users.go +++ b/setup/users/create_users.go @@ -53,7 +53,7 @@ func getMemberClusterName(cl client.Client, hostOperatorNamespace, memberOperato var memberCluster toolchainv1alpha1.ToolchainCluster err := k8swait.PollUntilContextTimeout(context.TODO(), configuration.DefaultRetryInterval, configuration.DefaultTimeout, true, func(ctx context.Context) (bool, error) { clusters := &toolchainv1alpha1.ToolchainClusterList{} - if err := cl.List(ctx, clusters, client.InNamespace(hostOperatorNamespace), client.MatchingLabels{ + if err := cl.List(context.TODO(), clusters, client.InNamespace(hostOperatorNamespace), client.MatchingLabels{ "namespace": memberOperatorNamespace, }); err != nil { return false, err diff --git a/setup/wait/wait.go b/setup/wait/wait.go index 72342a8ed..0d002d369 100644 --- a/setup/wait/wait.go +++ b/setup/wait/wait.go @@ -28,7 +28,7 @@ func ForSpace(cl client.Client, space string) error { } if err := k8swait.PollUntilContextTimeout(context.TODO(), configuration.DefaultRetryInterval, configuration.DefaultTimeout, true, func(ctx context.Context) (bool, error) { - err := cl.Get(ctx, types.NamespacedName{ + err := cl.Get(context.TODO(), types.NamespacedName{ Name: space, Namespace: configuration.HostOperatorNamespace, }, sp) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 113db965d..bf9b24efe 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -115,7 +115,7 @@ func (u *proxyUser) getWorkspace(t *testing.T, hostAwait *wait.HostAwaitility, w var cause error // only wait up to 5 seconds because in some test cases the workspace is not expected to be found _ = kubewait.PollUntilContextTimeout(context.TODO(), wait.DefaultRetryInterval, 5*time.Second, true, func(ctx context.Context) (bool, error) { - cause = proxyCl.Get(ctx, types.NamespacedName{Name: workspaceName}, workspace) + cause = proxyCl.Get(context.TODO(), types.NamespacedName{Name: workspaceName}, workspace) return cause == nil, nil }) diff --git a/testsupport/cleanup/clean.go b/testsupport/cleanup/clean.go index a25352182..967f1df09 100644 --- a/testsupport/cleanup/clean.go +++ b/testsupport/cleanup/clean.go @@ -130,7 +130,7 @@ func (c *cleanTask) cleanObject() { // wait until deletion is done c.t.Logf("waiting until %s: %s is completely deleted", kind, objToClean.GetName()) err := wait.PollUntilContextTimeout(context.TODO(), defaultRetryInterval, defaultTimeout, true, func(ctx context.Context) (done bool, err error) { - if err := c.client.Get(ctx, test.NamespacedName(objToClean.GetNamespace(), objToClean.GetName()), objToClean); err != nil { + if err := c.client.Get(context.TODO(), test.NamespacedName(objToClean.GetNamespace(), objToClean.GetName()), objToClean); err != nil { if errors.IsNotFound(err) { // if the object was UserSignup, then let's check that the MUR is deleted as well if murDeleted, err := c.verifyMurDeleted(isUserSignup, userSignup, false); !murDeleted || err != nil { diff --git a/testsupport/wait/awaitility.go b/testsupport/wait/awaitility.go index 59af68132..e657dcf1f 100644 --- a/testsupport/wait/awaitility.go +++ b/testsupport/wait/awaitility.go @@ -135,7 +135,7 @@ func (a *Awaitility) WaitForService(t *testing.T, name string) (corev1.Service, err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { metricsSvc = &corev1.Service{} // retrieve the metrics service from the namespace - err = a.Client.Get(ctx, + err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -238,7 +238,7 @@ func (a *Awaitility) WaitForRouteToBeAvailable(t *testing.T, ns, name, endpoint route := routev1.Route{} // retrieve the route for the registration service err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { - if err = a.Client.Get(ctx, + if err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: ns, Name: name, @@ -389,7 +389,7 @@ func (a *Awaitility) GetMemoryUsage(podname, ns string) (int64, error) { var containerMetrics k8smetrics.ContainerMetrics if err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { podMetrics := k8smetrics.PodMetrics{} - if err := a.Client.Get(ctx, types.NamespacedName{ + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: ns, Name: podname, }, &podMetrics); err != nil && !apierrors.IsNotFound(err) { @@ -421,7 +421,7 @@ func (a *Awaitility) CreateNamespace(t *testing.T, name string) { require.NoError(t, err) err = wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { ns := &corev1.Namespace{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, ns); err != nil && apierrors.IsNotFound(err) { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, ns); err != nil && apierrors.IsNotFound(err) { return false, nil } else if err != nil { return false, err @@ -443,7 +443,7 @@ func (a *Awaitility) WaitForDeploymentToGetReady(t *testing.T, name string, repl err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 6*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &appsv1.Deployment{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if apierrors.IsNotFound(err) { return false, nil } @@ -457,7 +457,7 @@ func (a *Awaitility) WaitForDeploymentToGetReady(t *testing.T, name string, repl return false, nil } pods := &corev1.PodList{} - require.NoError(t, a.Client.List(ctx, pods, client.InNamespace(a.Namespace), client.MatchingLabels(obj.Spec.Selector.MatchLabels))) + require.NoError(t, a.Client.List(context.TODO(), pods, client.InNamespace(a.Namespace), client.MatchingLabels(obj.Spec.Selector.MatchLabels))) if len(pods.Items) != replicas { return false, nil } @@ -506,7 +506,7 @@ func (a *Awaitility) WaitForToolchainCluster(t *testing.T, criteria ...Toolchain var cl *toolchainv1alpha1.ToolchainCluster err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { clusters = &toolchainv1alpha1.ToolchainClusterList{} - if err := a.Client.List(ctx, clusters, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(context.TODO(), clusters, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, obj := range clusters.Items { @@ -586,11 +586,11 @@ func (a *Awaitility) UpdateToolchainCluster(t *testing.T, toolchainClusterName s var tc *toolchainv1alpha1.ToolchainCluster err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { newToolchainCluster := &toolchainv1alpha1.ToolchainCluster{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: toolchainClusterName}, newToolchainCluster); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: toolchainClusterName}, newToolchainCluster); err != nil { return true, err } modifyToolchainCluster(newToolchainCluster) - if err := a.Client.Update(ctx, newToolchainCluster); err != nil { + if err := a.Client.Update(context.TODO(), newToolchainCluster); err != nil { t.Logf("error updating ToolchainCluster '%s': %s. Will retry again...", toolchainClusterName, err.Error()) return false, nil } @@ -692,7 +692,7 @@ func (w *Waiter[T]) FirstThat(predicates ...assertions.Predicate[client.Object]) // items. list := &unstructured.UnstructuredList{} list.SetGroupVersionKind(w.gvk) - if err := w.await.Client.List(ctx, list, client.InNamespace(w.await.Namespace)); err != nil { + if err := w.await.Client.List(context.TODO(), list, client.InNamespace(w.await.Namespace)); err != nil { return false, err } for _, obj := range list.Items { @@ -768,7 +768,7 @@ func (w *Waiter[T]) WithNameThat(name string, predicates ...assertions.Predicate err := wait.PollUntilContextTimeout(context.TODO(), w.await.RetryInterval, w.await.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &unstructured.Unstructured{} obj.SetGroupVersionKind(w.gvk) - if err := w.await.Client.Get(ctx, client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { + if err := w.await.Client.Get(context.TODO(), client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { if apierrors.IsNotFound(err) { return false, nil } @@ -819,7 +819,7 @@ func (w *Waiter[T]) WithNameDeleted(name string) error { err := wait.PollUntilContextTimeout(context.TODO(), w.await.RetryInterval, w.await.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &unstructured.Unstructured{} obj.SetGroupVersionKind(w.gvk) - if err := w.await.Client.Get(ctx, client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { + if err := w.await.Client.Get(context.TODO(), client.ObjectKey{Name: name, Namespace: w.await.Namespace}, obj); err != nil { if apierrors.IsNotFound(err) { return true, nil } diff --git a/testsupport/wait/host.go b/testsupport/wait/host.go index f1e1cba16..194334f14 100644 --- a/testsupport/wait/host.go +++ b/testsupport/wait/host.go @@ -148,7 +148,7 @@ func (a *HostAwaitility) WaitForMasterUserRecord(t *testing.T, name string, crit var mur *toolchainv1alpha1.MasterUserRecord err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -193,18 +193,18 @@ func (a *HostAwaitility) UpdateMasterUserRecord(t *testing.T, status bool, murNa var m *toolchainv1alpha1.MasterUserRecord err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshMur := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: murName}, freshMur); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: murName}, freshMur); err != nil { return true, err } modifyMur(freshMur) if status { // Update status - if err := a.Client.Status().Update(ctx, freshMur); err != nil { + if err := a.Client.Status().Update(context.TODO(), freshMur); err != nil { t.Logf("error updating MasterUserRecord.Status '%s': %s. Will retry again...", murName, err.Error()) return false, nil } - } else if err := a.Client.Update(ctx, freshMur); err != nil { + } else if err := a.Client.Update(context.TODO(), freshMur); err != nil { t.Logf("error updating MasterUserRecord.Spec '%s': %s. Will retry again...", murName, err.Error()) return false, nil } @@ -221,12 +221,12 @@ func (a *HostAwaitility) UpdateUserSignup(t *testing.T, userSignupName string, m var userSignup *toolchainv1alpha1.UserSignup err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshUserSignup := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: userSignupName}, freshUserSignup); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: userSignupName}, freshUserSignup); err != nil { return true, err } modifyUserSignup(freshUserSignup) - if err := a.Client.Update(ctx, freshUserSignup); err != nil { + if err := a.Client.Update(context.TODO(), freshUserSignup); err != nil { t.Logf("error updating UserSignup '%s': %s. Will retry again...", userSignupName, err.Error()) return false, nil } @@ -243,11 +243,11 @@ func (a *HostAwaitility) UpdateSpace(t *testing.T, spaceName string, modifySpace var s *toolchainv1alpha1.Space err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpace := &toolchainv1alpha1.Space{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: spaceName}, freshSpace); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: spaceName}, freshSpace); err != nil { return true, err } modifySpace(freshSpace) - if err := a.Client.Update(ctx, freshSpace); err != nil { + if err := a.Client.Update(context.TODO(), freshSpace); err != nil { t.Logf("error updating Space '%s': %s. Will retry again...", spaceName, err.Error()) return false, nil } @@ -264,11 +264,11 @@ func (a *HostAwaitility) UpdateSpaceBinding(t *testing.T, spaceBindingName strin var s *toolchainv1alpha1.SpaceBinding err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpaceBinding := &toolchainv1alpha1.SpaceBinding{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: spaceBindingName}, freshSpaceBinding); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: spaceBindingName}, freshSpaceBinding); err != nil { return true, err } modifySpaceBinding(freshSpaceBinding) - if err := a.Client.Update(ctx, freshSpaceBinding); err != nil { + if err := a.Client.Update(context.TODO(), freshSpaceBinding); err != nil { t.Logf("error updating SpaceBinding '%s': %s. Will retry again...", spaceBindingName, err.Error()) return false, nil } @@ -658,7 +658,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay time.Sleep(initialDelay) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { usList := &toolchainv1alpha1.UserSignupList{} - if err := a.Client.List(ctx, usList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(context.TODO(), usList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, us := range usList.Items { @@ -668,7 +668,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } murList := &toolchainv1alpha1.MasterUserRecordList{} - if err := a.Client.List(ctx, murList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(context.TODO(), murList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, mur := range murList.Items { @@ -678,7 +678,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } spaceBindingList := &toolchainv1alpha1.SpaceBindingList{} - if err := a.Client.List(ctx, spaceBindingList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(context.TODO(), spaceBindingList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, spaceBinding := range spaceBindingList.Items { @@ -688,7 +688,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } spaceList := &toolchainv1alpha1.SpaceList{} - if err := a.Client.List(ctx, spaceList, client.InNamespace(a.Namespace)); err != nil { + if err := a.Client.List(context.TODO(), spaceList, client.InNamespace(a.Namespace)); err != nil { return false, err } for _, space := range spaceList.Items { @@ -698,7 +698,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } nsTemplateSetList := &toolchainv1alpha1.NSTemplateSetList{} - if err := a.Client.List(ctx, nsTemplateSetList); err != nil { + if err := a.Client.List(context.TODO(), nsTemplateSetList); err != nil { return false, err } for _, nsTemplateSet := range nsTemplateSetList.Items { @@ -708,7 +708,7 @@ func (a *HostAwaitility) WaitForTestResourcesCleanup(t *testing.T, initialDelay } namespaceList := &corev1.NamespaceList{} - if err := a.Client.List(ctx, namespaceList); err != nil { + if err := a.Client.List(context.TODO(), namespaceList); err != nil { return false, err } for _, namespace := range namespaceList.Items { @@ -726,7 +726,7 @@ func (a *HostAwaitility) WaitForUserSignup(t *testing.T, name string, criteria . var userSignup *toolchainv1alpha1.UserSignup err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -749,9 +749,9 @@ func (a *HostAwaitility) WaitForUserSignupByUserIDAndUsername(t *testing.T, user var userSignup *toolchainv1alpha1.UserSignup err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: userID}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: userID}, obj); err != nil { if errors.IsNotFound(err) { - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: encodedUsername}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: encodedUsername}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -777,7 +777,7 @@ func (a *HostAwaitility) WaitAndVerifyThatUserSignupIsNotCreated(t *testing.T, n var userSignup *toolchainv1alpha1.UserSignup err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -798,7 +798,7 @@ func (a *HostAwaitility) WaitForBannedUser(t *testing.T, email string) (*toolcha labels := map[string]string{toolchainv1alpha1.BannedUserEmailHashLabelKey: hash.EncodeString(email)} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { bannedUserList := &toolchainv1alpha1.BannedUserList{} - if err = a.Client.List(ctx, bannedUserList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { + if err = a.Client.List(context.TODO(), bannedUserList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { if len(bannedUserList.Items) == 0 { return false, nil } @@ -832,7 +832,7 @@ func (a *HostAwaitility) WaitUntilBannedUserDeleted(t *testing.T, name string) e t.Logf("waiting until BannedUser '%s' in namespace '%s' is deleted", name, a.Namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { user := &toolchainv1alpha1.BannedUser{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, user); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, user); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -847,7 +847,7 @@ func (a *HostAwaitility) WaitUntilUserSignupDeleted(t *testing.T, name string) e t.Logf("waiting until UserSignup '%s' in namespace '%s is deleted", name, a.Namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { userSignup := &toolchainv1alpha1.UserSignup{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, userSignup); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, userSignup); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -862,7 +862,7 @@ func (a *HostAwaitility) WaitUntilMasterUserRecordAndSpaceBindingsDeleted(t *tes t.Logf("waiting until MasterUserRecord '%s' in namespace '%s' is deleted", name, a.Namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { mur := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { if errors.IsNotFound(err) { // once the MUR is deleted, wait for the associated spacebindings to be deleted as well if err := a.WaitUntilSpaceBindingsWithLabelDeleted(t, toolchainv1alpha1.SpaceBindingMasterUserRecordLabelKey, name); err != nil { @@ -881,7 +881,7 @@ func (a *HostAwaitility) CheckMasterUserRecordIsDeleted(t *testing.T, name strin t.Logf("checking that MasterUserRecord '%s' in namespace '%s' is deleted", name, a.Namespace) err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*time.Second, true, func(ctx context.Context) (done bool, err error) { mur := &toolchainv1alpha1.MasterUserRecord{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -908,7 +908,7 @@ func (a *HostAwaitility) WaitForUserTier(t *testing.T, name string, criteria ... tier := &toolchainv1alpha1.UserTier{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserTier{} - err = a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) + err = a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) if err != nil && !errors.IsNotFound(err) { // return the error return false, err @@ -992,7 +992,7 @@ func (a *HostAwaitility) WaitForNSTemplateTier(t *testing.T, name string, criter tier := &toolchainv1alpha1.NSTemplateTier{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.NSTemplateTier{} - err = a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) + err = a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj) if err != nil && !errors.IsNotFound(err) { // return the error return false, err @@ -1045,7 +1045,7 @@ func (a *HostAwaitility) WaitForTierTemplate(t *testing.T, name string) (*toolch t.Logf("waiting until TierTemplate '%s' exists in namespace '%s'...", name, a.Namespace) err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.TierTemplate{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1217,7 +1217,7 @@ func (a *HostAwaitility) WaitForNotifications(t *testing.T, username, notificati labels := map[string]string{toolchainv1alpha1.NotificationUserNameLabelKey: username, toolchainv1alpha1.NotificationTypeLabelKey: notificationType} opts := client.MatchingLabels(labels) notificationList := &toolchainv1alpha1.NotificationList{} - if err := a.Client.List(ctx, notificationList, opts); err != nil { + if err := a.Client.List(context.TODO(), notificationList, opts); err != nil { return false, err } notifications = notificationList.Items @@ -1239,7 +1239,7 @@ func (a *HostAwaitility) WaitForNotificationWithName(t *testing.T, notificationN notification := &toolchainv1alpha1.Notification{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { notification = &toolchainv1alpha1.Notification{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1290,7 +1290,7 @@ func (a *HostAwaitility) WaitUntilNotificationsDeleted(t *testing.T, username, n labels := map[string]string{toolchainv1alpha1.NotificationUserNameLabelKey: username, toolchainv1alpha1.NotificationTypeLabelKey: notificationType} opts := client.MatchingLabels(labels) notificationList := &toolchainv1alpha1.NotificationList{} - if err := a.Client.List(ctx, notificationList, opts); err != nil { + if err := a.Client.List(context.TODO(), notificationList, opts); err != nil { return false, err } return len(notificationList.Items) == 0, nil @@ -1302,7 +1302,7 @@ func (a *HostAwaitility) WaitUntilNotificationWithNameDeleted(t *testing.T, noti t.Logf("waiting for notification with name '%s' to get deleted", notificationName) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { notification := &toolchainv1alpha1.Notification{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: notificationName, Namespace: a.Namespace}, notification); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1496,7 +1496,7 @@ func (a *HostAwaitility) WaitForToolchainStatus(t *testing.T, criteria ...Toolch err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.ToolchainStatus{} // retrieve the toolchainstatus from the host namespace - err = a.Client.Get(ctx, + err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -1520,7 +1520,7 @@ func (a *HostAwaitility) WaitForToolchainStatus(t *testing.T, criteria ...Toolch func (a *HostAwaitility) waitForResource(t *testing.T, namespace, name string, object client.Object) { err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { - if err := a.Client.Get(ctx, test.NamespacedName(namespace, name), object); err != nil { + if err := a.Client.Get(context.TODO(), test.NamespacedName(namespace, name), object); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1662,7 +1662,7 @@ func (a *HostAwaitility) WaitForToolchainConfig(t *testing.T, criteria ...Toolch err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.ToolchainConfig{} // retrieve the ToolchainConfig from the host namespace - if err := a.Client.Get(ctx, + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -1753,7 +1753,7 @@ func (a *HostAwaitility) updateToolchainConfigWithRetry(t *testing.T, updatedCon err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { config := a.GetToolchainConfig(t) config.Spec = updatedConfig.Spec - if err := a.Client.Update(ctx, config); err != nil { + if err := a.Client.Update(context.TODO(), config); err != nil { t.Logf("Retrying ToolchainConfig update due to error: %s", err.Error()) return false, nil } @@ -1840,7 +1840,7 @@ func (a *HostAwaitility) WaitForSpace(t *testing.T, name string, criteria ...Spa err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Space{} // retrieve the Space from the host namespace - if err := a.Client.Get(ctx, + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -1866,7 +1866,7 @@ func (a *HostAwaitility) WaitForProxyPlugin(t *testing.T, name string) (*toolcha var proxyPlugin *toolchainv1alpha1.ProxyPlugin err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.ProxyPlugin{} - if err = a.Client.Get(ctx, + if err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2121,7 +2121,7 @@ func (a *HostAwaitility) WaitUntilSpaceAndSpaceBindingsDeleted(t *testing.T, nam var s *toolchainv1alpha1.Space err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Space{} - if err := a.Client.Get(ctx, + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2150,7 +2150,7 @@ func (a *HostAwaitility) WaitUntilSpaceAndSpaceBindingsDeleted(t *testing.T, nam func (a *HostAwaitility) WaitUntilSpaceBindingDeleted(name string) error { return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { mur := &toolchainv1alpha1.SpaceBinding{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, mur); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -2168,7 +2168,7 @@ func (a *HostAwaitility) WaitUntilSpaceBindingsWithLabelDeleted(t *testing.T, ke err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { // retrieve the SpaceBinding from the host namespace spaceBindingList = &toolchainv1alpha1.SpaceBindingList{} - if err = a.Client.List(ctx, spaceBindingList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { + if err = a.Client.List(context.TODO(), spaceBindingList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { return false, err } return len(spaceBindingList.Items) == 0, nil @@ -2212,7 +2212,7 @@ func (a *HostAwaitility) WaitForSubSpace(t *testing.T, spaceRequestName, spaceRe err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { // retrieve the subSpace from the host namespace spaceList := &toolchainv1alpha1.SpaceList{} - if err = a.Client.List(ctx, spaceList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { + if err = a.Client.List(context.TODO(), spaceList, client.MatchingLabels(labels), client.InNamespace(a.Namespace)); err != nil { return false, err } if len(spaceList.Items) == 0 { @@ -2408,7 +2408,7 @@ func (a *HostAwaitility) WaitForSocialEvent(t *testing.T, name string, criteria err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.SocialEvent{} // retrieve the Space from the host namespace - if err := a.Client.Get(ctx, + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2538,7 +2538,7 @@ func (a *HostAwaitility) CreateSpaceAndSpaceBinding(t *testing.T, mur *toolchain // let's see if space was provisioned as expected spaceCreated = &toolchainv1alpha1.Space{} - err = a.Client.Get(ctx, client.ObjectKeyFromObject(spaceToCreate), spaceCreated) + err = a.Client.Get(context.TODO(), client.ObjectKeyFromObject(spaceToCreate), spaceCreated) if err != nil { if errors.IsNotFound(err) { testutil.LogWithTimestamp(t, fmt.Sprintf("The created Space %s is not present in namespace %s", spaceToCreate.Name, spaceToCreate.Namespace)) diff --git a/testsupport/wait/member.go b/testsupport/wait/member.go index 3b9c19008..a8276b039 100644 --- a/testsupport/wait/member.go +++ b/testsupport/wait/member.go @@ -250,7 +250,7 @@ func (a *MemberAwaitility) WaitForUserAccount(t *testing.T, name string, criteri var userAccount *toolchainv1alpha1.UserAccount err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.UserAccount{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -277,7 +277,7 @@ func (a *MemberAwaitility) WaitForSpaceRequest(t *testing.T, namespacedName type var spaceRequest *toolchainv1alpha1.SpaceRequest err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.SpaceRequest{} - if err := a.Client.Get(ctx, namespacedName, obj); err != nil { + if err := a.Client.Get(context.TODO(), namespacedName, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -462,7 +462,7 @@ func (a *MemberAwaitility) WaitForSpaceBindingRequest(t *testing.T, namespacedNa var spaceBindingRequest *toolchainv1alpha1.SpaceBindingRequest err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.SpaceBindingRequest{} - if err := a.Client.Get(ctx, namespacedName, obj); err != nil { + if err := a.Client.Get(context.TODO(), namespacedName, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -727,7 +727,7 @@ func (a *MemberAwaitility) WaitForNSTmplSet(t *testing.T, name string, criteria var nsTmplSet *toolchainv1alpha1.NSTemplateSet err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.NSTemplateSet{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -748,7 +748,7 @@ func (a *MemberAwaitility) WaitUntilNSTemplateSetDeleted(t *testing.T, name stri t.Logf("waiting for until NSTemplateSet '%s' in namespace '%s' is deleted", name, a.Namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { nsTmplSet := &toolchainv1alpha1.NSTemplateSet{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, nsTmplSet); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, nsTmplSet); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -839,7 +839,7 @@ func (a *MemberAwaitility) WaitForNamespace(t *testing.T, owner, tmplRef, tierNa err = wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { nss := &corev1.NamespaceList{} opts := client.MatchingLabels(labels) - if err := a.Client.List(ctx, nss, opts); err != nil { + if err := a.Client.List(context.TODO(), nss, opts); err != nil { return false, err } if len(nss.Items) != 1 { @@ -870,9 +870,9 @@ func (a *MemberAwaitility) WaitForNamespace(t *testing.T, owner, tmplRef, tierNa // WaitForNamespaceWithName waits until a namespace with the given name func (a *MemberAwaitility) WaitForNamespaceWithName(t *testing.T, name string, criteria ...LabelWaitCriterion) (*corev1.Namespace, error) { ns := &corev1.Namespace{} - err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(wa context.Context) (done bool, err error) { obj := &corev1.Namespace{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -926,7 +926,7 @@ func (a *MemberAwaitility) WaitForNamespaceInTerminating(t *testing.T, nsName st ns := &corev1.Namespace{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Namespace{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: nsName}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: nsName}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -971,7 +971,7 @@ func (a *MemberAwaitility) WaitForRoleBinding(t *testing.T, namespace *corev1.Na roleBinding := &rbacv1.RoleBinding{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &rbacv1.RoleBinding{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -994,7 +994,7 @@ func (a *MemberAwaitility) WaitUntilRoleBindingDeleted(t *testing.T, namespace * t.Logf("waiting for RoleBinding '%s' in namespace '%s' to be deleted", name, namespace.Name) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { roleBinding := &rbacv1.RoleBinding{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, roleBinding); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, roleBinding); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1009,7 +1009,7 @@ func (a *MemberAwaitility) WaitForServiceAccount(t *testing.T, namespace string, serviceAccount := &corev1.ServiceAccount{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ServiceAccount{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1031,10 +1031,10 @@ func (a *MemberAwaitility) WaitForLimitRange(t *testing.T, namespace *corev1.Nam lr := &corev1.LimitRange{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.LimitRange{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { allLRs := &corev1.LimitRangeList{} - if err := a.Client.List(ctx, allLRs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { + if err := a.Client.List(context.TODO(), allLRs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { return false, err } return false, nil @@ -1056,10 +1056,10 @@ func (a *MemberAwaitility) WaitForNetworkPolicy(t *testing.T, namespace *corev1. np := &netv1.NetworkPolicy{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &netv1.NetworkPolicy{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { allNPs := &netv1.NetworkPolicyList{} - if err := a.Client.List(ctx, allNPs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { + if err := a.Client.List(context.TODO(), allNPs, client.MatchingLabels(codereadyToolchainProviderLabel)); err != nil { return false, err } return false, nil @@ -1081,7 +1081,7 @@ func (a *MemberAwaitility) WaitForRole(t *testing.T, namespace *corev1.Namespace role := &rbacv1.Role{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &rbacv1.Role{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace.Name, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1102,7 +1102,7 @@ func (a *MemberAwaitility) WaitUntilRoleDeleted(t *testing.T, namespace *corev1. t.Logf("waiting for Role '%s' in namespace '%s' to be deleted", name, namespace.Name) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { role := &rbacv1.Role{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name, Namespace: a.Namespace}, role); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: a.Namespace}, role); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1179,11 +1179,11 @@ func (a *MemberAwaitility) WaitForClusterResourceQuota(t *testing.T, name string quota := "av1.ClusterResourceQuota{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := "av1.ClusterResourceQuota{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, obj); err != nil { if errors.IsNotFound(err) { quotaList := "av1.ClusterResourceQuotaList{} ls := codereadyToolchainProviderLabel - if err := a.Client.List(ctx, quotaList, client.MatchingLabels(ls)); err != nil { + if err := a.Client.List(context.TODO(), quotaList, client.MatchingLabels(ls)); err != nil { return false, err } return false, nil @@ -1244,7 +1244,7 @@ func (a *MemberAwaitility) WaitForResourceQuota(t *testing.T, namespace, name st quota := &corev1.ResourceQuota{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ResourceQuota{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1356,7 +1356,7 @@ func (a *MemberAwaitility) WaitForIdler(t *testing.T, name string, criteria ...I idler := &toolchainv1alpha1.Idler{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Idler{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, obj); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1377,11 +1377,11 @@ func (a *MemberAwaitility) UpdateIdlerSpec(t *testing.T, idler *toolchainv1alpha var result *toolchainv1alpha1.Idler err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.Idler{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: idler.Name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: idler.Name}, obj); err != nil { return false, err } obj.Spec = idler.Spec - if err := a.Client.Update(ctx, obj); err != nil { + if err := a.Client.Update(context.TODO(), obj); err != nil { t.Logf("trying to update Idler %s. Error: %s. Will try to update again.", idler.Name, err.Error()) return false, nil } @@ -1398,11 +1398,11 @@ func (a *MemberAwaitility) UpdateNamespace(t *testing.T, nsName string, modifyNa var ns *corev1.Namespace err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshNs := &corev1.Namespace{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: nsName}, freshNs); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: nsName}, freshNs); err != nil { return true, err } modifyNamespace(freshNs) - if err := a.Client.Update(ctx, freshNs); err != nil { + if err := a.Client.Update(context.TODO(), freshNs); err != nil { t.Logf("error updating Namespace '%s': %s. Will retry again...", nsName, err.Error()) return false, nil } @@ -1419,11 +1419,11 @@ func (a *MemberAwaitility) UpdateServiceAccount(t *testing.T, namespace, saName var sa *corev1.ServiceAccount err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSA := &corev1.ServiceAccount{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: saName}, freshSA); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: saName}, freshSA); err != nil { return true, err } modifySA(freshSA) - if err := a.Client.Update(ctx, freshSA); err != nil { + if err := a.Client.Update(context.TODO(), freshSA); err != nil { t.Logf("error updating ServiceAccount '%s': %s. Will retry again...", saName, err.Error()) return false, nil } @@ -1440,11 +1440,11 @@ func (a *MemberAwaitility) UpdateSpaceRequest(t *testing.T, spaceRequestNamespac var sr *toolchainv1alpha1.SpaceRequest err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpaceRequest := &toolchainv1alpha1.SpaceRequest{} - if err := a.Client.Get(ctx, spaceRequestNamespacedName, freshSpaceRequest); err != nil { + if err := a.Client.Get(context.TODO(), spaceRequestNamespacedName, freshSpaceRequest); err != nil { return true, err } modifySpaceRequest(freshSpaceRequest) - if err := a.Client.Update(ctx, freshSpaceRequest); err != nil { + if err := a.Client.Update(context.TODO(), freshSpaceRequest); err != nil { t.Logf("error updating SpaceRequest '%s' in namespace '%s': %s. Will retry again...", spaceRequestNamespacedName.Name, spaceRequestNamespacedName.Name, err.Error()) return false, nil } @@ -1461,11 +1461,11 @@ func (a *MemberAwaitility) UpdateSpaceBindingRequest(t *testing.T, spaceBindingR var sr *toolchainv1alpha1.SpaceBindingRequest err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshSpaceBindingRequest := &toolchainv1alpha1.SpaceBindingRequest{} - if err := a.Client.Get(ctx, spaceBindingRequestNamespacedName, freshSpaceBindingRequest); err != nil { + if err := a.Client.Get(context.TODO(), spaceBindingRequestNamespacedName, freshSpaceBindingRequest); err != nil { return true, err } modifySpaceBindingRequest(freshSpaceBindingRequest) - if err := a.Client.Update(ctx, freshSpaceBindingRequest); err != nil { + if err := a.Client.Update(context.TODO(), freshSpaceBindingRequest); err != nil { t.Logf("error updating SpaceBindingRequest '%s' in namespace '%s': %s. Will retry again...", spaceBindingRequestNamespacedName.Name, spaceBindingRequestNamespacedName.Name, err.Error()) return false, err } @@ -1480,7 +1480,7 @@ func (a *MemberAwaitility) WaitUntilSpaceBindingRequestDeleted(t *testing.T, spa t.Logf("waiting for SpaceBindingRequest '%s' in namespace '%s' to be deleted", spaceBindingRequest.GetName(), spaceBindingRequest.GetNamespace()) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { sbr := &toolchainv1alpha1.SpaceBindingRequest{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: spaceBindingRequest.GetName(), Namespace: spaceBindingRequest.GetNamespace()}, sbr); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: spaceBindingRequest.GetName(), Namespace: spaceBindingRequest.GetNamespace()}, sbr); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1494,7 +1494,7 @@ func (a *MemberAwaitility) WaitUntilSpaceBindingRequestDeleted(t *testing.T, spa // Workaround for https://github.com/kubernetes/kubernetes/issues/67761 func (a *MemberAwaitility) Create(t *testing.T, obj client.Object) error { return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { - if err := a.Client.Create(ctx, obj); err != nil { + if err := a.Client.Create(context.TODO(), obj); err != nil { t.Logf("trying to create %+v. Error: %s. Will try to create again.", obj, err.Error()) return false, nil } @@ -1540,7 +1540,7 @@ func (a *MemberAwaitility) WaitForPod(t *testing.T, namespace, name string, crit var pod *corev1.Pod err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Pod{} - if err = a.Client.Get(ctx, types.NamespacedName{ + if err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: namespace, Name: name, }, obj); err != nil { @@ -1567,7 +1567,7 @@ func (a *MemberAwaitility) WaitForConfigMap(t *testing.T, namespace, name string var cm *corev1.ConfigMap err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ConfigMap{} - if err = a.Client.Get(ctx, types.NamespacedName{ + if err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: namespace, Name: name, }, obj); err != nil { @@ -1590,7 +1590,7 @@ func (a *MemberAwaitility) WaitForSecret(t *testing.T, name string) (*corev1.Sec var cm *corev1.Secret err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Secret{} - if err = a.Client.Get(ctx, types.NamespacedName{ + if err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, }, obj); err != nil { @@ -1614,7 +1614,7 @@ func (a *MemberAwaitility) WaitForPods(t *testing.T, namespace string, n int, cr err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { pds := make([]corev1.Pod, 0, n) foundPods := &corev1.PodList{} - if err := a.Client.List(ctx, foundPods, client.InNamespace(namespace)); err != nil { + if err := a.Client.List(context.TODO(), foundPods, client.InNamespace(namespace)); err != nil { return false, err } pods: @@ -1640,7 +1640,7 @@ func (a *MemberAwaitility) WaitUntilPodsDeleted(t *testing.T, namespace string, t.Logf("waiting until Pods with matching criteria in namespace '%s' are deleted", namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { foundPods := &corev1.PodList{} - if err := a.Client.List(ctx, foundPods, &client.ListOptions{Namespace: namespace}); err != nil { + if err := a.Client.List(context.TODO(), foundPods, &client.ListOptions{Namespace: namespace}); err != nil { return false, err } if len(foundPods.Items) == 0 { @@ -1661,7 +1661,7 @@ func (a *MemberAwaitility) WaitUntilPodDeleted(t *testing.T, namespace, name str t.Logf("waiting until Pod '%s' in namespace '%s' is deleted", name, namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.Pod{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: name}, obj); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1747,7 +1747,7 @@ func (a *MemberAwaitility) WaitUntilWebhookDeleted(t *testing.T) error { t.Logf("waiting until webhook member-operator-webhook in namespace '%s' is deleted", a.Namespace) deployment := &appsv1.Deployment{} return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { - if err := a.Client.Get(ctx, test.NamespacedName(a.Namespace, "member-operator-webhook"), deployment); err != nil { + if err := a.Client.Get(context.TODO(), test.NamespacedName(a.Namespace, "member-operator-webhook"), deployment); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1767,7 +1767,7 @@ func (a *MemberAwaitility) WaitUntilNamespaceDeleted(t *testing.T, username, typ } opts := client.MatchingLabels(labels) namespaceList := &corev1.NamespaceList{} - if err := a.Client.List(ctx, namespaceList, opts); err != nil { + if err := a.Client.List(context.TODO(), namespaceList, opts); err != nil { return false, err } if len(namespaceList.Items) < 1 { @@ -1782,7 +1782,7 @@ func (a *MemberAwaitility) WaitUntilSecretsDeleted(t *testing.T, namespace strin t.Logf("waiting until secrets with lables '%v' in namespace '%s' is deleted", labels, namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { secretList := &corev1.SecretList{} - if err := a.Client.List(ctx, secretList, labels); err != nil { + if err := a.Client.List(context.TODO(), secretList, labels); err != nil { return false, err } if len(secretList.Items) < 1 { @@ -1829,7 +1829,7 @@ func (a *MemberAwaitility) WaitForUser(t *testing.T, name string, criteria ...Us user := &userv1.User{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { user = &userv1.User{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, user); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, user); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1895,7 +1895,7 @@ func (a *MemberAwaitility) WaitForIdentity(t *testing.T, name string, criteria . identity := &userv1.Identity{} err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { identity = &userv1.Identity{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, identity); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, identity); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -1939,7 +1939,7 @@ func (a *MemberAwaitility) WaitUntilUserAccountDeleted(t *testing.T, name string t.Logf("waiting until UserAccount '%s' in namespace '%s' is deleted", name, a.Namespace) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { ua := &toolchainv1alpha1.UserAccount{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: a.Namespace, Name: name}, ua); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: a.Namespace, Name: name}, ua); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1954,7 +1954,7 @@ func (a *MemberAwaitility) WaitUntilUserDeleted(t *testing.T, name string) error t.Logf("waiting until User is deleted '%s'", name) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { user := &userv1.User{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, user); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, user); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -1972,7 +1972,7 @@ func (a *MemberAwaitility) WaitUntilIdentityDeleted(t *testing.T, name string) e t.Logf("waiting until Identity is deleted '%s'", name) return wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { identity := &userv1.Identity{} - if err := a.Client.Get(ctx, types.NamespacedName{Name: name}, identity); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Name: name}, identity); err != nil { if errors.IsNotFound(err) { return true, nil } @@ -2003,7 +2003,7 @@ func (a *MemberAwaitility) WaitUntilClusterResourceQuotasDeleted(t *testing.T, u } opts := client.MatchingLabels(labels) quotaList := "av1.ClusterResourceQuotaList{} - if err := a.Client.List(ctx, quotaList, opts); err != nil { + if err := a.Client.List(context.TODO(), quotaList, opts); err != nil { return false, err } if len(quotaList.Items) == 0 { @@ -2112,7 +2112,7 @@ func (a *MemberAwaitility) WaitForMemberStatus(t *testing.T, criteria ...MemberS err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { // retrieve the memberstatus from the member namespace obj := &toolchainv1alpha1.MemberStatus{} - err = a.Client.Get(ctx, + err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2165,7 +2165,7 @@ func (a *MemberAwaitility) WaitForMemberOperatorConfig(t *testing.T, hostAwait * err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, 2*a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &toolchainv1alpha1.MemberOperatorConfig{} // retrieve the MemberOperatorConfig from the member namespace - err = a.Client.Get(ctx, + err = a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: a.Namespace, Name: name, @@ -2224,7 +2224,7 @@ func (a *MemberAwaitility) waitForUsersPodPriorityClass(t *testing.T) { func (a *MemberAwaitility) waitForResource(t *testing.T, namespace, name string, object client.Object) { err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { - if err := a.Client.Get(ctx, test.NamespacedName(namespace, name), object); err != nil { + if err := a.Client.Get(context.TODO(), test.NamespacedName(namespace, name), object); err != nil { if errors.IsNotFound(err) { return false, nil } @@ -2545,7 +2545,7 @@ func (a *MemberAwaitility) UpdatePod(t *testing.T, namespace, podName string, mo var m *corev1.Pod err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { freshPod := &corev1.Pod{} - if err := a.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: podName}, freshPod); err != nil { + if err := a.Client.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: podName}, freshPod); err != nil { return true, err } @@ -2564,14 +2564,14 @@ func (a *MemberAwaitility) UpdateConfigMap(t *testing.T, namespace, cmName strin var cm *corev1.ConfigMap err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &corev1.ConfigMap{} - if err := a.Client.Get(ctx, types.NamespacedName{ + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: namespace, Name: cmName}, obj); err != nil { return true, err } modifyCM(obj) - if err := a.Client.Update(ctx, obj); err != nil { + if err := a.Client.Update(context.TODO(), obj); err != nil { t.Logf("error updating ConfigMap '%s' Will retry again...", cmName) return false, nil // nolint:nilerr } @@ -2586,7 +2586,7 @@ func (a *MemberAwaitility) WaitForEnvironment(t *testing.T, namespace, name stri var env *appstudiov1.Environment err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (done bool, err error) { obj := &appstudiov1.Environment{} - if err := a.Client.Get(ctx, types.NamespacedName{ + if err := a.Client.Get(context.TODO(), types.NamespacedName{ Namespace: namespace, Name: name}, obj); errors.IsNotFound(err) { From 0c918fd09ee655680e44d5e698f5d9898c5d8dff Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Sun, 22 Sep 2024 12:02:19 -0400 Subject: [PATCH 10/20] correct replace version after pull --- go.mod | 2 +- go.sum | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 80e38dc91..206d10839 100644 --- a/go.mod +++ b/go.mod @@ -123,5 +123,5 @@ go 1.20 replace ( github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 => github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b - github.com/codeready-toolchain/toolchain-common v0.0.0-20240826144207-8833deda63a9 => github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e => github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 ) diff --git a/go.sum b/go.sum index 9d32471a0..efb86a5bc 100644 --- a/go.sum +++ b/go.sum @@ -121,10 +121,6 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 h1:uEH8HAM81QZBccuqQpGKJUoJQe28+DFSYi/mRKZDYrA= -github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e h1:xTqyuImyon/P2QfV5NIJDsVkEWqb9b6Ax9INsmzpI1Q= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e/go.mod h1:aIbki5CFsykeqZn2/ZwvUb3Krx2f2Tbq58R6MGnk6H8= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= From 1fdbf9dec0eb4a7ebd521213df5ccdd2e884881d Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Mon, 23 Sep 2024 11:42:04 -0400 Subject: [PATCH 11/20] update api and common --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 206d10839..d0caa570d 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/codeready-toolchain/toolchain-e2e require ( - github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 + github.com/codeready-toolchain/api v0.0.0-20240909145803-3b27dcfb3ded github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e github.com/davecgh/go-spew v1.1.1 github.com/fatih/color v1.15.0 @@ -122,6 +122,6 @@ require ( go 1.20 replace ( - github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 => github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b - github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e => github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 + github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 => github.com/ranakan19/api v0.0.0-20240923151833-647d61ba6f05 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e => github.com/ranakan19/toolchain-common v0.0.0-20240923152117-007ae28d1744 ) diff --git a/go.sum b/go.sum index efb86a5bc..93ed667ba 100644 --- a/go.sum +++ b/go.sum @@ -121,6 +121,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/codeready-toolchain/api v0.0.0-20240909145803-3b27dcfb3ded h1:AZdMwBPoT96Sze2AMR7N10dXIAMVxuM8CMuCSZxjQOY= +github.com/codeready-toolchain/api v0.0.0-20240909145803-3b27dcfb3ded/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -596,10 +598,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b h1:CPe3x10IApZ7LeVmA2if3W5PXQiE4T6ieXZZoXKCUt8= -github.com/ranakan19/api v0.0.0-20240827194454-431999ae615b/go.mod h1:blXQx8ZLooVqZ589EBtaAOmh13qLzGpDEnCBgjh9bv8= -github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1 h1:7SUE4LHw/bjgpelzQFszo+JTGI+gJvyNYaDNjruEL98= -github.com/ranakan19/toolchain-common v0.0.0-20240827195846-8a892553bda1/go.mod h1:OpJcfLA+KxeVV1tFR1AoLX2EG4wSFxaARP1jvnAOnwo= +github.com/ranakan19/toolchain-common v0.0.0-20240923152117-007ae28d1744 h1:lp7B1eXtPR+FQ9ybyTH0G61dYdN22m8pY+skxDZCBEE= +github.com/ranakan19/toolchain-common v0.0.0-20240923152117-007ae28d1744/go.mod h1:69UhmtxeIEu+D9rD2g47Zos8BInYH/RU2szTTqPWdZ4= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf h1:fsZiv9XuFo8G7IyzFWjG02vqzJG7kSqFvD1Wiq3V/o8= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf/go.mod h1:FfTyeSCu+e2VLgeMh/1RFG8TSkVjKRPEyR6EmDt0RIw= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= From 35bc45eec9fe34f5f4a84b247c35eba83158a23f Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Mon, 30 Sep 2024 13:01:41 -0400 Subject: [PATCH 12/20] fix proxy tests --- test/e2e/parallel/proxy_test.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 2c4aea5a8..0fb816e4a 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -37,7 +37,6 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" k8serr "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" kubewait "k8s.io/apimachinery/pkg/util/wait" @@ -369,7 +368,13 @@ func TestProxyFlow(t *testing.T) { // note: the actual error message is "invalid workspace request: access to workspace '%s' is forbidden" but clients make api discovery calls // that fail because in this case the api discovery calls go through the proxyWorkspaceURL which is invalid. If using oc or kubectl and you // enable verbose logging you would see Response Body: invalid workspace request: access to workspace 'proxymember2' is forbidden - require.EqualError(t, err, `no matches for kind "Application" in version "appstudio.redhat.com/v1alpha1"`) + + // Sep 26 2024 + // As mentioned in the issue -https://github.com/kubernetes-sigs/controller-runtime/issues/2354 in introduced in controller-runtime v0.15 + // for this test, instead of expecting the NoMatchError, discovery client fails and returns a server list error 'failed to get API group resources: unable to retrieve the complete list of server APIs' + // But since the returned error is wrapped around the actual error message mentioned in the above comments, updated to check error contains nstead of error eqals + // TO-DO : This issue is fixed in controller-runtime v0.17 - revisit it then + require.ErrorContains(t, err, fmt.Sprintf("invalid workspace request: access to workspace '%s' is forbidden", workspaceName)) }) t.Run("successful workspace context request", func(t *testing.T) { @@ -440,8 +445,11 @@ func TestProxyFlow(t *testing.T) { t.Run("invalid workspace context request", func(t *testing.T) { proxyWorkspaceURL := hostAwait.ProxyURLWithWorkspaceContext("notexist") hostAwaitWithShorterTimeout := hostAwait.WithRetryOptions(wait.TimeoutOption(time.Second * 3)) // we expect an error so we can use a shorter timeout - _, err := hostAwaitWithShorterTimeout.CreateAPIProxyClient(t, user.token, proxyWorkspaceURL) - require.EqualError(t, err, `an error on the server ("unable to get target cluster: the requested space is not available") has prevented the request from succeeding`) + proxyCl, err := hostAwaitWithShorterTimeout.CreateAPIProxyClient(t, user.token, proxyWorkspaceURL) + require.NoError(t, err) + actualApp := &appstudiov1.Application{} + err = proxyCl.Get(context.TODO(), types.NamespacedName{Name: "test", Namespace: "primaryUserNamespace"}, actualApp) + require.ErrorContains(t, err, `an error on the server ("unable to get target cluster: the requested space is not available") has prevented the request from succeeding`) }) t.Run("invalid request headers", func(t *testing.T) { @@ -513,7 +521,8 @@ func TestProxyFlow(t *testing.T) { // note: the actual error message is "invalid workspace request: access to workspace '%s' is forbidden" but clients make api discovery calls // that fail because in this case the api discovery calls go through the proxyWorkspaceURL which is invalid. If using oc or kubectl and you // enable verbose logging you would see Response Body: invalid workspace request: access to workspace 'proxymember2' is forbidden - require.EqualError(t, err, `no matches for kind "Application" in version "appstudio.redhat.com/v1alpha1"`) + + require.ErrorContains(t, err, "invalid workspace request: access to workspace 'proxymember2' is forbidden") // Double check that the Application does exist using a regular client (non-proxy) createdApp := &appstudiov1.Application{} @@ -612,7 +621,7 @@ func TestProxyFlow(t *testing.T) { cms := corev1.ConfigMapList{} err = userProxyClient.List(context.TODO(), &cms, client.InNamespace(sp.Status.ProvisionedNamespaces[0].Name)) - require.True(t, meta.IsNoMatchError(err), "expected List ConfigMap to return a NoMatch error, actual: %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) t.Run("banned user cannot create config maps into space", func(t *testing.T) { @@ -624,7 +633,7 @@ func TestProxyFlow(t *testing.T) { } err = userProxyClient.Create(context.TODO(), &cm) - require.True(t, meta.IsNoMatchError(err), "expected Create ConfigMap to return a NoMatch error, actual: %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) }) }) From 5e2b717a70ef070caac162404f1fb379cce2a9a0 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Mon, 30 Sep 2024 13:57:43 -0400 Subject: [PATCH 13/20] tidy --- go.sum | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/go.sum b/go.sum index 5c447c65c..a71c747b4 100644 --- a/go.sum +++ b/go.sum @@ -121,10 +121,6 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/api v0.0.0-20240927104325-b5bfcb3cb1b0 h1:7cXHlRpoi1Owo8fYawl80PUsVWz+9AtMge6OJ4DjvWU= -github.com/codeready-toolchain/api v0.0.0-20240927104325-b5bfcb3cb1b0/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e h1:xTqyuImyon/P2QfV5NIJDsVkEWqb9b6Ax9INsmzpI1Q= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e/go.mod h1:aIbki5CFsykeqZn2/ZwvUb3Krx2f2Tbq58R6MGnk6H8= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -600,6 +596,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/ranakan19/api v0.0.0-20240923151833-647d61ba6f05 h1:WpnDX9uKLBxqvFEmI4TwUO4FnzEgEiVGp+wNPQtlDNc= +github.com/ranakan19/api v0.0.0-20240923151833-647d61ba6f05/go.mod h1:blXQx8ZLooVqZ589EBtaAOmh13qLzGpDEnCBgjh9bv8= github.com/ranakan19/toolchain-common v0.0.0-20240923152117-007ae28d1744 h1:lp7B1eXtPR+FQ9ybyTH0G61dYdN22m8pY+skxDZCBEE= github.com/ranakan19/toolchain-common v0.0.0-20240923152117-007ae28d1744/go.mod h1:69UhmtxeIEu+D9rD2g47Zos8BInYH/RU2szTTqPWdZ4= github.com/redhat-cop/operator-utils v1.3.3-0.20220121120056-862ef22b8cdf h1:fsZiv9XuFo8G7IyzFWjG02vqzJG7kSqFvD1Wiq3V/o8= From 8d54f2758b795a137f87dd54ade5422b8af8d13b Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Mon, 30 Sep 2024 15:46:05 -0400 Subject: [PATCH 14/20] unable to replicate error locally, try getting workspace instead of application --- test/e2e/parallel/proxy_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 0fb816e4a..2bbcdb38a 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -447,8 +447,8 @@ func TestProxyFlow(t *testing.T) { hostAwaitWithShorterTimeout := hostAwait.WithRetryOptions(wait.TimeoutOption(time.Second * 3)) // we expect an error so we can use a shorter timeout proxyCl, err := hostAwaitWithShorterTimeout.CreateAPIProxyClient(t, user.token, proxyWorkspaceURL) require.NoError(t, err) - actualApp := &appstudiov1.Application{} - err = proxyCl.Get(context.TODO(), types.NamespacedName{Name: "test", Namespace: "primaryUserNamespace"}, actualApp) + actualWorkspace := &toolchainv1alpha1.Workspace{} + err = proxyCl.Get(context.TODO(), types.NamespacedName{Name: "notexist"}, actualWorkspace) require.ErrorContains(t, err, `an error on the server ("unable to get target cluster: the requested space is not available") has prevented the request from succeeding`) }) From 9c45a856a20c23bf840752574c3d980d5395bab4 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Tue, 1 Oct 2024 15:24:19 -0400 Subject: [PATCH 15/20] fix proxy test --- test/e2e/parallel/proxy_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 2bbcdb38a..01907e918 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -443,13 +443,15 @@ func TestProxyFlow(t *testing.T) { }) // end of successful workspace context request with proxy plugin t.Run("invalid workspace context request", func(t *testing.T) { + // given proxyWorkspaceURL := hostAwait.ProxyURLWithWorkspaceContext("notexist") hostAwaitWithShorterTimeout := hostAwait.WithRetryOptions(wait.TimeoutOption(time.Second * 3)) // we expect an error so we can use a shorter timeout proxyCl, err := hostAwaitWithShorterTimeout.CreateAPIProxyClient(t, user.token, proxyWorkspaceURL) - require.NoError(t, err) - actualWorkspace := &toolchainv1alpha1.Workspace{} - err = proxyCl.Get(context.TODO(), types.NamespacedName{Name: "notexist"}, actualWorkspace) - require.ErrorContains(t, err, `an error on the server ("unable to get target cluster: the requested space is not available") has prevented the request from succeeding`) + expectedApp := &appstudiov1.Application{} + // when + err = proxyCl.Get(context.TODO(), types.NamespacedName{Namespace: "testNamespace", Name: "test"}, expectedApp) + // then + require.ErrorContains(t, err, `an error on the server ("unable to get target cluster: access to workspace 'notexist' is forbidden") has prevented the request from succeeding`) }) t.Run("invalid request headers", func(t *testing.T) { From 80e60f64f8a368178b404f3021fe288c7cd6b65f Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Tue, 1 Oct 2024 15:27:57 -0400 Subject: [PATCH 16/20] fix lint --- test/e2e/parallel/proxy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 01907e918..153ebb85a 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -447,6 +447,7 @@ func TestProxyFlow(t *testing.T) { proxyWorkspaceURL := hostAwait.ProxyURLWithWorkspaceContext("notexist") hostAwaitWithShorterTimeout := hostAwait.WithRetryOptions(wait.TimeoutOption(time.Second * 3)) // we expect an error so we can use a shorter timeout proxyCl, err := hostAwaitWithShorterTimeout.CreateAPIProxyClient(t, user.token, proxyWorkspaceURL) + require.NoError(t, err) expectedApp := &appstudiov1.Application{} // when err = proxyCl.Get(context.TODO(), types.NamespacedName{Namespace: "testNamespace", Name: "test"}, expectedApp) From 0e426c051fa9033bb614ec723f9356f52b77c6c7 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Tue, 1 Oct 2024 19:33:53 -0400 Subject: [PATCH 17/20] replace k8s isForbidden error comparision to error contains for proxyclient --- test/e2e/parallel/proxy_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 153ebb85a..0283d582c 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -1076,7 +1076,7 @@ func TestSpaceLister(t *testing.T) { err := proxyClDefault.Get(context.TODO(), workspaceNamespacedName, &toolchainv1alpha1.Workspace{}) require.Error(t, err) - require.True(t, k8serr.IsForbidden(err), "expected Forbidden error, got %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) t.Run("cannot get shared workspace", func(t *testing.T) { @@ -1084,14 +1084,14 @@ func TestSpaceLister(t *testing.T) { err := proxyClDefault.Get(context.TODO(), workspaceNamespacedName, &toolchainv1alpha1.Workspace{}) require.Error(t, err) - require.True(t, k8serr.IsForbidden(err), "expected Forbidden error, got %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) t.Run("cannot list workspaces", func(t *testing.T) { err := proxyClDefault.List(context.TODO(), &toolchainv1alpha1.WorkspaceList{}) require.Error(t, err) - require.True(t, k8serr.IsForbidden(err), "expected Forbidden error, got %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) t.Run("cannot list resources", func(t *testing.T) { @@ -1110,7 +1110,7 @@ func TestSpaceLister(t *testing.T) { t.Run(k, func(t *testing.T) { err := workspaceClient.List(context.TODO(), objList) require.Error(t, err) - require.True(t, k8serr.IsForbidden(err), "expected Forbidden error, got %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) } }) From c28e778c56a3b7c547478f9cca5980e462ebcea0 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Wed, 2 Oct 2024 01:28:03 -0400 Subject: [PATCH 18/20] fix proxyPublicviewer_test --- test/e2e/proxy_publicviewer_test.go | 38 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/test/e2e/proxy_publicviewer_test.go b/test/e2e/proxy_publicviewer_test.go index 9f728b9e6..e103b1912 100644 --- a/test/e2e/proxy_publicviewer_test.go +++ b/test/e2e/proxy_publicviewer_test.go @@ -11,8 +11,6 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -55,6 +53,12 @@ func (u *proxyUser) Email() string { } } +type TestCase struct { + description string + banned bool + expectedError string +} + // tests access to community-shared spaces func TestProxyPublicViewer(t *testing.T) { // make sure everything is ready before running the actual tests @@ -161,7 +165,7 @@ func TestProxyPublicViewer(t *testing.T) { }, } err = communityUserProxyClient.Create(context.TODO(), &cm) - require.True(t, errors.IsForbidden(err), "expected Create ConfigMap as community user to return a Forbidden error, actual: %v", err) + require.ErrorContains(t, err, "configmaps is forbidden: User \"kubesaw-authenticated\" cannot create resource \"configmaps\" in API group") }) }) } @@ -194,7 +198,7 @@ func TestProxyPublicViewer(t *testing.T) { }, } err = proxyClient.Create(context.TODO(), &cm) - require.True(t, meta.IsNoMatchError(err), "expected Create ConfigMap as SSO user to return a NoMatch error, actual: %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) t.Run("cannot list config maps", func(t *testing.T) { @@ -212,7 +216,7 @@ func TestProxyPublicViewer(t *testing.T) { }, } err := proxyClient.Create(context.TODO(), &cm) - require.True(t, errors.IsForbidden(err), "expected Create ConfigMap as SSO user to return a Forbidden error, actual: %v", err) + require.ErrorContains(t, err, "user access is forbidden") }) }) }) @@ -231,16 +235,24 @@ func TestProxyPublicViewer(t *testing.T) { require.NoError(t, err) require.Empty(t, sbs) - testCases := map[string]bool{ - "user is not banned": false, - "user is banned": true, + testCases := []TestCase{ + { + description: "user is not banned", + banned: false, + expectedError: "invalid workspace request", + }, + { + description: "user is banned", + banned: true, + expectedError: "user access is forbidden", + }, } - for s, banRequired := range testCases { - t.Run(s, func(t *testing.T) { + for _, testCase := range testCases { + t.Run(testCase.description, func(t *testing.T) { for s, c := range tt { t.Run(s, func(t *testing.T) { user := c.proxyClientUser() - if banRequired { + if testCase.banned { banUser(t, hostAwait, user) } @@ -255,7 +267,7 @@ func TestProxyPublicViewer(t *testing.T) { cms := corev1.ConfigMapList{} err = communityUserProxyClient.List(context.TODO(), &cms, client.InNamespace(sp.Status.ProvisionedNamespaces[0].Name)) - require.True(t, meta.IsNoMatchError(err), "expected List ConfigMap as community user to return a NoMatch error, actual: %v", err) + require.ErrorContains(t, err, testCase.expectedError) }) t.Run("user cannot create config maps into non-community space", func(t *testing.T) { @@ -266,7 +278,7 @@ func TestProxyPublicViewer(t *testing.T) { }, } err := communityUserProxyClient.Create(context.TODO(), &cm) - require.True(t, meta.IsNoMatchError(err), "expected Create ConfigMap as community user to return a NoMatch error, actual: %v", err) + require.ErrorContains(t, err, testCase.expectedError) }) }) }) From d436378b82f2bc36f4b77ea0d9171e74d878ea7d Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Wed, 2 Oct 2024 08:47:29 -0400 Subject: [PATCH 19/20] add wait for label to avoid flakiness --- test/e2e/user_management_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/user_management_test.go b/test/e2e/user_management_test.go index 1cf803deb..f42d13c71 100644 --- a/test/e2e/user_management_test.go +++ b/test/e2e/user_management_test.go @@ -590,7 +590,7 @@ func (s *userManagementTestSuite) TestUserBanning() { t.Logf("user signup '%s' created", userSignup.Name) // Check the UserSignup is created - userSignup, err = hostAwait.WaitForUserSignup(t, userSignup.Name) + userSignup, err = hostAwait.WaitForUserSignup(t, userSignup.Name, wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueBanned)) require.NoError(t, err) // Confirm that the user is banned From 14f4c0f0f5bbdbbb87e4cf988a8d20e9b8a40f6f Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Thu, 3 Oct 2024 22:09:49 -0400 Subject: [PATCH 20/20] remove comment which is no longer valid, and update comment msg --- test/e2e/parallel/proxy_test.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index 0283d582c..03bb45166 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -364,15 +364,10 @@ func TestProxyFlow(t *testing.T) { require.NoError(t, err) err = proxyCl.Create(context.TODO(), appToCreate) - // then - // note: the actual error message is "invalid workspace request: access to workspace '%s' is forbidden" but clients make api discovery calls - // that fail because in this case the api discovery calls go through the proxyWorkspaceURL which is invalid. If using oc or kubectl and you - // enable verbose logging you would see Response Body: invalid workspace request: access to workspace 'proxymember2' is forbidden - // Sep 26 2024 - // As mentioned in the issue -https://github.com/kubernetes-sigs/controller-runtime/issues/2354 in introduced in controller-runtime v0.15 - // for this test, instead of expecting the NoMatchError, discovery client fails and returns a server list error 'failed to get API group resources: unable to retrieve the complete list of server APIs' - // But since the returned error is wrapped around the actual error message mentioned in the above comments, updated to check error contains nstead of error eqals + // As mentioned in the issue -https://github.com/kubernetes-sigs/controller-runtime/issues/2354 introduced in controller-runtime v0.15 + // for this test, instead of expecting the NoMatchError, discovery client fails and returns a server list error like 'failed to get API group resources: unable to retrieve the complete list of server APIs' + // The returned server error wraps around the actual error message of ""invalid workspace request", thus check error contains instead of error equals // TO-DO : This issue is fixed in controller-runtime v0.17 - revisit it then require.ErrorContains(t, err, fmt.Sprintf("invalid workspace request: access to workspace '%s' is forbidden", workspaceName)) })