From 00e4609774f85ccbd8f018ebaac8d03e7bd83e84 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 14 Mar 2024 07:21:47 +0900 Subject: [PATCH] api: NodeStatus: rename RuntimeClasses to RuntimeHandlers The runtime classes are apiserver's concept, while the handlers are kubelet's concept. For NodeStatus, it makes more sense to return the latter ones here. This commit modifies the following files: - pkg/apis/core/types.go - staging/src/k8s.io/api/core/v1/types.go - pkg/kubelet/nodestatus/setters.go - pkg/kubelet/kubelet_node_status.go - pkg/registry/core/node/strategy.go - test/e2e_node/mount_rro_linux_test.go Other changes were auto-generated by running `make update`. Signed-off-by: Akihiro Suda Kubernetes-commit: 1dc05009fe7f4e1d139b0c8394683edb54f8d082 --- ...deruntimeclass.go => noderuntimehandler.go} | 18 +++++++++--------- ...atures.go => noderuntimehandlerfeatures.go} | 12 ++++++------ applyconfigurations/core/v1/nodestatus.go | 12 ++++++------ applyconfigurations/internal/internal.go | 10 +++++----- applyconfigurations/utils.go | 8 ++++---- 5 files changed, 30 insertions(+), 30 deletions(-) rename applyconfigurations/core/v1/{noderuntimeclass.go => noderuntimehandler.go} (60%) rename applyconfigurations/core/v1/{noderuntimeclassfeatures.go => noderuntimehandlerfeatures.go} (64%) diff --git a/applyconfigurations/core/v1/noderuntimeclass.go b/applyconfigurations/core/v1/noderuntimehandler.go similarity index 60% rename from applyconfigurations/core/v1/noderuntimeclass.go rename to applyconfigurations/core/v1/noderuntimehandler.go index 497416957f..9ada0a18ef 100644 --- a/applyconfigurations/core/v1/noderuntimeclass.go +++ b/applyconfigurations/core/v1/noderuntimehandler.go @@ -18,23 +18,23 @@ limitations under the License. package v1 -// NodeRuntimeClassApplyConfiguration represents an declarative configuration of the NodeRuntimeClass type for use +// NodeRuntimeHandlerApplyConfiguration represents an declarative configuration of the NodeRuntimeHandler type for use // with apply. -type NodeRuntimeClassApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Features *NodeRuntimeClassFeaturesApplyConfiguration `json:"features,omitempty"` +type NodeRuntimeHandlerApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Features *NodeRuntimeHandlerFeaturesApplyConfiguration `json:"features,omitempty"` } -// NodeRuntimeClassApplyConfiguration constructs an declarative configuration of the NodeRuntimeClass type for use with +// NodeRuntimeHandlerApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandler type for use with // apply. -func NodeRuntimeClass() *NodeRuntimeClassApplyConfiguration { - return &NodeRuntimeClassApplyConfiguration{} +func NodeRuntimeHandler() *NodeRuntimeHandlerApplyConfiguration { + return &NodeRuntimeHandlerApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. -func (b *NodeRuntimeClassApplyConfiguration) WithName(value string) *NodeRuntimeClassApplyConfiguration { +func (b *NodeRuntimeHandlerApplyConfiguration) WithName(value string) *NodeRuntimeHandlerApplyConfiguration { b.Name = &value return b } @@ -42,7 +42,7 @@ func (b *NodeRuntimeClassApplyConfiguration) WithName(value string) *NodeRuntime // WithFeatures sets the Features field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Features field is set to the value of the last call. -func (b *NodeRuntimeClassApplyConfiguration) WithFeatures(value *NodeRuntimeClassFeaturesApplyConfiguration) *NodeRuntimeClassApplyConfiguration { +func (b *NodeRuntimeHandlerApplyConfiguration) WithFeatures(value *NodeRuntimeHandlerFeaturesApplyConfiguration) *NodeRuntimeHandlerApplyConfiguration { b.Features = value return b } diff --git a/applyconfigurations/core/v1/noderuntimeclassfeatures.go b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go similarity index 64% rename from applyconfigurations/core/v1/noderuntimeclassfeatures.go rename to applyconfigurations/core/v1/noderuntimehandlerfeatures.go index d3960eed9a..a3e3a52e88 100644 --- a/applyconfigurations/core/v1/noderuntimeclassfeatures.go +++ b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go @@ -18,22 +18,22 @@ limitations under the License. package v1 -// NodeRuntimeClassFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeClassFeatures type for use +// NodeRuntimeHandlerFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeHandlerFeatures type for use // with apply. -type NodeRuntimeClassFeaturesApplyConfiguration struct { +type NodeRuntimeHandlerFeaturesApplyConfiguration struct { RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` } -// NodeRuntimeClassFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeClassFeatures type for use with +// NodeRuntimeHandlerFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandlerFeatures type for use with // apply. -func NodeRuntimeClassFeatures() *NodeRuntimeClassFeaturesApplyConfiguration { - return &NodeRuntimeClassFeaturesApplyConfiguration{} +func NodeRuntimeHandlerFeatures() *NodeRuntimeHandlerFeaturesApplyConfiguration { + return &NodeRuntimeHandlerFeaturesApplyConfiguration{} } // WithRecursiveReadOnlyMounts sets the RecursiveReadOnlyMounts field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RecursiveReadOnlyMounts field is set to the value of the last call. -func (b *NodeRuntimeClassFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeClassFeaturesApplyConfiguration { +func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration { b.RecursiveReadOnlyMounts = &value return b } diff --git a/applyconfigurations/core/v1/nodestatus.go b/applyconfigurations/core/v1/nodestatus.go index 46e93ac85c..a4a30a2685 100644 --- a/applyconfigurations/core/v1/nodestatus.go +++ b/applyconfigurations/core/v1/nodestatus.go @@ -36,7 +36,7 @@ type NodeStatusApplyConfiguration struct { VolumesInUse []v1.UniqueVolumeName `json:"volumesInUse,omitempty"` VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"` Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"` - RuntimeClasses []NodeRuntimeClassApplyConfiguration `json:"runtimeClasses,omitempty"` + RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"` } // NodeStatusApplyConfiguration constructs an declarative configuration of the NodeStatus type for use with @@ -155,15 +155,15 @@ func (b *NodeStatusApplyConfiguration) WithConfig(value *NodeConfigStatusApplyCo return b } -// WithRuntimeClasses adds the given value to the RuntimeClasses field in the declarative configuration +// WithRuntimeHandlers adds the given value to the RuntimeHandlers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the RuntimeClasses field. -func (b *NodeStatusApplyConfiguration) WithRuntimeClasses(values ...*NodeRuntimeClassApplyConfiguration) *NodeStatusApplyConfiguration { +// If called multiple times, values provided by each call will be appended to the RuntimeHandlers field. +func (b *NodeStatusApplyConfiguration) WithRuntimeHandlers(values ...*NodeRuntimeHandlerApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { - panic("nil value passed to WithRuntimeClasses") + panic("nil value passed to WithRuntimeHandlers") } - b.RuntimeClasses = append(b.RuntimeClasses, *values[i]) + b.RuntimeHandlers = append(b.RuntimeHandlers, *values[i]) } return b } diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 1016ceeee8..0d753b07b1 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -6073,17 +6073,17 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.DaemonEndpoint default: {} -- name: io.k8s.api.core.v1.NodeRuntimeClass +- name: io.k8s.api.core.v1.NodeRuntimeHandler map: fields: - name: features type: - namedType: io.k8s.api.core.v1.NodeRuntimeClassFeatures + namedType: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures - name: name type: scalar: string default: "" -- name: io.k8s.api.core.v1.NodeRuntimeClassFeatures +- name: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures map: fields: - name: recursiveReadOnlyMounts @@ -6211,11 +6211,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: phase type: scalar: string - - name: runtimeClasses + - name: runtimeHandlers type: list: elementType: - namedType: io.k8s.api.core.v1.NodeRuntimeClass + namedType: io.k8s.api.core.v1.NodeRuntimeHandler elementRelationship: atomic - name: volumesAttached type: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 4aa30503a7..2529f03f91 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -801,10 +801,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeRuntimeClass"): - return &applyconfigurationscorev1.NodeRuntimeClassApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeRuntimeClassFeatures"): - return &applyconfigurationscorev1.NodeRuntimeClassFeaturesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): + return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): + return &applyconfigurationscorev1.NodeRuntimeHandlerFeaturesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelector"): return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"):