Repository: knative/pkg
Pull request #2061 (2021-03-18 11:36:35)

Add skonto to metrics reviewers
Interested in reviewing PRs in this area.

knative-prow-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **vaikas** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @vaikas` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fpkg).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/knative/pkg/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["vaikas"]} -->
codecov[bot]: # [Codecov](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=h1) Report
> Merging [#2061](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=desc) (32fbfcd) into [main](https://codecov.io/gh/knative/pkg/commit/dfeeb1817679df6d29737a6c9a61ea9c4860d91a?el=desc) (dfeeb18) will **increase** coverage by `0.06%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/knative/pkg/pull/2061/graphs/tree.svg?width=650&height=150&src=pr&token=rlqpDnfxbO)](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##             main    #2061      +/-   ##
==========================================
+ Coverage   67.36%   67.43%   +0.06%     
==========================================
  Files         215      215              
  Lines        9111     9111              
==========================================
+ Hits         6138     6144       +6     
+ Misses       2698     2695       -3     
+ Partials      275      272       -3     
```


| [Impacted Files](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [test/gcs/mock/mock.go](https://codecov.io/gh/knative/pkg/pull/2061/diff?src=pr&el=tree#diff-dGVzdC9nY3MvbW9jay9tb2NrLmdv) | `93.54% <0.00%> (+3.22%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=footer). Last update [dfeeb18...32fbfcd](https://codecov.io/gh/knative/pkg/pull/2061?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.github/workflows/knative-downstream.yaml b/.github/workflows/knative-downstream.yaml
index 35ae0a80b..f1335c9e6 100644
--- a/.github/workflows/knative-downstream.yaml
+++ b/.github/workflows/knative-downstream.yaml
@@ -95,7 +95,7 @@ jobs:
         repository: ${{ matrix.org }}/${{ matrix.repo }}
         path: ./src/knative.dev/${{ matrix.repo }}
     - name: Test Downstream
-      uses: knative-sandbox/downstream-test-go@v1.0.1
+      uses: knative-sandbox/actions-downstream-test@v1
       with:
         upstream-module: knative.dev/${{ github.event.repository.name }}
         downstream-module: knative.dev/${{ matrix.repo }}
diff --git a/.github/workflows/knative-releasability.yaml b/.github/workflows/knative-releasability.yaml
index cf885877c..5a30c913f 100644
--- a/.github/workflows/knative-releasability.yaml
+++ b/.github/workflows/knative-releasability.yaml
@@ -36,8 +36,8 @@ jobs:
     env:
       #########################################
       #   Update this section each release.   #
-      RELEASE: 'v0.21'
-      SLACK_CHANNEL: 'release-21'
+      RELEASE: 'v0.22'
+      SLACK_CHANNEL: 'release-22'
       #########################################
 
     steps:
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index f1165f85b..88ebf82b4 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -24,7 +24,6 @@ You must install these tools:
 1. [`go`](https://golang.org/doc/install): The language Knative `pkg` is built
    in
 1. [`git`](https://help.github.com/articles/set-up-git/): For source control
-1. [`dep`](https://github.com/golang/dep): For managing external dependencies.
 
 ### Environment setup
 
diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES
index 5eed75f37..c4aa3cf64 100644
--- a/OWNERS_ALIASES
+++ b/OWNERS_ALIASES
@@ -60,6 +60,11 @@ aliases:
   - mdemirhan
   - yanweiguo
 
+  metrics-reviewers:
+  - mdemirhan
+  - yanweiguo
+  - skonto
+
   network-approvers:
   - markusthoemmes
   - tcnghia
diff --git a/client/injection/apiextensions/reconciler/apiextensions/v1/customresourcedefinition/controller.go b/client/injection/apiextensions/reconciler/apiextensions/v1/customresourcedefinition/controller.go
index 9f64c2f43..83c7e6f72 100644
--- a/client/injection/apiextensions/reconciler/apiextensions/v1/customresourcedefinition/controller.go
+++ b/client/injection/apiextensions/reconciler/apiextensions/v1/customresourcedefinition/controller.go
@@ -50,7 +50,7 @@ const (
 // NewImpl returns a controller.Impl that handles queuing and feeding work from
 // the queue through an implementation of controller.Reconciler, delegating to
 // the provided Interface and optional Finalizer methods. OptionsFn is used to return
-// controller.Options to be used but the internal reconciler.
+// controller.Options to be used by the internal reconciler.
 func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl {
 	logger := logging.FromContext(ctx)
 
diff --git a/client/injection/apiextensions/reconciler/apiextensions/v1beta1/customresourcedefinition/controller.go b/client/injection/apiextensions/reconciler/apiextensions/v1beta1/customresourcedefinition/controller.go
index d1c5acafb..5f9914f9d 100644
--- a/client/injection/apiextensions/reconciler/apiextensions/v1beta1/customresourcedefinition/controller.go
+++ b/client/injection/apiextensions/reconciler/apiextensions/v1beta1/customresourcedefinition/controller.go
@@ -50,7 +50,7 @@ const (
 // NewImpl returns a controller.Impl that handles queuing and feeding work from
 // the queue through an implementation of controller.Reconciler, delegating to
 // the provided Interface and optional Finalizer methods. OptionsFn is used to return
-// controller.Options to be used but the internal reconciler.
+// controller.Options to be used by the internal reconciler.
 func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl {
 	logger := logging.FromContext(ctx)
 
diff --git a/client/injection/kube/reconciler/apps/v1/deployment/controller.go b/client/injection/kube/reconciler/apps/v1/deployment/controller.go
index 11c3ea262..69443720b 100644
--- a/client/injection/kube/reconciler/apps/v1/deployment/controller.go
+++ b/client/injection/kube/reconciler/apps/v1/deployment/controller.go
@@ -48,7 +48,7 @@ const (
 // NewImpl returns a controller.Impl that handles queuing and feeding work from
 // the queue through an implementation of controller.Reconciler, delegating to
 // the provided Interface and optional Finalizer methods. OptionsFn is used to return
-// controller.Options to be used but the internal reconciler.
+// controller.Options to be used by the internal reconciler.
 func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl {
 	logger := logging.FromContext(ctx)
 
diff --git a/client/injection/kube/reconciler/core/v1/namespace/controller.go b/client/injection/kube/reconciler/core/v1/namespace/controller.go
index ebed7022f..b741fbd90 100644
--- a/client/injection/kube/reconciler/core/v1/namespace/controller.go
+++ b/client/injection/kube/reconciler/core/v1/namespace/controller.go
@@ -48,7 +48,7 @@ const (
 // NewImpl returns a controller.Impl that handles queuing and feeding work from
 // the queue through an implementation of controller.Reconciler, delegating to
 // the provided Interface and optional Finalizer methods. OptionsFn is used to return
-// controller.Options to be used but the internal reconciler.
+// controller.Options to be used by the internal reconciler.
 func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl {
 	logger := logging.FromContext(ctx)
 
diff --git a/client/injection/kube/reconciler/core/v1/secret/controller.go b/client/injection/kube/reconciler/core/v1/secret/controller.go
index 7661d4283..5082307c3 100644
--- a/client/injection/kube/reconciler/core/v1/secret/controller.go
+++ b/client/injection/kube/reconciler/core/v1/secret/controller.go
@@ -48,7 +48,7 @@ const (
 // NewImpl returns a controller.Impl that handles queuing and feeding work from
 // the queue through an implementation of controller.Reconciler, delegating to
 // the provided Interface and optional Finalizer methods. OptionsFn is used to return
-// controller.Options to be used but the internal reconciler.
+// controller.Options to be used by the internal reconciler.
 func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl {
 	logger := logging.FromContext(ctx)
 
diff --git a/codegen/cmd/injection-gen/generators/reconciler_controller.go b/codegen/cmd/injection-gen/generators/reconciler_controller.go
index 78ff96730..9471b5db8 100644
--- a/codegen/cmd/injection-gen/generators/reconciler_controller.go
+++ b/codegen/cmd/injection-gen/generators/reconciler_controller.go
@@ -204,7 +204,7 @@ const (
 // NewImpl returns a {{.controllerImpl|raw}} that handles queuing and feeding work from
 // the queue through an implementation of {{.controllerReconciler|raw}}, delegating to
 // the provided Interface and optional Finalizer methods. OptionsFn is used to return
-// {{.controllerOptions|raw}} to be used but the internal reconciler.
+// {{.controllerOptions|raw}} to be used by the internal reconciler.
 func NewImpl(ctx {{.contextContext|raw}}, r Interface{{if .hasClass}}, classValue string{{end}}, optionsFns ...{{.controllerOptionsFn|raw}}) *{{.controllerImpl|raw}} {
 	logger := {{.loggingFromContext|raw}}(ctx)
 
diff --git a/go.mod b/go.mod
index b68fe385d..f2b2388d0 100644
--- a/go.mod
+++ b/go.mod
@@ -67,6 +67,6 @@ require (
 	k8s.io/code-generator v0.19.7
 	k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14
 	k8s.io/klog v1.0.0
-	knative.dev/hack v0.0.0-20210317214554-58edbdc42966
+	knative.dev/hack v0.0.0-20210325223819-b6ab329907d3
 	sigs.k8s.io/yaml v1.2.0
 )
diff --git a/go.sum b/go.sum
index 515b22e98..c39594639 100644
--- a/go.sum
+++ b/go.sum
@@ -1174,8 +1174,8 @@ k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL
 k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
 k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg=
 k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-knative.dev/hack v0.0.0-20210317214554-58edbdc42966 h1:qSnMQkq4gnhD5Hb8Mpfn7IrpkiQFhXXFPOA7uIl2lAc=
-knative.dev/hack v0.0.0-20210317214554-58edbdc42966/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
+knative.dev/hack v0.0.0-20210325223819-b6ab329907d3 h1:km0Rrh0T9/wA2pivQm1hqSPVwgNgGCHC2WNn3GakZmE=
+knative.dev/hack v0.0.0-20210325223819-b6ab329907d3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
 pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U=
 pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
diff --git a/injection/config.go b/injection/config.go
index 6bcd38550..2f1aab414 100644
--- a/injection/config.go
+++ b/injection/config.go
@@ -22,8 +22,6 @@ import (
 	"log"
 	"math"
 	"os"
-	"os/user"
-	"path/filepath"
 	"sync"
 
 	"k8s.io/client-go/rest"
@@ -112,10 +110,8 @@ func GetRESTConfig(serverURL, kubeconfig string) (*rest.Config, error) {
 	}
 
 	// If no in-cluster config, try the default location in the user's home directory.
-	if usr, err := user.Current(); err == nil {
-		if c, err := clientcmd.BuildConfigFromFlags("", filepath.Join(usr.HomeDir, ".kube", "config")); err == nil {
-			return c, nil
-		}
+	if c, err := clientcmd.BuildConfigFromFlags("", clientcmd.RecommendedHomeFile); err == nil {
+		return c, nil
 	}
 
 	return nil, errors.New("could not create a valid kubeconfig")
diff --git a/leaderelection/config.go b/leaderelection/config.go
index 96164bd00..3d9df1dc7 100644
--- a/leaderelection/config.go
+++ b/leaderelection/config.go
@@ -134,8 +134,8 @@ type statefulSetID struct {
 
 func (ssID *statefulSetID) Decode(v string) error {
 	if i := strings.LastIndex(v, "-"); i != -1 {
-		ui, err := strconv.ParseUint(v[i+1:], 10, 64)
-		ssID.ordinal = int(ui)
+		ui, err := strconv.Atoi(v[i+1:])
+		ssID.ordinal = ui
 		ssID.ssName = v[:i]
 		return err
 	}
diff --git a/metrics/OWNERS b/metrics/OWNERS
index 6d3966df4..bd4290683 100644
--- a/metrics/OWNERS
+++ b/metrics/OWNERS
@@ -2,3 +2,6 @@
 
 approvers:
 - metrics-approvers
+
+reviewers:
+- metrics-reviewers
diff --git a/tracing/zipkin.go b/tracing/zipkin.go
index 75a97ae3b..4faa7a12c 100644
--- a/tracing/zipkin.go
+++ b/tracing/zipkin.go
@@ -56,7 +56,6 @@ func WithZipkinExporter(reporterFact ZipkinReporterFactory, endpoint *zipkinmode
 		}
 
 		if oct.closer != nil {
-			// TODO(greghaynes) log this error
 			_ = oct.closer.Close()
 		}
 
diff --git a/vendor/knative.dev/hack/library.sh b/vendor/knative.dev/hack/library.sh
index d72bfe6b7..de744c1d9 100644
--- a/vendor/knative.dev/hack/library.sh
+++ b/vendor/knative.dev/hack/library.sh
@@ -156,6 +156,9 @@ function wait_until_object_does_not_exist() {
 }
 
 # Waits until all pods are running in the given namespace.
+# This function handles some edge cases that `kubectl wait` does not support,
+# and it provides nice debug info on the state of the pod if it failed,
+# that’s why we have this long bash function instead of using `kubectl wait`.
 # Parameters: $1 - namespace.
 function wait_until_pods_running() {
   echo -n "Waiting until all pods in namespace $1 are up"
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 9495ee033..4957b0e7d 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -948,7 +948,7 @@ k8s.io/utils/buffer
 k8s.io/utils/integer
 k8s.io/utils/pointer
 k8s.io/utils/trace
-# knative.dev/hack v0.0.0-20210317214554-58edbdc42966
+# knative.dev/hack v0.0.0-20210325223819-b6ab329907d3
 ## explicit
 knative.dev/hack
 # sigs.k8s.io/structured-merge-diff/v4 v4.0.1
diff --git a/version/version.go b/version/version.go
index b2a4e2b47..e14cbb1b3 100644
--- a/version/version.go
+++ b/version/version.go
@@ -33,7 +33,8 @@ const (
 	// NOTE: If you are changing this line, please also update the minimum kubernetes
 	// version listed here:
 	// https://github.com/knative/docs/blob/main/docs/install/any-kubernetes-cluster.md#before-you-begin
-	defaultMinimumVersion = "v1.17.0"
+	// https://github.com/knative/docs/blob/main/docs/install/knative-with-operators.md#prerequisites
+	defaultMinimumVersion = "v1.18.0"
 )
 
 func getMinimumVersion() string {
diff --git a/webhook/README.md b/webhook/README.md
index 18ca37ce1..cac4fb664 100644
--- a/webhook/README.md
+++ b/webhook/README.md
@@ -25,7 +25,7 @@ The code to stand up such a webhook looks roughly like this:
 ```go
 // Create a function matching this signature to pass into sharedmain.
 func NewResourceAdmissionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
-	return resourcesemantics.NewAdmissionController(ctx,
+	return validation.NewAdmissionController(ctx,
 		// Name of the resource webhook (created via yaml)
 		fmt.Sprintf("resources.webhook.%s.knative.dev", system.Namespace()),
 
diff --git a/webhook/webhook.go b/webhook/webhook.go
index ef578c4ee..ab54e36b5 100644
--- a/webhook/webhook.go
+++ b/webhook/webhook.go
@@ -21,6 +21,7 @@ import (
 	"crypto/tls"
 	"errors"
 	"fmt"
+	"html"
 	"net/http"
 	"time"
 
@@ -140,7 +141,7 @@ func New(
 	}
 
 	webhook.mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
-		http.Error(w, fmt.Sprint("no controller registered for: ", r.URL.Path), http.StatusBadRequest)
+		http.Error(w, fmt.Sprint("no controller registered for: ", html.EscapeString(r.URL.Path)), http.StatusBadRequest)
 	})
 
 	for _, controller := range controllers {


Test patch:
diff --git a/configmap/testing/configmap.go b/configmap/testing/configmap.go
index a6942b86b..909036892 100644
--- a/configmap/testing/configmap.go
+++ b/configmap/testing/configmap.go
@@ -31,7 +31,7 @@ import (
 
 // ConfigMapFromTestFile creates a v1.ConfigMap from a YAML file
 // It loads the YAML file from the testdata folder.
-func ConfigMapFromTestFile(t *testing.T, name string, allowed ...string) *corev1.ConfigMap {
+func ConfigMapFromTestFile(t testing.TB, name string, allowed ...string) *corev1.ConfigMap {
 	t.Helper()
 
 	cm, _ := ConfigMapsFromTestFile(t, name, allowed...)
@@ -42,7 +42,7 @@ func ConfigMapFromTestFile(t *testing.T, name string, allowed ...string) *corev1
 // file read from the testdata directory:
 // 1. The raw configmap read in.
 // 2. A second version of the configmap augmenting `data:` with what's parsed from the value of `_example:`
-func ConfigMapsFromTestFile(t *testing.T, name string, allowed ...string) (*corev1.ConfigMap, *corev1.ConfigMap) {
+func ConfigMapsFromTestFile(t testing.TB, name string, allowed ...string) (*corev1.ConfigMap, *corev1.ConfigMap) {
 	t.Helper()
 
 	b, err := ioutil.ReadFile(fmt.Sprintf("testdata/%s.yaml", name))
@@ -53,7 +53,7 @@ func ConfigMapsFromTestFile(t *testing.T, name string, allowed ...string) (*core
 	var orig corev1.ConfigMap
 
 	// Use sigs.k8s.io/yaml since it reads json struct
-	// tags so things unmarshal properly
+	// tags so things unmarshal properly.
 	if err := yaml.Unmarshal(b, &orig); err != nil {
 		t.Fatal("yaml.Unmarshal() =", err)
 	}
@@ -76,7 +76,7 @@ func ConfigMapsFromTestFile(t *testing.T, name string, allowed ...string) (*core
 	// With the length and membership checks, we know that the keyspace matches.
 
 	exampleBody, hasExampleBody := orig.Data[configmap.ExampleKey]
-	// Check that exampleBody does not have lines that end in a trailing space,
+	// Check that exampleBody does not have lines that end in a trailing space.
 	for i, line := range strings.Split(exampleBody, "\n") {
 		if strings.TrimRightFunc(line, unicode.IsSpace) != line {
 			t.Errorf("line %d of %q example contains trailing spaces", i, name)
@@ -92,12 +92,12 @@ func ConfigMapsFromTestFile(t *testing.T, name string, allowed ...string) (*core
 		}
 	}
 
-	// Parse exampleBody into exemplar.Data
+	// Parse exampleBody into exemplar.Data.
 	exemplar := orig.DeepCopy()
 	if err := yaml.Unmarshal([]byte(exampleBody), &exemplar.Data); err != nil {
 		t.Fatal("yaml.Unmarshal() =", err)
 	}
-	// Augment the sample with actual configuration
+	// Augment the sample with actual configuration.
 	for k, v := range orig.Data {
 		if _, ok := exemplar.Data[k]; ok {
 			continue
diff --git a/leaderelection/config_test.go b/leaderelection/config_test.go
index ad2e5185f..0cfa4b3cd 100644
--- a/leaderelection/config_test.go
+++ b/leaderelection/config_test.go
@@ -211,7 +211,7 @@ func TestNewStatefulSetConfig(t *testing.T) {
 	}, {
 		name:    "failure with invalid name",
 		pod:     "as-abcd",
-		wantErr: `envconfig.Process: assigning STATEFUL_CONTROLLER_ORDINAL to StatefulSetID: converting 'as-abcd' to type leaderelection.statefulSetID. details: strconv.ParseUint: parsing "abcd": invalid syntax`,
+		wantErr: `envconfig.Process: assigning STATEFUL_CONTROLLER_ORDINAL to StatefulSetID: converting 'as-abcd' to type leaderelection.statefulSetID. details: strconv.Atoi: parsing "abcd": invalid syntax`,
 	}}
 
 	for _, tc := range cases {
diff --git a/reconciler/testing/context.go b/reconciler/testing/context.go
index aa7f385be..150c59bf2 100644
--- a/reconciler/testing/context.go
+++ b/reconciler/testing/context.go
@@ -18,10 +18,10 @@ package testing
 
 import (
 	"context"
+	"testing"
 	"time"
 
 	"go.uber.org/atomic"
-	"go.uber.org/zap/zaptest"
 
 	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
 	"k8s.io/apimachinery/pkg/runtime"
@@ -39,16 +39,21 @@ import (
 )
 
 // SetupFakeContext sets up the the Context and the fake informers for the tests.
-func SetupFakeContext(t zaptest.TestingT) (context.Context, []controller.Informer) {
-	c, _, is := SetupFakeContextWithCancel(t)
+// The optional fs() can be used to edit ctx before the SetupInformer steps
+func SetupFakeContext(t testing.TB, fs ...func(context.Context) context.Context) (context.Context, []controller.Informer) {
+	c, _, is := SetupFakeContextWithCancel(t, fs...)
 	return c, is
 }
 
 // SetupFakeContextWithCancel sets up the the Context and the fake informers for the tests
 // The provided context can be canceled using provided callback.
-func SetupFakeContextWithCancel(t zaptest.TestingT) (context.Context, context.CancelFunc, []controller.Informer) {
+// The optional fs() can be used to edit ctx before the SetupInformer steps
+func SetupFakeContextWithCancel(t testing.TB, fs ...func(context.Context) context.Context) (context.Context, context.CancelFunc, []controller.Informer) {
 	ctx, c := context.WithCancel(logtesting.TestContextWithLogger(t))
 	ctx = controller.WithEventRecorder(ctx, record.NewFakeRecorder(1000))
+	for _, f := range fs {
+		ctx = f(ctx)
+	}
 	ctx, is := injection.Fake.SetupInformers(ctx, &rest.Config{})
 	return ctx, c, is
 }
diff --git a/version/version_test.go b/version/version_test.go
index d3ac416fc..2080dbc3b 100644
--- a/version/version_test.go
+++ b/version/version_test.go
@@ -41,13 +41,13 @@ func TestVersionCheck(t *testing.T) {
 		wantError       bool
 	}{{
 		name:          "greater version (patch)",
-		actualVersion: &testVersioner{version: "v1.17.2"},
+		actualVersion: &testVersioner{version: "v1.18.2"},
 	}, {
 		name:          "greater version (patch), no v",
-		actualVersion: &testVersioner{version: "1.17.2"},
+		actualVersion: &testVersioner{version: "1.18.2"},
 	}, {
 		name:          "greater version (patch), pre-release",
-		actualVersion: &testVersioner{version: "1.17.2-kpn-065dce"},
+		actualVersion: &testVersioner{version: "1.18.2-kpn-065dce"},
 	}, {
 		name:            "greater version (patch), pre-release, envvar override",
 		actualVersion:   &testVersioner{version: "1.15.11-kpn-065dce"},
@@ -61,13 +61,13 @@ func TestVersionCheck(t *testing.T) {
 		actualVersion: &testVersioner{version: "v1.18.0"},
 	}, {
 		name:          "same version",
-		actualVersion: &testVersioner{version: "v1.17.0"},
+		actualVersion: &testVersioner{version: "v1.18.0"},
 	}, {
 		name:          "same version with build",
-		actualVersion: &testVersioner{version: "v1.17.0+k3s.1"},
+		actualVersion: &testVersioner{version: "v1.18.0+k3s.1"},
 	}, {
 		name:          "same version with pre-release",
-		actualVersion: &testVersioner{version: "v1.17.0-k3s.1"},
+		actualVersion: &testVersioner{version: "v1.18.0-k3s.1"},
 	}, {
 		name:          "smaller version",
 		actualVersion: &testVersioner{version: "v1.14.3"},