promote DisableNodeKubeProxyVersion feature gate to beta

This commit is contained in:
HirazawaUi 2024-04-14 20:32:49 +08:00
parent 8f80e01467
commit 98c29f0312
9 changed files with 19 additions and 16 deletions

View File

@ -8473,7 +8473,7 @@
"type": "string"
},
"kubeProxyVersion": {
"description": "KubeProxy Version reported by the node.",
"description": "Deprecated: KubeProxy Version reported by the node.",
"type": "string"
},
"kubeletVersion": {

View File

@ -4053,7 +4053,7 @@
},
"kubeProxyVersion": {
"default": "",
"description": "KubeProxy Version reported by the node.",
"description": "Deprecated: KubeProxy Version reported by the node.",
"type": "string"
},
"kubeletVersion": {

View File

@ -228,6 +228,7 @@ const (
// owner: @HirazawaUi
// kep: http://kep.k8s.io/4004
// alpha: v1.29
// beta: v1.31
// DisableNodeKubeProxyVersion disable the status.nodeInfo.kubeProxyVersion field of v1.Node
DisableNodeKubeProxyVersion featuregate.Feature = "DisableNodeKubeProxyVersion"
@ -1054,7 +1055,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
DisableKubeletCloudCredentialProviders: {Default: true, PreRelease: featuregate.Beta},
DisableNodeKubeProxyVersion: {Default: false, PreRelease: featuregate.Alpha},
DisableNodeKubeProxyVersion: {Default: true, PreRelease: featuregate.Beta},
DevicePluginCDIDevices: {Default: true, PreRelease: featuregate.Beta},

View File

@ -24970,7 +24970,7 @@ func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) commo
},
"kubeProxyVersion": {
SchemaProps: spec.SchemaProps{
Description: "KubeProxy Version reported by the node.",
Description: "Deprecated: KubeProxy Version reported by the node.",
Default: "",
Type: []string{"string"},
Format: "",

View File

@ -268,7 +268,7 @@ func TestUpdateNewNodeStatus(t *testing.T) {
Architecture: goruntime.GOARCH,
ContainerRuntimeVersion: "test://1.5.0",
KubeletVersion: version.Get().String(),
KubeProxyVersion: version.Get().String(),
KubeProxyVersion: "",
},
Capacity: v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(2000, resource.DecimalSI),
@ -447,7 +447,7 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
Architecture: goruntime.GOARCH,
ContainerRuntimeVersion: "test://1.5.0",
KubeletVersion: version.Get().String(),
KubeProxyVersion: version.Get().String(),
KubeProxyVersion: "",
},
Capacity: v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(2000, resource.DecimalSI),
@ -652,7 +652,7 @@ func TestUpdateNodeStatusWithRuntimeStateError(t *testing.T) {
Architecture: goruntime.GOARCH,
ContainerRuntimeVersion: "test://1.5.0",
KubeletVersion: version.Get().String(),
KubeProxyVersion: version.Get().String(),
KubeProxyVersion: "",
},
Capacity: v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(2000, resource.DecimalSI),
@ -882,7 +882,7 @@ func TestUpdateNodeStatusWithLease(t *testing.T) {
Architecture: goruntime.GOARCH,
ContainerRuntimeVersion: "test://1.5.0",
KubeletVersion: version.Get().String(),
KubeProxyVersion: version.Get().String(),
KubeProxyVersion: "",
},
Capacity: v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(2000, resource.DecimalSI),

View File

@ -2809,7 +2809,7 @@ message NodeSystemInfo {
// Kubelet Version reported by the node.
optional string kubeletVersion = 7;
// KubeProxy Version reported by the node.
// Deprecated: KubeProxy Version reported by the node.
optional string kubeProxyVersion = 8;
// The Operating System reported by the node

View File

@ -5809,7 +5809,7 @@ type NodeSystemInfo struct {
ContainerRuntimeVersion string `json:"containerRuntimeVersion" protobuf:"bytes,6,opt,name=containerRuntimeVersion"`
// Kubelet Version reported by the node.
KubeletVersion string `json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"`
// KubeProxy Version reported by the node.
// Deprecated: KubeProxy Version reported by the node.
KubeProxyVersion string `json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"`
// The Operating System reported by the node
OperatingSystem string `json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"`

View File

@ -1307,7 +1307,7 @@ var map_NodeSystemInfo = map[string]string{
"osImage": "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).",
"containerRuntimeVersion": "ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2).",
"kubeletVersion": "Kubelet Version reported by the node.",
"kubeProxyVersion": "KubeProxy Version reported by the node.",
"kubeProxyVersion": "Deprecated: KubeProxy Version reported by the node.",
"operatingSystem": "The Operating System reported by the node",
"architecture": "The Architecture reported by the node",
}

View File

@ -252,16 +252,18 @@ func checkNodesVersions(ctx context.Context, cs clientset.Interface, want string
}
for _, n := range l.Items {
// We do prefix trimming and then matching because:
// want looks like: 0.19.3-815-g50e67d4
// kv/kvp look like: v0.19.3-815-g50e67d4034e858-dirty
// want looks like: 0.19.3-815-g50e67d4
// kv look like: v0.19.3-815-g50e67d4034e858-dirty
// kpv look like: v0.19.3-815-g50e67d4034e858-dirty or empty value
kv, kpv := strings.TrimPrefix(n.Status.NodeInfo.KubeletVersion, "v"),
strings.TrimPrefix(n.Status.NodeInfo.KubeProxyVersion, "v")
strings.TrimPrefix(n.Status.NodeInfo.KubeProxyVersion, "v") //nolint:staticcheck // Keep testing deprecated KubeProxyVersion field until it's being removed
if !strings.HasPrefix(kv, want) {
return fmt.Errorf("node %s had kubelet version %s which does not start with %s",
n.ObjectMeta.Name, kv, want)
}
if !strings.HasPrefix(kpv, want) {
return fmt.Errorf("node %s had kube-proxy version %s which does not start with %s",
if len(kpv) != 0 || !strings.HasPrefix(kpv, want) {
return fmt.Errorf("node %s had kube-proxy version %s which does not start with %s or is not empty value",
n.ObjectMeta.Name, kpv, want)
}
}