From 5d0165d1400987bb3d07c5fc390eec2f4b73bd00 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 17 Jun 2024 08:49:36 +0200 Subject: [PATCH] api: revert deprecation annotation for v1 Binding https://github.com/kubernetes/kubernetes/pull/124898 added deprecation annotations for existing types, including v1 Binding. That had the side effect of also incorrectly marking the binding sub-resource as deprecated, which in turn caused one warning in the kube-scheduler log output per scheduled pod. --- staging/src/k8s.io/api/core/v1/types.go | 1 - staging/src/k8s.io/api/core/v1/types_test.go | 9 +++++++++ .../api/core/v1/zz_generated.prerelease-lifecycle.go | 6 ------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index f74bc1b64f0..8a7a236a42e 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -6370,7 +6370,6 @@ type NamespaceList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.0 -// +k8s:prerelease-lifecycle-gen:deprecated=1.6 // Binding ties one object to another; for example, a pod is bound to a node by a scheduler. // Deprecated in 1.7, please use the bindings subresource of pods instead. diff --git a/staging/src/k8s.io/api/core/v1/types_test.go b/staging/src/k8s.io/api/core/v1/types_test.go index 923c3b868b5..7aac6621427 100644 --- a/staging/src/k8s.io/api/core/v1/types_test.go +++ b/staging/src/k8s.io/api/core/v1/types_test.go @@ -58,3 +58,12 @@ func TestEphemeralContainer(t *testing.T) { } } } + +func TestNoBindingDeprecation(t *testing.T) { + var binding any = new(Binding) + if _, ok := binding.(interface { + APILifecycleDeprecated(major, minor int) + }); ok { + t.Fatal("The Binding type must not marked as deprecated, it is still used for the binding sub-resource which is not deprecated.") + } +} diff --git a/staging/src/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go b/staging/src/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go index 75ad5794228..6710a96d1c0 100644 --- a/staging/src/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go +++ b/staging/src/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go @@ -27,12 +27,6 @@ func (in *Binding) APILifecycleIntroduced() (major, minor int) { return 1, 0 } -// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *Binding) APILifecycleDeprecated() (major, minor int) { - return 1, 6 -} - // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *ConfigMap) APILifecycleIntroduced() (major, minor int) {