From 5831d10a48056383ddad28f4bf29b99bd7ccb560 Mon Sep 17 00:00:00 2001 From: Vitaliy Emporopulo Date: Tue, 24 Feb 2026 10:07:03 +0200 Subject: [PATCH] Mark defaultRuntime as optional, remove validation constraints Commit cf964b8c marked `defaultRuntime` as deprecated, removed it from alm-examples in the OpenShift operator. However, the validations on this field remained in the CRD. As a result, trying to create a default `ClusterPolicy` based on alm-examples failed with the following error: ``` spec.operator.defaultRuntime: Unsupported value: "": supported values: "docker", "crio", "containerd" ``` This fixes the issue by making the field optional and removing the validations. Signed-off-by: Vitaliy Emporopulo --- api/nvidia/v1/clusterpolicy_types.go | 5 ++--- bundle/manifests/nvidia.com_clusterpolicies.yaml | 7 ------- config/crd/bases/nvidia.com_clusterpolicies.yaml | 7 ------- .../gpu-operator/crds/nvidia.com_clusterpolicies.yaml | 7 ------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/api/nvidia/v1/clusterpolicy_types.go b/api/nvidia/v1/clusterpolicy_types.go index 417b412ef..f79497e64 100644 --- a/api/nvidia/v1/clusterpolicy_types.go +++ b/api/nvidia/v1/clusterpolicy_types.go @@ -139,9 +139,8 @@ const ( // OperatorSpec describes configuration options for the operator type OperatorSpec struct { // Deprecated: DefaultRuntime is no longer used by the gpu-operator. This is instead, detected at runtime. - // +kubebuilder:validation:Enum=docker;crio;containerd - // +kubebuilder:default=docker - DefaultRuntime Runtime `json:"defaultRuntime"` + // +optional + DefaultRuntime Runtime `json:"defaultRuntime,omitempty"` // +kubebuilder:default=nvidia RuntimeClass string `json:"runtimeClass,omitempty"` InitContainer InitContainerSpec `json:"initContainer,omitempty"` diff --git a/bundle/manifests/nvidia.com_clusterpolicies.yaml b/bundle/manifests/nvidia.com_clusterpolicies.yaml index 782d5aad9..030581fc1 100644 --- a/bundle/manifests/nvidia.com_clusterpolicies.yaml +++ b/bundle/manifests/nvidia.com_clusterpolicies.yaml @@ -1887,13 +1887,8 @@ spec: queryable and should be preserved when modifying objects. type: object defaultRuntime: - default: docker description: 'Deprecated: DefaultRuntime is no longer used by the gpu-operator. This is instead, detected at runtime.' - enum: - - docker - - crio - - containerd type: string initContainer: description: 'Deprecated: InitContainerSpec describes configuration @@ -1934,8 +1929,6 @@ spec: image should be used on OpenShift to build and install driver modules type: boolean - required: - - defaultRuntime type: object psa: description: PSA defines spec for PodSecurityAdmission configuration diff --git a/config/crd/bases/nvidia.com_clusterpolicies.yaml b/config/crd/bases/nvidia.com_clusterpolicies.yaml index 782d5aad9..030581fc1 100644 --- a/config/crd/bases/nvidia.com_clusterpolicies.yaml +++ b/config/crd/bases/nvidia.com_clusterpolicies.yaml @@ -1887,13 +1887,8 @@ spec: queryable and should be preserved when modifying objects. type: object defaultRuntime: - default: docker description: 'Deprecated: DefaultRuntime is no longer used by the gpu-operator. This is instead, detected at runtime.' - enum: - - docker - - crio - - containerd type: string initContainer: description: 'Deprecated: InitContainerSpec describes configuration @@ -1934,8 +1929,6 @@ spec: image should be used on OpenShift to build and install driver modules type: boolean - required: - - defaultRuntime type: object psa: description: PSA defines spec for PodSecurityAdmission configuration diff --git a/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml b/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml index 782d5aad9..030581fc1 100644 --- a/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml +++ b/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml @@ -1887,13 +1887,8 @@ spec: queryable and should be preserved when modifying objects. type: object defaultRuntime: - default: docker description: 'Deprecated: DefaultRuntime is no longer used by the gpu-operator. This is instead, detected at runtime.' - enum: - - docker - - crio - - containerd type: string initContainer: description: 'Deprecated: InitContainerSpec describes configuration @@ -1934,8 +1929,6 @@ spec: image should be used on OpenShift to build and install driver modules type: boolean - required: - - defaultRuntime type: object psa: description: PSA defines spec for PodSecurityAdmission configuration