From c93d8c49a1b755776d4298357f86707d26cd5701 Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Mon, 21 Oct 2024 10:53:27 -0400 Subject: [PATCH] upgrade to latest dependencies (#15581) bumping knative.dev/networking 75d9920...a3d4663: > a3d4663 upgrade to latest dependencies (# 1012) > 0561079 upgrade to latest dependencies (# 1011) bumping knative.dev/pkg 59c22a1...4af9a0d: > 4af9a0d Add `WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP` env-var (# 3106) > 95b4b97 upgrade to latest dependencies (# 3104) bumping knative.dev/caching f9d59e9...ccfb189: > ccfb189 upgrade to latest dependencies (# 896) Signed-off-by: Knative Automation --- go.mod | 6 +++--- go.sum | 12 ++++++------ vendor/knative.dev/pkg/webhook/env.go | 14 ++++++++++++++ vendor/knative.dev/pkg/webhook/webhook.go | 12 ++++++++++-- vendor/modules.txt | 6 +++--- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 456980cb3df3..937889cced12 100644 --- a/go.mod +++ b/go.mod @@ -34,10 +34,10 @@ require ( k8s.io/code-generator v0.30.3 k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - knative.dev/caching v0.0.0-20241010131930-f9d59e934f7a + knative.dev/caching v0.0.0-20241015090132-ccfb189fed8e knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d - knative.dev/networking v0.0.0-20241010132208-75d9920a9248 - knative.dev/pkg v0.0.0-20241014065030-59c22a189949 + knative.dev/networking v0.0.0-20241015085032-a3d46633cfb3 + knative.dev/pkg v0.0.0-20241021053726-4af9a0d3f8b5 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index 72c6f690fb67..1f32d45a74ad 100644 --- a/go.sum +++ b/go.sum @@ -946,14 +946,14 @@ k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 h1:1Wof1cGQgA5pqgo8MxKPtf k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8/go.mod h1:Os6V6dZwLNii3vxFpxcNaTmH8LJJBkOTg1N0tOA0fvA= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/caching v0.0.0-20241010131930-f9d59e934f7a h1:z0O6pA3Vn9Ni7Amw7yWgyhbS3Pu9ddY/WM4BWCFQzfY= -knative.dev/caching v0.0.0-20241010131930-f9d59e934f7a/go.mod h1:B3uuHl3nUBX8sB71j1pViZiuebRNFjEolHwJxeYDWG8= +knative.dev/caching v0.0.0-20241015090132-ccfb189fed8e h1:SFUaPsSwBOLnrakXCoOi+iGe74xGW3TRDwDXmD29xyo= +knative.dev/caching v0.0.0-20241015090132-ccfb189fed8e/go.mod h1:Gdarh0MOPnzYhT7/f5FFFClwRbbp0bJGK8J2Viu1g54= knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQmzBkJ9d+EIRwksKTvk= knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= -knative.dev/networking v0.0.0-20241010132208-75d9920a9248 h1:yc8FzuFsaPRPF0qeFcfJQ5n8CqmQF5a631e/+VwyTkM= -knative.dev/networking v0.0.0-20241010132208-75d9920a9248/go.mod h1:rIDqdud8+jryNa9LgHQZ0kOpR0k5fC6bkV0aAPhfSzM= -knative.dev/pkg v0.0.0-20241014065030-59c22a189949 h1:7ZH7J7mzyYqhbOMEEs5ipi0PL5/rgQo+ciyLDKvIuag= -knative.dev/pkg v0.0.0-20241014065030-59c22a189949/go.mod h1:HywcanTb6dH8j9AbDOVhHX65R+Dstdq+5pYHH64TcQs= +knative.dev/networking v0.0.0-20241015085032-a3d46633cfb3 h1:pnCWTaxtOdiqtjJC0kGw+4qC7ChH3DkchReSSSBtLQ8= +knative.dev/networking v0.0.0-20241015085032-a3d46633cfb3/go.mod h1:xaOhZH277o5f7VTWOBeDQNrGGXeNV2B9dxMn3bp26Ow= +knative.dev/pkg v0.0.0-20241021053726-4af9a0d3f8b5 h1:T+40/2nEh78mT31zYUMjL3ENrZSM6jNApGgz+tcDqwc= +knative.dev/pkg v0.0.0-20241021053726-4af9a0d3f8b5/go.mod h1:StJI72GWcm/iErmk4RqFJiOo8RLbVqPbHxUqeVwAzeo= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/knative.dev/pkg/webhook/env.go b/vendor/knative.dev/pkg/webhook/env.go index ffb7570110d2..e622f5f97b5f 100644 --- a/vendor/knative.dev/pkg/webhook/env.go +++ b/vendor/knative.dev/pkg/webhook/env.go @@ -32,6 +32,8 @@ const ( secretNameEnvKey = "WEBHOOK_SECRET_NAME" //nolint:gosec // This is not a hardcoded credential tlsMinVersionEnvKey = "WEBHOOK_TLS_MIN_VERSION" + + disableNamespaceOwnershipEnvKey = "WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP" ) // PortFromEnv returns the webhook port set by portEnvKey, or default port if env var is not set. @@ -82,3 +84,15 @@ func TLSMinVersionFromEnv(defaultTLSMinVersion uint16) uint16 { panic(fmt.Sprintf("the environment variable %q has to be either '1.2' or '1.3'", tlsMinVersionEnvKey)) } } + +func DisableNamespaceOwnershipFromEnv() *bool { + disableNamespaceOwnership := os.Getenv(disableNamespaceOwnershipEnvKey) + if disableNamespaceOwnership == "" { + return nil + } + disableNamespaceOwnershipBool, err := strconv.ParseBool(disableNamespaceOwnership) + if err != nil { + panic(fmt.Sprintf("failed to convert the environment variable %q : %v", disableNamespaceOwnershipEnvKey, err)) + } + return &disableNamespaceOwnershipBool +} diff --git a/vendor/knative.dev/pkg/webhook/webhook.go b/vendor/knative.dev/pkg/webhook/webhook.go index 1b90e75fcaf5..dc198179692b 100644 --- a/vendor/knative.dev/pkg/webhook/webhook.go +++ b/vendor/knative.dev/pkg/webhook/webhook.go @@ -81,8 +81,10 @@ type Options struct { // before shutting down. GracePeriod time.Duration - // DisableNamespaceOwnership configures whether the webhook adds an owner reference for the SYSTEM_NAMESPACE - // Disabling this is useful when you expect the webhook configuration to be managed by something other than knative + // DisableNamespaceOwnership configures if the SYSTEM_NAMESPACE is added as an owner reference to the + // webhook configuration resources. Overridden by the WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP environment variable. + // Disabling can be useful to avoid breaking systems that expect ownership to indicate a true controller + // relationship: https://github.com/knative/serving/issues/15483 DisableNamespaceOwnership bool // ControllerOptions encapsulates options for creating a new controller, @@ -164,6 +166,12 @@ func New( return nil, fmt.Errorf("unsupported TLS version: %d", opts.TLSMinVersion) } + // if the environment variable is set, it overrides the value in the Options + disableNamespaceOwnership := DisableNamespaceOwnershipFromEnv() + if disableNamespaceOwnership != nil { + opts.DisableNamespaceOwnership = *disableNamespaceOwnership + } + syncCtx, cancel := context.WithCancel(context.Background()) webhook = &Webhook{ diff --git a/vendor/modules.txt b/vendor/modules.txt index 168f8a181421..2d83d3d0ab95 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1337,7 +1337,7 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/caching v0.0.0-20241010131930-f9d59e934f7a +# knative.dev/caching v0.0.0-20241015090132-ccfb189fed8e ## explicit; go 1.22.0 knative.dev/caching/config knative.dev/caching/pkg/apis/caching @@ -1361,7 +1361,7 @@ knative.dev/caching/pkg/client/listers/caching/v1alpha1 # knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d ## explicit; go 1.21 knative.dev/hack -# knative.dev/networking v0.0.0-20241010132208-75d9920a9248 +# knative.dev/networking v0.0.0-20241015085032-a3d46633cfb3 ## explicit; go 1.22.0 knative.dev/networking/config knative.dev/networking/pkg @@ -1400,7 +1400,7 @@ knative.dev/networking/pkg/http/stats knative.dev/networking/pkg/ingress knative.dev/networking/pkg/k8s knative.dev/networking/pkg/prober -# knative.dev/pkg v0.0.0-20241014065030-59c22a189949 +# knative.dev/pkg v0.0.0-20241021053726-4af9a0d3f8b5 ## explicit; go 1.22.0 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate