Skip to content

Commit d03a10d

Browse files
upgrade to latest dependencies (#781)
bumping knative.dev/networking 0561079...60e29ff: > 60e29ff upgrade to latest dependencies (# 1015) > a3d4663 upgrade to latest dependencies (# 1012) bumping knative.dev/pkg 59c22a1...9b9d535: > 9b9d535 Fix `WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP` env-var (# 3108) > 4af9a0d Add `WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP` env-var (# 3106) > 95b4b97 upgrade to latest dependencies (# 3104) Signed-off-by: Knative Automation <[email protected]>
1 parent df708dd commit d03a10d

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ require (
2121
k8s.io/code-generator v0.30.3
2222
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
2323
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
24-
knative.dev/networking v0.0.0-20241014132131-0561079d4264
25-
knative.dev/pkg v0.0.0-20241014065030-59c22a189949
24+
knative.dev/networking v0.0.0-20241022012959-60e29ff520dc
25+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
2626
sigs.k8s.io/gateway-api v1.1.0
2727
sigs.k8s.io/yaml v1.4.0
2828
)

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,10 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
680680
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
681681
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQmzBkJ9d+EIRwksKTvk=
682682
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
683-
knative.dev/networking v0.0.0-20241014132131-0561079d4264 h1:wHk7kQ+qypQtO0AR18X2u4sZFoTqC4ljymV0WgPhTS0=
684-
knative.dev/networking v0.0.0-20241014132131-0561079d4264/go.mod h1:0wgKY3Vn+tt80IFMs4aciY82H3hWgkNGEpxDAaEVCi4=
685-
knative.dev/pkg v0.0.0-20241014065030-59c22a189949 h1:7ZH7J7mzyYqhbOMEEs5ipi0PL5/rgQo+ciyLDKvIuag=
686-
knative.dev/pkg v0.0.0-20241014065030-59c22a189949/go.mod h1:HywcanTb6dH8j9AbDOVhHX65R+Dstdq+5pYHH64TcQs=
683+
knative.dev/networking v0.0.0-20241022012959-60e29ff520dc h1:0d9XXRLlyuHfINZLlYqo/BYe/+chqqNBMLKJldjTbtw=
684+
knative.dev/networking v0.0.0-20241022012959-60e29ff520dc/go.mod h1:G56j6VCLzfaN9yZ4IqfNyN4c3U1czvhUmKeZX4UjQ8Q=
685+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad h1:Nrjtr2H168rJeamH4QdyLMV1lEKHejNhaj1ymgQMfLk=
686+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad/go.mod h1:StJI72GWcm/iErmk4RqFJiOo8RLbVqPbHxUqeVwAzeo=
687687
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
688688
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
689689
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

vendor/knative.dev/pkg/webhook/configmaps/controller.go

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ func NewAdmissionController(
4646
secretInformer := secretinformer.Get(ctx)
4747
options := webhook.GetOptions(ctx)
4848

49+
// if this environment variable is set, it overrides the value in the Options
50+
disableNamespaceOwnership := webhook.DisableNamespaceOwnershipFromEnv()
51+
if disableNamespaceOwnership != nil {
52+
options.DisableNamespaceOwnership = *disableNamespaceOwnership
53+
}
54+
4955
key := types.NamespacedName{Name: name}
5056

5157
wh := &reconciler{

vendor/knative.dev/pkg/webhook/env.go

+14
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const (
3232
secretNameEnvKey = "WEBHOOK_SECRET_NAME" //nolint:gosec // This is not a hardcoded credential
3333

3434
tlsMinVersionEnvKey = "WEBHOOK_TLS_MIN_VERSION"
35+
36+
disableNamespaceOwnershipEnvKey = "WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP"
3537
)
3638

3739
// 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 {
8284
panic(fmt.Sprintf("the environment variable %q has to be either '1.2' or '1.3'", tlsMinVersionEnvKey))
8385
}
8486
}
87+
88+
func DisableNamespaceOwnershipFromEnv() *bool {
89+
disableNamespaceOwnership := os.Getenv(disableNamespaceOwnershipEnvKey)
90+
if disableNamespaceOwnership == "" {
91+
return nil
92+
}
93+
disableNamespaceOwnershipBool, err := strconv.ParseBool(disableNamespaceOwnership)
94+
if err != nil {
95+
panic(fmt.Sprintf("failed to convert the environment variable %q : %v", disableNamespaceOwnershipEnvKey, err))
96+
}
97+
return &disableNamespaceOwnershipBool
98+
}

vendor/knative.dev/pkg/webhook/webhook.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ type Options struct {
8181
// before shutting down.
8282
GracePeriod time.Duration
8383

84-
// DisableNamespaceOwnership configures whether the webhook adds an owner reference for the SYSTEM_NAMESPACE
85-
// Disabling this is useful when you expect the webhook configuration to be managed by something other than knative
84+
// DisableNamespaceOwnership configures if the SYSTEM_NAMESPACE is added as an owner reference to the
85+
// webhook configuration resources. Overridden by the WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP environment variable.
86+
// Disabling can be useful to avoid breaking systems that expect ownership to indicate a true controller
87+
// relationship: https://github.com/knative/serving/issues/15483
8688
DisableNamespaceOwnership bool
8789

8890
// ControllerOptions encapsulates options for creating a new controller,

vendor/modules.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ k8s.io/utils/trace
910910
# knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
911911
## explicit; go 1.21
912912
knative.dev/hack
913-
# knative.dev/networking v0.0.0-20241014132131-0561079d4264
913+
# knative.dev/networking v0.0.0-20241022012959-60e29ff520dc
914914
## explicit; go 1.22.0
915915
knative.dev/networking/config
916916
knative.dev/networking/pkg
@@ -954,7 +954,7 @@ knative.dev/networking/test/test_images/runtime/handlers
954954
knative.dev/networking/test/test_images/timeout
955955
knative.dev/networking/test/test_images/wsserver
956956
knative.dev/networking/test/types
957-
# knative.dev/pkg v0.0.0-20241014065030-59c22a189949
957+
# knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
958958
## explicit; go 1.22.0
959959
knative.dev/pkg/apis
960960
knative.dev/pkg/apis/duck

0 commit comments

Comments
 (0)