Skip to content

Commit bef397a

Browse files
upgrade to latest dependencies (#1481)
bumping knative.dev/pkg 95b4b97...9b9d535: > 9b9d535 Fix `WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP` env-var (# 3108) > 4af9a0d Add `WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP` env-var (# 3106) bumping knative.dev/eventing 6aa49dc...291c0a8: > 291c0a8 [main] Upgrade to latest dependencies (# 8262) Signed-off-by: Knative Automation <[email protected]>
1 parent fe64165 commit bef397a

File tree

8 files changed

+44
-10
lines changed

8 files changed

+44
-10
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ require (
2020
k8s.io/client-go v0.31.0
2121
k8s.io/code-generator v0.31.0
2222
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8
23-
knative.dev/eventing v0.42.1-0.20241016013536-6aa49dc1db88
23+
knative.dev/eventing v0.43.0
2424
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
25-
knative.dev/pkg v0.0.0-20241015082832-95b4b97567b5
25+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
2626
knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364
2727
sigs.k8s.io/controller-runtime v0.19.0
2828
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,12 +826,12 @@ k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 h1:1Wof1cGQgA5pqgo8MxKPtf
826826
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8/go.mod h1:Os6V6dZwLNii3vxFpxcNaTmH8LJJBkOTg1N0tOA0fvA=
827827
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
828828
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
829-
knative.dev/eventing v0.42.1-0.20241016013536-6aa49dc1db88 h1:Y50FB+2J5/DejNBre3klilKPmJFx31wv1OtTbpQUrjA=
830-
knative.dev/eventing v0.42.1-0.20241016013536-6aa49dc1db88/go.mod h1:5+F5Htg4l8TMn2bb8sjCiFdojIFqrSPyUj81/VXIVdA=
829+
knative.dev/eventing v0.43.0 h1:GELHZ0yYosMeV78l4alMsd7HJciEu6a3T2C5l7MPi3Y=
830+
knative.dev/eventing v0.43.0/go.mod h1:pdrF+bEUfRkNn9ifWXS7DoVj5W31gA5KQVd8iwplXUo=
831831
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQmzBkJ9d+EIRwksKTvk=
832832
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
833-
knative.dev/pkg v0.0.0-20241015082832-95b4b97567b5 h1:0ZKQVzST2Y3nSud1hNzTYM+UhTHKOJLjSfmZmzjwpN4=
834-
knative.dev/pkg v0.0.0-20241015082832-95b4b97567b5/go.mod h1:StJI72GWcm/iErmk4RqFJiOo8RLbVqPbHxUqeVwAzeo=
833+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad h1:Nrjtr2H168rJeamH4QdyLMV1lEKHejNhaj1ymgQMfLk=
834+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad/go.mod h1:StJI72GWcm/iErmk4RqFJiOo8RLbVqPbHxUqeVwAzeo=
835835
knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364 h1:DIc+vbaFKOSGktPXJ1MaXIXoDjlmUIXQkHiZaPcYGbQ=
836836
knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364/go.mod h1:PVRnK/YQo9s3foRtut00oAxvCPc9f/qV2PApZh/rMPw=
837837
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=

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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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/resourcesemantics/defaulting/controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ func newController(ctx context.Context, name string, optsFunc ...OptionFunc) *co
8484
f(opts)
8585
}
8686

87+
// if this environment variable is set, it overrides the value in the Options
88+
disableNamespaceOwnership := webhook.DisableNamespaceOwnershipFromEnv()
89+
if disableNamespaceOwnership != nil {
90+
wopts.DisableNamespaceOwnership = *disableNamespaceOwnership
91+
}
92+
8793
key := types.NamespacedName{Name: name}
8894

8995
wh := &reconciler{

vendor/knative.dev/pkg/webhook/resourcesemantics/validation/controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ func newController(ctx context.Context, name string, optsFunc ...OptionFunc) *co
7070
f(opts)
7171
}
7272

73+
// if this environment variable is set, it overrides the value in the Options
74+
disableNamespaceOwnership := webhook.DisableNamespaceOwnershipFromEnv()
75+
if disableNamespaceOwnership != nil {
76+
woptions.DisableNamespaceOwnership = *disableNamespaceOwnership
77+
}
78+
7379
wh := &reconciler{
7480
LeaderAwareFuncs: pkgreconciler.LeaderAwareFuncs{
7581
// Have this reconciler enqueue our singleton whenever it becomes leader.

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

Lines changed: 4 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ k8s.io/utils/pointer
10791079
k8s.io/utils/ptr
10801080
k8s.io/utils/strings/slices
10811081
k8s.io/utils/trace
1082-
# knative.dev/eventing v0.42.1-0.20241016013536-6aa49dc1db88
1082+
# knative.dev/eventing v0.43.0
10831083
## explicit; go 1.22.0
10841084
knative.dev/eventing/cmd/heartbeats
10851085
knative.dev/eventing/pkg/adapter/v2
@@ -1209,7 +1209,7 @@ knative.dev/eventing/test/test_images/print
12091209
# knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
12101210
## explicit; go 1.21
12111211
knative.dev/hack
1212-
# knative.dev/pkg v0.0.0-20241015082832-95b4b97567b5
1212+
# knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
12131213
## explicit; go 1.22.0
12141214
knative.dev/pkg/apis
12151215
knative.dev/pkg/apis/duck

0 commit comments

Comments
 (0)