Repository: knative-sandbox/net-kourier
Pull request #531 (2021-05-31 05:52:56)

[main] Upgrade to latest dependencies
Cron -knative-prow-robot

/cc knative-sandbox/networking-wg-leads
/assign knative-sandbox/networking-wg-leads

Produced by: knative-sandbox/knobots/actions/update-deps

Details:
```
bumping knative.dev/networking c90fe70...77a9c97:
  > 77a9c97 upgrade to latest dependencies (# 424)
  > 329cdb3 Update actions (# 422)
bumping knative.dev/pkg 980a337...47dfdcf:
  > 47dfdcf consolidate k8s flags to an environment package (# 2133)
  > 6484377 update boilerplate date (# 2134)
  > 35916ab Update actions (# 2132)
```

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

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/net-kourier/pull/531#" title="Author self-approved">knative-automation</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **zhiminxiang** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @zhiminxiang` 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-sandbox%2Fnet-kourier).

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

- **[OWNERS](https://github.com/knative-sandbox/net-kourier/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":["zhiminxiang"]} -->
codecov[bot]: # [Codecov](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) Report
> Merging [#531](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) (9066388) into [main](https://codecov.io/gh/knative-sandbox/net-kourier/commit/2ad5cf1e1a91f7a323ea36bd2ad56053ca2ee833?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) (2ad5cf1) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531/graphs/tree.svg?width=650&height=150&src=pr&token=KmlRo23zX4&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox)](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox)

```diff
@@           Coverage Diff           @@
##             main     #531   +/-   ##
=======================================
  Coverage   71.38%   71.38%           
=======================================
  Files          18       18           
  Lines         615      615           
=======================================
  Hits          439      439           
  Misses        150      150           
  Partials       26       26           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox). Last update [2ad5cf1...9066388](https://codecov.io/gh/knative-sandbox/net-kourier/pull/531?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox).

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

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/net-kourier/pull/531#" title="Author self-approved">knative-automation</a>*, *<a href="https://github.com/knative-sandbox/net-kourier/pull/531#pullrequestreview-672032892" title="Approved">markusthoemmes</a>*

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

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

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

- ~~[OWNERS](https://github.com/knative-sandbox/net-kourier/blob/main/OWNERS)~~ [markusthoemmes]

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":[]} -->

Patch:
diff --git a/go.mod b/go.mod
index 0fb1b671..2cdba5dc 100644
--- a/go.mod
+++ b/go.mod
@@ -18,6 +18,6 @@ require (
 	k8s.io/client-go v0.19.7
 	k8s.io/code-generator v0.19.7
 	knative.dev/hack v0.0.0-20210428122153-93ad9129c268
-	knative.dev/networking v0.0.0-20210526142327-c90fe70eb354
-	knative.dev/pkg v0.0.0-20210526081028-980a33719a10
+	knative.dev/networking v0.0.0-20210531042431-77a9c97d65c4
+	knative.dev/pkg v0.0.0-20210528203030-47dfdcfaedfd
 )
diff --git a/go.sum b/go.sum
index dd5e2355..fff19703 100644
--- a/go.sum
+++ b/go.sum
@@ -1113,10 +1113,10 @@ k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K
 k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 knative.dev/hack v0.0.0-20210428122153-93ad9129c268 h1:lBIj9Epd9UQ55NEaHzAdY/UZbuaegCdGPKVC2+Z68Q0=
 knative.dev/hack v0.0.0-20210428122153-93ad9129c268/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
-knative.dev/networking v0.0.0-20210526142327-c90fe70eb354 h1:3qt3rmWuRVWrQcTFT+voKJgRcMxypKLi9d1vjSemakM=
-knative.dev/networking v0.0.0-20210526142327-c90fe70eb354/go.mod h1:jHERS/qCx8Tpd06GJaUSlYuz8WMXwifpG2yZE9Ir7BQ=
-knative.dev/pkg v0.0.0-20210526081028-980a33719a10 h1:4tC0TcIx4EU6PCcRwdIiCWuKI3vpOgpQUrF1nUeF1t8=
-knative.dev/pkg v0.0.0-20210526081028-980a33719a10/go.mod h1:nOD9XjvR+UuO1fHZSaOhfTWDCIz06crh1qQppgZDzR0=
+knative.dev/networking v0.0.0-20210531042431-77a9c97d65c4 h1:h4NBetC58E90rU5iJ6bNDxRzttREOsnEqwQun4aApEM=
+knative.dev/networking v0.0.0-20210531042431-77a9c97d65c4/go.mod h1:uz3qq7Y/sPnTEreHs4RM7AS8NMjO19guYEw3zqaNIsI=
+knative.dev/pkg v0.0.0-20210528203030-47dfdcfaedfd h1:UEVVrLzbuwD6DGR6pBy41onVZI8lC9QCZboBs5qxeLc=
+knative.dev/pkg v0.0.0-20210528203030-47dfdcfaedfd/go.mod h1:nOD9XjvR+UuO1fHZSaOhfTWDCIz06crh1qQppgZDzR0=
 pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
 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=
diff --git a/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go
index f4da6604..ae98f046 100644
--- a/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go
@@ -1,7 +1,7 @@
 // +build !ignore_autogenerated
 
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go
index e2b84acd..1e060d9e 100644
--- a/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go
@@ -1,7 +1,7 @@
 // +build !ignore_autogenerated
 
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/client/injection/kube/client/client.go b/vendor/knative.dev/pkg/client/injection/kube/client/client.go
index b7994cb7..2c7be6d3 100644
--- a/vendor/knative.dev/pkg/client/injection/kube/client/client.go
+++ b/vendor/knative.dev/pkg/client/injection/kube/client/client.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints/endpoints.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints/endpoints.go
index 3b6a9674..daa392ae 100644
--- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints/endpoints.go
+++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints/endpoints.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go
index 8f8a6fff..0742ab1b 100644
--- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go
+++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/secret/secret.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/secret/secret.go
index 5442d08b..8f0880f5 100644
--- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/secret/secret.go
+++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/secret/secret.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/service/service.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/service/service.go
index e80633a3..1bc4a32b 100644
--- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/service/service.go
+++ b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/service/service.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go
index 7b9e9ab9..c1c13675 100644
--- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go
+++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/factory.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/environment/client_config.go b/vendor/knative.dev/pkg/environment/client_config.go
new file mode 100644
index 00000000..604f82ff
--- /dev/null
+++ b/vendor/knative.dev/pkg/environment/client_config.go
@@ -0,0 +1,105 @@
+/*
+Copyright 2021 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package environment
+
+import (
+	"errors"
+	"flag"
+	"fmt"
+	"math"
+	"os"
+
+	"k8s.io/client-go/rest"
+	"k8s.io/client-go/tools/clientcmd"
+	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
+)
+
+// ClientConfig holds the information about the environment and can be configured with flags
+type ClientConfig struct {
+	Cluster    string  // K8s cluster (defaults to cluster in kubeconfig)
+	ServerURL  string  // ServerURL - The address of the Kubernetes API server. Overrides any value in kubeconfig.
+	Burst      int     // Burst - Maximum burst for throttle.
+	QPS        float64 // QPS - Maximum QPS to the server from the client.
+	Kubeconfig string  // Kubeconfig - Path to a kubeconfig. Current casing is present for backwards compatibility
+}
+
+func (c *ClientConfig) InitFlags(fs *flag.FlagSet) {
+	fs.StringVar(&c.Cluster, "cluster", "", "Defaults to the current cluster in kubeconfig.")
+
+	fs.StringVar(&c.ServerURL, "server", "",
+		"The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.")
+
+	fs.StringVar(&c.Kubeconfig, "kubeconfig", os.Getenv("KUBECONFIG"),
+		"Path to a kubeconfig. Only required if out-of-cluster.")
+
+	fs.IntVar(&c.Burst, "kube-api-burst", 0, "Maximum burst for throttle.")
+
+	fs.Float64Var(&c.QPS, "kube-api-qps", 0, "Maximum QPS to the server from the client.")
+}
+
+func (c *ClientConfig) GetRESTConfig() (*rest.Config, error) {
+	if c.Burst < 0 {
+		return nil, fmt.Errorf("provided burst value %d must be > 0", c.Burst)
+	}
+	if c.QPS < 0 || c.QPS > math.MaxFloat32 {
+		return nil, fmt.Errorf("provided QPS value %f must be >0 and <3.4+e38", c.QPS)
+	}
+
+	// If we have an explicit indication of where the kubernetes config lives, read that.
+	if c.Kubeconfig != "" {
+		return c.configFromPath(c.Kubeconfig)
+	}
+
+	// If not, try the in-cluster config.
+	if rc, err := rest.InClusterConfig(); err == nil {
+		return c.applyOverrides(rc), nil
+	}
+
+	// If no in-cluster config, try the default location in the user's home directory.
+	if c, err := c.configFromPath(clientcmd.RecommendedHomeFile); err == nil {
+		return c, nil
+	}
+
+	return nil, errors.New("could not create a valid kubeconfig")
+}
+
+func (c *ClientConfig) configFromPath(path string) (*rest.Config, error) {
+	overrides := &clientcmd.ConfigOverrides{}
+
+	if c.Cluster != "" {
+		overrides.Context = clientcmdapi.Context{Cluster: c.Cluster}
+	} else if c.ServerURL != "" {
+		overrides.ClusterInfo = clientcmdapi.Cluster{Server: c.ServerURL}
+	}
+
+	config, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
+		&clientcmd.ClientConfigLoadingRules{ExplicitPath: path},
+		overrides,
+	).ClientConfig()
+
+	if err != nil {
+		return nil, err
+	}
+
+	return c.applyOverrides(config), nil
+}
+
+func (c *ClientConfig) applyOverrides(restCfg *rest.Config) *rest.Config {
+	restCfg.QPS = float32(c.QPS)
+	restCfg.Burst = c.Burst
+	return restCfg
+}
diff --git a/vendor/knative.dev/pkg/injection/config.go b/vendor/knative.dev/pkg/injection/config.go
index 2f1aab41..f54f84b4 100644
--- a/vendor/knative.dev/pkg/injection/config.go
+++ b/vendor/knative.dev/pkg/injection/config.go
@@ -17,102 +17,34 @@ limitations under the License.
 package injection
 
 import (
-	"errors"
 	"flag"
 	"log"
-	"math"
-	"os"
-	"sync"
 
 	"k8s.io/client-go/rest"
-	"k8s.io/client-go/tools/clientcmd"
 	"k8s.io/klog"
+	"knative.dev/pkg/environment"
 )
 
-// Environment holds the config for flag based config.
-type Environment struct {
-	// ServerURL - The address of the Kubernetes API server. Overrides any value in kubeconfig.
-	ServerURL string
-	// Kubeconfig - Path to a kubeconfig.
-	Kubeconfig string // Note: named Kubeconfig because of legacy reasons vs KubeConfig.
-	// Burst - Maximum burst for throttle.
-	Burst int
-	// QPS - Maximum QPS to the server from the client.
-	QPS float64
-}
-
-var (
-	env  *Environment
-	once sync.Once
-)
-
-func Flags() *Environment {
-	once.Do(func() {
-		env = new(Environment)
-
-		flag.StringVar(&env.ServerURL, "server", "",
-			"The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.")
-
-		flag.StringVar(&env.Kubeconfig, "kubeconfig", os.Getenv("KUBECONFIG"),
-			"Path to a kubeconfig. Only required if out-of-cluster.")
-
-		flag.IntVar(&env.Burst, "kube-api-burst", 0, "Maximum burst for throttle.")
-
-		flag.Float64Var(&env.QPS, "kube-api-qps", 0, "Maximum QPS to the server from the client.")
-	})
-	return env
-}
-
 // ParseAndGetRESTConfigOrDie parses the rest config flags and creates a client or
 // dies by calling log.Fatalf.
 func ParseAndGetRESTConfigOrDie() *rest.Config {
-	env := Flags()
-
+	env := new(environment.ClientConfig)
+	env.InitFlags(flag.CommandLine)
 	klog.InitFlags(flag.CommandLine)
 	flag.Parse()
-	if env.Burst < 0 {
-		log.Fatal("Invalid burst value", env.Burst)
-	}
-	if env.QPS < 0 || env.QPS > math.MaxFloat32 {
-		log.Fatal("Invalid QPS value", env.QPS)
-	}
-
-	cfg, err := GetRESTConfig(env.ServerURL, env.Kubeconfig)
+	cfg, err := env.GetRESTConfig()
 	if err != nil {
 		log.Fatal("Error building kubeconfig: ", err)
 	}
-
-	cfg.Burst = env.Burst
-	cfg.QPS = float32(env.QPS)
-
 	return cfg
 }
 
 // GetRESTConfig returns a rest.Config to be used for kubernetes client creation.
-// It does so in the following order:
-//   1. Use the passed kubeconfig/serverURL.
-//   2. Fallback to the KUBECONFIG environment variable.
-//   3. Fallback to in-cluster config.
-//   4. Fallback to the ~/.kube/config.
+// Deprecated: use environment.ClientConfig package
 func GetRESTConfig(serverURL, kubeconfig string) (*rest.Config, error) {
-	// If we have an explicit indication of where the kubernetes config lives, read that.
-	if kubeconfig != "" {
-		c, err := clientcmd.BuildConfigFromFlags(serverURL, kubeconfig)
-		if err != nil {
-			return nil, err
-		}
-		return c, nil
+	env := environment.ClientConfig{
+		Kubeconfig: kubeconfig,
+		ServerURL:  serverURL,
 	}
-
-	// If not, try the in-cluster config.
-	if c, err := rest.InClusterConfig(); err == nil {
-		return c, nil
-	}
-
-	// If no in-cluster config, try the default location in the user's home directory.
-	if c, err := clientcmd.BuildConfigFromFlags("", clientcmd.RecommendedHomeFile); err == nil {
-		return c, nil
-	}
-
-	return nil, errors.New("could not create a valid kubeconfig")
+	return env.GetRESTConfig()
 }
diff --git a/vendor/knative.dev/pkg/injection/sharedmain/main.go b/vendor/knative.dev/pkg/injection/sharedmain/main.go
index b2067bb1..de49ae1a 100644
--- a/vendor/knative.dev/pkg/injection/sharedmain/main.go
+++ b/vendor/knative.dev/pkg/injection/sharedmain/main.go
@@ -57,17 +57,6 @@ func init() {
 	maxprocs.Set()
 }
 
-// GetConfig returns a rest.Config to be used for kubernetes client creation.
-// It does so in the following order:
-//   1. Use the passed kubeconfig/serverURL.
-//   2. Fallback to the KUBECONFIG environment variable.
-//   3. Fallback to in-cluster config.
-//   4. Fallback to the ~/.kube/config.
-// Deprecated: use injection.GetRESTConfig
-func GetConfig(serverURL, kubeconfig string) (*rest.Config, error) {
-	return injection.GetRESTConfig(serverURL, kubeconfig)
-}
-
 // GetLoggingConfig gets the logging config from either the file system if present
 // or via reading a configMap from the API.
 // The context is expected to be initialized with injection.
@@ -253,13 +242,6 @@ func flush(logger *zap.SugaredLogger) {
 	metrics.FlushExporter()
 }
 
-// ParseAndGetConfigOrDie parses the rest config flags and creates a client or
-// dies by calling log.Fatalf.
-// Deprecated: use injection.ParseAndGetRESTConfigOrDie
-func ParseAndGetConfigOrDie() *rest.Config {
-	return injection.ParseAndGetRESTConfigOrDie()
-}
-
 // SetupLoggerOrDie sets up the logger using the config from the given context
 // and returns a logger and atomic level, or dies by calling log.Fatalf.
 func SetupLoggerOrDie(ctx context.Context, component string) (*zap.SugaredLogger, zap.AtomicLevel) {
diff --git a/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go
index 53345202..79d26075 100644
--- a/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go
@@ -1,7 +1,7 @@
 // +build !ignore_autogenerated
 
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go
index 822bb4db..d9024668 100644
--- a/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/pkg/metrics/zz_generated.deepcopy.go
@@ -1,7 +1,7 @@
 // +build !ignore_autogenerated
 
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go
index 9494168c..3b3e7a17 100644
--- a/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/pkg/tracker/zz_generated.deepcopy.go
@@ -1,7 +1,7 @@
 // +build !ignore_autogenerated
 
 /*
-Copyright 2020 The Knative Authors
+Copyright 2021 The Knative Authors
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 69145dcf..158a83fc 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -857,7 +857,7 @@ k8s.io/utils/trace
 # knative.dev/hack v0.0.0-20210428122153-93ad9129c268
 ## explicit
 knative.dev/hack
-# knative.dev/networking v0.0.0-20210526142327-c90fe70eb354
+# knative.dev/networking v0.0.0-20210531042431-77a9c97d65c4
 ## explicit
 knative.dev/networking/config
 knative.dev/networking/pkg
@@ -890,7 +890,7 @@ knative.dev/networking/test/test_images/runtime/handlers
 knative.dev/networking/test/test_images/timeout
 knative.dev/networking/test/test_images/wsserver
 knative.dev/networking/test/types
-# knative.dev/pkg v0.0.0-20210526081028-980a33719a10
+# knative.dev/pkg v0.0.0-20210528203030-47dfdcfaedfd
 ## explicit
 knative.dev/pkg/apis
 knative.dev/pkg/apis/duck
@@ -910,6 +910,7 @@ knative.dev/pkg/configmap
 knative.dev/pkg/configmap/informer
 knative.dev/pkg/configmap/testing
 knative.dev/pkg/controller
+knative.dev/pkg/environment
 knative.dev/pkg/hack
 knative.dev/pkg/hash
 knative.dev/pkg/injection
@@ -936,7 +937,7 @@ knative.dev/pkg/signals
 knative.dev/pkg/system
 knative.dev/pkg/system/testing
 knative.dev/pkg/test
-knative.dev/pkg/test/flags
+knative.dev/pkg/test/environment
 knative.dev/pkg/test/ha
 knative.dev/pkg/test/helpers
 knative.dev/pkg/test/ingress


Test patch:
diff --git a/vendor/knative.dev/pkg/test/clients.go b/vendor/knative.dev/pkg/test/clients.go
index e35a3904..37301ae4 100644
--- a/vendor/knative.dev/pkg/test/clients.go
+++ b/vendor/knative.dev/pkg/test/clients.go
@@ -23,8 +23,6 @@ import (
 	"fmt"
 	"strings"
 
-	"knative.dev/pkg/test/flags"
-
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/client-go/kubernetes"
@@ -44,8 +42,8 @@ type KubeClient struct {
 // NewSpoofingClient returns a spoofing client to make requests
 func NewSpoofingClient(ctx context.Context, client kubernetes.Interface, logf logging.FormatLogger,
 	domain string, resolvable bool, opts ...spoof.TransportOption) (*spoof.SpoofingClient, error) {
-	return spoof.New(ctx, client, logf, domain, resolvable, flags.Flags().IngressEndpoint,
-		flags.Flags().SpoofRequestInterval, flags.Flags().SpoofRequestTimeout, opts...)
+	return spoof.New(ctx, client, logf, domain, resolvable, Flags.IngressEndpoint,
+		Flags.SpoofRequestInterval, Flags.SpoofRequestTimeout, opts...)
 }
 
 // NewKubeClient instantiates and returns several clientsets required for making request to the
diff --git a/vendor/knative.dev/pkg/test/e2e_flags.go b/vendor/knative.dev/pkg/test/e2e_flags.go
index d7233255..648cb88d 100644
--- a/vendor/knative.dev/pkg/test/e2e_flags.go
+++ b/vendor/knative.dev/pkg/test/e2e_flags.go
@@ -22,12 +22,11 @@ package test
 import (
 	"bytes"
 	"flag"
-	"os/user"
-	"path/filepath"
 	"text/template"
 
-	"knative.dev/pkg/injection"
-	testflags "knative.dev/pkg/test/flags"
+	"k8s.io/client-go/tools/clientcmd"
+	env "knative.dev/pkg/environment"
+	testenv "knative.dev/pkg/test/environment"
 	"knative.dev/pkg/test/logging"
 )
 
@@ -41,25 +40,21 @@ var (
 // EnvironmentFlags define the flags that are needed to run the e2e tests.
 // Deprecated: use test/flags.Flags() or injection.Flags()
 type EnvironmentFlags struct {
-	*injection.Environment
-	*testflags.TestEnvironment
+	env.ClientConfig
+	testenv.TestClientConfig
 }
 
 func initializeFlags() *EnvironmentFlags {
 	f := new(EnvironmentFlags)
 
-	testflags.InitFlags(flag.CommandLine)
-
-	f.TestEnvironment = testflags.Flags()
-	f.Environment = injection.Flags()
+	f.ClientConfig.InitFlags(flag.CommandLine)
+	f.TestClientConfig.InitFlags(flag.CommandLine)
 
 	// We want to do this defaulting for tests only. The flags are reused between tests
 	// and production code and we want to make sure that production code defaults to
 	// the in-cluster config correctly.
-	if f.Environment.Kubeconfig == "" {
-		if usr, err := user.Current(); err == nil {
-			f.Environment.Kubeconfig = filepath.Join(usr.HomeDir, ".kube", "config")
-		}
+	if f.Kubeconfig == "" {
+		f.Kubeconfig = clientcmd.RecommendedHomeFile
 	}
 
 	return f
@@ -73,7 +68,7 @@ func SetupLoggingFlags() {
 
 // ImagePath is a helper function to transform an image name into an image reference that can be pulled.
 func ImagePath(name string) string {
-	tpl, err := template.New("image").Parse(testflags.Flags().ImageTemplate)
+	tpl, err := template.New("image").Parse(Flags.ImageTemplate)
 	if err != nil {
 		panic("could not parse image template: " + err.Error())
 	}
@@ -84,9 +79,9 @@ func ImagePath(name string) string {
 		Name       string
 		Tag        string
 	}{
-		Repository: testflags.Flags().DockerRepo,
+		Repository: Flags.DockerRepo,
 		Name:       name,
-		Tag:        testflags.Flags().Tag,
+		Tag:        Flags.Tag,
 	}); err != nil {
 		panic("could not apply the image template: " + err.Error())
 	}
diff --git a/vendor/knative.dev/pkg/test/flags/e2e_flags.go b/vendor/knative.dev/pkg/test/environment/config.go
similarity index 59%
rename from vendor/knative.dev/pkg/test/flags/e2e_flags.go
rename to vendor/knative.dev/pkg/test/environment/config.go
index fc9032a7..39cfe901 100644
--- a/vendor/knative.dev/pkg/test/flags/e2e_flags.go
+++ b/vendor/knative.dev/pkg/test/environment/config.go
@@ -25,9 +25,8 @@ import (
 	"time"
 )
 
-// TestEnvironment define the config that are needed to run the e2e tests.
-type TestEnvironment struct {
-	Cluster              string        // K8s cluster (defaults to cluster in kubeconfig)
+// TestClientConfig defines propertis about the test environment
+type TestClientConfig struct {
 	Namespace            string        // K8s namespace (blank by default, to be overwritten by test suite)
 	IngressEndpoint      string        // Host to use for ingress endpoint
 	ImageTemplate        string        // Template to build the image reference (defaults to {{.Repository}}/{{.Name}}:{{.Tag}})
@@ -37,43 +36,25 @@ type TestEnvironment struct {
 	SpoofRequestTimeout  time.Duration // SpoofRequestTimeout is the timeout for polling requests in SpoofingClient
 }
 
-var f *TestEnvironment
-
 // InitFlags is for explicitly initializing the flags.
-func InitFlags(flagset *flag.FlagSet) {
-	if flagset == nil {
-		flagset = flag.CommandLine
-	}
-
-	f = new(TestEnvironment)
-
-	flagset.StringVar(&f.Cluster, "cluster", "",
-		"Provide the cluster to test against. Defaults to the current cluster in kubeconfig.")
-
-	flagset.StringVar(&f.Namespace, "namespace", "",
+func (c *TestClientConfig) InitFlags(fs *flag.FlagSet) {
+	fs.StringVar(&c.Namespace, "namespace", "",
 		"Provide the namespace you would like to use for these tests.")
 
-	flagset.StringVar(&f.IngressEndpoint, "ingressendpoint", "", "Provide a static endpoint url to the ingress server used during tests.")
+	fs.StringVar(&c.IngressEndpoint, "ingressendpoint", "", "Provide a static endpoint url to the ingress server used during tests.")
 
-	flagset.StringVar(&f.ImageTemplate, "imagetemplate", "{{.Repository}}/{{.Name}}:{{.Tag}}",
+	fs.StringVar(&c.ImageTemplate, "imagetemplate", "{{.Repository}}/{{.Name}}:{{.Tag}}",
 		"Provide a template to generate the reference to an image from the test. Defaults to `{{.Repository}}/{{.Name}}:{{.Tag}}`.")
 
-	flagset.DurationVar(&f.SpoofRequestInterval, "spoofinterval", 1*time.Second,
+	fs.DurationVar(&c.SpoofRequestInterval, "spoofinterval", 1*time.Second,
 		"Provide an interval between requests for the SpoofingClient")
 
-	flagset.DurationVar(&f.SpoofRequestTimeout, "spooftimeout", 5*time.Minute,
+	fs.DurationVar(&c.SpoofRequestTimeout, "spooftimeout", 5*time.Minute,
 		"Provide a request timeout for the SpoofingClient")
 
 	defaultRepo := os.Getenv("KO_DOCKER_REPO")
-	flagset.StringVar(&f.DockerRepo, "dockerrepo", defaultRepo,
+	fs.StringVar(&c.DockerRepo, "dockerrepo", defaultRepo,
 		"Provide the uri of the docker repo you have uploaded the test image to using `uploadtestimage.sh`. Defaults to $KO_DOCKER_REPO")
 
-	flagset.StringVar(&f.Tag, "tag", "latest", "Provide the version tag for the test images.")
-}
-
-// Flags returns the command line flags or defaults for settings in the user's
-// environment. See TestEnvironment for a list of supported fields.
-// Caller must call InitFlags() and flags.Parse() before calling Flags().
-func Flags() *TestEnvironment {
-	return f
+	fs.StringVar(&c.Tag, "tag", "latest", "Provide the version tag for the test images.")
 }
diff --git a/vendor/knative.dev/pkg/test/logstream/interface.go b/vendor/knative.dev/pkg/test/logstream/interface.go
index 1ca333b5..33bc0233 100644
--- a/vendor/knative.dev/pkg/test/logstream/interface.go
+++ b/vendor/knative.dev/pkg/test/logstream/interface.go
@@ -22,6 +22,7 @@ import (
 	"strings"
 	"sync"
 
+	"k8s.io/client-go/kubernetes"
 	"knative.dev/pkg/system"
 	"knative.dev/pkg/test"
 	"knative.dev/pkg/test/helpers"
@@ -46,12 +47,18 @@ func Start(t ti) Canceler {
 	// Do this lazily to make import ordering less important.
 	once.Do(func() {
 		if ns := os.Getenv(system.NamespaceEnvKey); ns != "" {
-			kc, err := test.NewKubeClient(test.Flags.Kubeconfig, test.Flags.Cluster)
+			config, err := test.Flags.GetRESTConfig()
 			if err != nil {
 				t.Error("Error loading client config", "error", err)
 				return
 			}
 
+			kc, err := kubernetes.NewForConfig(config)
+			if err != nil {
+				t.Error("Error creating kubernetes client", "error", err)
+				return
+			}
+
 			// handle case when ns contains a csv list
 			namespaces := strings.Split(ns, ",")
 			stream = &shim{logstreamv2.FromNamespaces(context.Background(), kc, namespaces)}
diff --git a/vendor/knative.dev/pkg/test/request.go b/vendor/knative.dev/pkg/test/request.go
index ecaecd68..32a6a205 100644
--- a/vendor/knative.dev/pkg/test/request.go
+++ b/vendor/knative.dev/pkg/test/request.go
@@ -24,8 +24,6 @@ import (
 	"strings"
 	"time"
 
-	"knative.dev/pkg/test/flags"
-
 	"k8s.io/client-go/kubernetes"
 	"knative.dev/pkg/test/logging"
 	"knative.dev/pkg/test/spoof"
@@ -102,7 +100,7 @@ func WaitForEndpointState(
 	resolvable bool,
 	opts ...interface{}) (*spoof.Response, error) {
 	return WaitForEndpointStateWithTimeout(ctx, kubeClient, logf, url, inState,
-		desc, resolvable, flags.Flags().SpoofRequestTimeout, opts...)
+		desc, resolvable, Flags.SpoofRequestTimeout, opts...)
 }
 
 // WaitForEndpointStateWithTimeout will poll an endpoint until inState indicates the state is achieved