From d4c16411bd25119a0f5837e9e09d6193356e9e3e Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Mon, 16 Oct 2023 13:40:36 +0800 Subject: [PATCH] fix: containers should be omitempty like the Optional (#1817) --- .../templates/minio.min.io_tenants.yaml | 46 ++++++++++++++++--- pkg/apis/minio.min.io/v2/types.go | 2 +- resources/base/crds/minio.min.io_tenants.yaml | 46 ++++++++++++++++--- 3 files changed, 81 insertions(+), 13 deletions(-) diff --git a/helm/operator/templates/minio.min.io_tenants.yaml b/helm/operator/templates/minio.min.io_tenants.yaml index 5abb591845b..4dec342a7c8 100644 --- a/helm/operator/templates/minio.min.io_tenants.yaml +++ b/helm/operator/templates/minio.min.io_tenants.yaml @@ -1353,6 +1353,19 @@ spec: format: int32 type: integer type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic resources: properties: claims: @@ -1384,6 +1397,8 @@ spec: x-kubernetes-int-or-string: true type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -3047,6 +3062,11 @@ spec: items: type: string type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: granular allocatedResources: additionalProperties: anyOf: @@ -3087,8 +3107,6 @@ spec: type: array phase: type: string - resizeStatus: - type: string type: object type: object volumesPerServer: @@ -3594,6 +3612,19 @@ spec: format: int32 type: integer type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic resources: properties: claims: @@ -3625,6 +3656,8 @@ spec: x-kubernetes-int-or-string: true type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -3970,6 +4003,11 @@ spec: items: type: string type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: granular allocatedResources: additionalProperties: anyOf: @@ -4010,8 +4048,6 @@ spec: type: array phase: type: string - resizeStatus: - type: string type: object type: object type: array @@ -4743,8 +4779,6 @@ spec: - name type: object type: array - required: - - containers type: object startup: properties: diff --git a/pkg/apis/minio.min.io/v2/types.go b/pkg/apis/minio.min.io/v2/types.go index 4ed7985c639..8c6ed8c6ec2 100644 --- a/pkg/apis/minio.min.io/v2/types.go +++ b/pkg/apis/minio.min.io/v2/types.go @@ -875,7 +875,7 @@ type SideCars struct { // List of containers to run inside the Pod // +patchMergeKey=name // +patchStrategy=merge - Containers []corev1.Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"` + Containers []corev1.Container `json:"containers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"` // *Optional* + // // volumeClaimTemplates is a list of claims that pods are allowed to reference. diff --git a/resources/base/crds/minio.min.io_tenants.yaml b/resources/base/crds/minio.min.io_tenants.yaml index 5abb591845b..4dec342a7c8 100644 --- a/resources/base/crds/minio.min.io_tenants.yaml +++ b/resources/base/crds/minio.min.io_tenants.yaml @@ -1353,6 +1353,19 @@ spec: format: int32 type: integer type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic resources: properties: claims: @@ -1384,6 +1397,8 @@ spec: x-kubernetes-int-or-string: true type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -3047,6 +3062,11 @@ spec: items: type: string type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: granular allocatedResources: additionalProperties: anyOf: @@ -3087,8 +3107,6 @@ spec: type: array phase: type: string - resizeStatus: - type: string type: object type: object volumesPerServer: @@ -3594,6 +3612,19 @@ spec: format: int32 type: integer type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic resources: properties: claims: @@ -3625,6 +3656,8 @@ spec: x-kubernetes-int-or-string: true type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -3970,6 +4003,11 @@ spec: items: type: string type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: granular allocatedResources: additionalProperties: anyOf: @@ -4010,8 +4048,6 @@ spec: type: array phase: type: string - resizeStatus: - type: string type: object type: object type: array @@ -4743,8 +4779,6 @@ spec: - name type: object type: array - required: - - containers type: object startup: properties: