Skip to content

Commit 291c0a8

Browse files
[main] Upgrade to latest dependencies (#8262)
upgrade to latest dependencies bumping knative.dev/reconciler-test 1678877...09111f0: > 09111f0 upgrade to latest dependencies (# 764) 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 6aa49dc commit 291c0a8

File tree

8 files changed

+44
-10
lines changed

8 files changed

+44
-10
lines changed

Diff for: go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ require (
4545
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
4646
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
4747
knative.dev/hack/schema v0.0.0-20241010131451-05b2fb30cb4d
48-
knative.dev/pkg v0.0.0-20241014065030-59c22a189949
49-
knative.dev/reconciler-test v0.0.0-20241011013609-1678877fb244
48+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
49+
knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364
5050
sigs.k8s.io/yaml v1.4.0
5151
)
5252

Diff for: go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,10 @@ knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQ
843843
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
844844
knative.dev/hack/schema v0.0.0-20241010131451-05b2fb30cb4d h1:N+UlBE8F8LJUh/m6cYSwzqdqNg65BD9jbWoWO9nfqEA=
845845
knative.dev/hack/schema v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:jRH/sx6mwwuMVhvJgnzSaoYA1N4qaIkJa+zxEGtVA5I=
846-
knative.dev/pkg v0.0.0-20241014065030-59c22a189949 h1:7ZH7J7mzyYqhbOMEEs5ipi0PL5/rgQo+ciyLDKvIuag=
847-
knative.dev/pkg v0.0.0-20241014065030-59c22a189949/go.mod h1:HywcanTb6dH8j9AbDOVhHX65R+Dstdq+5pYHH64TcQs=
848-
knative.dev/reconciler-test v0.0.0-20241011013609-1678877fb244 h1:A8GY6ARaJtUQUsB10zJJvvFQ5BzrpxDF1AGpJHkCGno=
849-
knative.dev/reconciler-test v0.0.0-20241011013609-1678877fb244/go.mod h1:PXOqfSSDHzaVPXrpEPlxsOSQRIQJGnSrj2IuVQh3Kas=
846+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad h1:Nrjtr2H168rJeamH4QdyLMV1lEKHejNhaj1ymgQMfLk=
847+
knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad/go.mod h1:StJI72GWcm/iErmk4RqFJiOo8RLbVqPbHxUqeVwAzeo=
848+
knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364 h1:DIc+vbaFKOSGktPXJ1MaXIXoDjlmUIXQkHiZaPcYGbQ=
849+
knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364/go.mod h1:PVRnK/YQo9s3foRtut00oAxvCPc9f/qV2PApZh/rMPw=
850850
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
851851
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
852852
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

Diff for: 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{

Diff for: 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+
}

Diff for: vendor/knative.dev/pkg/webhook/resourcesemantics/defaulting/controller.go

+6
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{

Diff for: vendor/knative.dev/pkg/webhook/resourcesemantics/validation/controller.go

+6
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.

Diff for: 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,

Diff for: vendor/modules.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ knative.dev/hack/schema/commands
10781078
knative.dev/hack/schema/docs
10791079
knative.dev/hack/schema/registry
10801080
knative.dev/hack/schema/schema
1081-
# knative.dev/pkg v0.0.0-20241014065030-59c22a189949
1081+
# knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad
10821082
## explicit; go 1.22.0
10831083
knative.dev/pkg/apiextensions/storageversion
10841084
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
@@ -1223,7 +1223,7 @@ knative.dev/pkg/webhook/resourcesemantics
12231223
knative.dev/pkg/webhook/resourcesemantics/conversion
12241224
knative.dev/pkg/webhook/resourcesemantics/defaulting
12251225
knative.dev/pkg/webhook/resourcesemantics/validation
1226-
# knative.dev/reconciler-test v0.0.0-20241011013609-1678877fb244
1226+
# knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364
12271227
## explicit; go 1.22.0
12281228
knative.dev/reconciler-test/cmd/eventshub
12291229
knative.dev/reconciler-test/pkg/environment

0 commit comments

Comments
 (0)