File tree 6 files changed +32
-10
lines changed
6 files changed +32
-10
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ require (
21
21
k8s.io/code-generator v0.30.3
22
22
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
23
23
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
26
26
sigs.k8s.io/gateway-api v1.1.0
27
27
sigs.k8s.io/yaml v1.4.0
28
28
)
Original file line number Diff line number Diff line change @@ -680,10 +680,10 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
680
680
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 /go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0 =
681
681
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQmzBkJ9d+EIRwksKTvk =
682
682
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 =
687
687
rsc.io/binaryregexp v0.2.0 /go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 =
688
688
rsc.io/quote/v3 v3.1.0 /go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0 =
689
689
rsc.io/sampler v1.3.0 /go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA =
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ func NewAdmissionController(
46
46
secretInformer := secretinformer .Get (ctx )
47
47
options := webhook .GetOptions (ctx )
48
48
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
+
49
55
key := types.NamespacedName {Name : name }
50
56
51
57
wh := & reconciler {
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ const (
32
32
secretNameEnvKey = "WEBHOOK_SECRET_NAME" //nolint:gosec // This is not a hardcoded credential
33
33
34
34
tlsMinVersionEnvKey = "WEBHOOK_TLS_MIN_VERSION"
35
+
36
+ disableNamespaceOwnershipEnvKey = "WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP"
35
37
)
36
38
37
39
// 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 {
82
84
panic (fmt .Sprintf ("the environment variable %q has to be either '1.2' or '1.3'" , tlsMinVersionEnvKey ))
83
85
}
84
86
}
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
+ }
Original file line number Diff line number Diff line change @@ -81,8 +81,10 @@ type Options struct {
81
81
// before shutting down.
82
82
GracePeriod time.Duration
83
83
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
86
88
DisableNamespaceOwnership bool
87
89
88
90
// ControllerOptions encapsulates options for creating a new controller,
Original file line number Diff line number Diff line change @@ -910,7 +910,7 @@ k8s.io/utils/trace
910
910
# knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
911
911
## explicit; go 1.21
912
912
knative.dev/hack
913
- # knative.dev/networking v0.0.0-20241014132131-0561079d4264
913
+ # knative.dev/networking v0.0.0-20241022012959-60e29ff520dc
914
914
## explicit; go 1.22.0
915
915
knative.dev/networking/config
916
916
knative.dev/networking/pkg
@@ -954,7 +954,7 @@ knative.dev/networking/test/test_images/runtime/handlers
954
954
knative.dev/networking/test/test_images/timeout
955
955
knative.dev/networking/test/test_images/wsserver
956
956
knative.dev/networking/test/types
957
- # knative.dev/pkg v0.0.0-20241014065030-59c22a189949
957
+ # knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
958
958
## explicit; go 1.22.0
959
959
knative.dev/pkg/apis
960
960
knative.dev/pkg/apis/duck
You can’t perform that action at this time.
0 commit comments