Skip to content

Commit

Permalink
fix: containers should be omitempty like the Optional (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker committed Oct 16, 2023
1 parent 1bd4e8b commit d4c1641
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 13 deletions.
46 changes: 40 additions & 6 deletions helm/operator/templates/minio.min.io_tenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1384,6 +1397,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -3047,6 +3062,11 @@ spec:
items:
type: string
type: array
allocatedResourceStatuses:
additionalProperties:
type: string
type: object
x-kubernetes-map-type: granular
allocatedResources:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -3087,8 +3107,6 @@ spec:
type: array
phase:
type: string
resizeStatus:
type: string
type: object
type: object
volumesPerServer:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -3625,6 +3656,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -3970,6 +4003,11 @@ spec:
items:
type: string
type: array
allocatedResourceStatuses:
additionalProperties:
type: string
type: object
x-kubernetes-map-type: granular
allocatedResources:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -4010,8 +4048,6 @@ spec:
type: array
phase:
type: string
resizeStatus:
type: string
type: object
type: object
type: array
Expand Down Expand Up @@ -4743,8 +4779,6 @@ spec:
- name
type: object
type: array
required:
- containers
type: object
startup:
properties:
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/minio.min.io/v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
46 changes: 40 additions & 6 deletions resources/base/crds/minio.min.io_tenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1384,6 +1397,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -3047,6 +3062,11 @@ spec:
items:
type: string
type: array
allocatedResourceStatuses:
additionalProperties:
type: string
type: object
x-kubernetes-map-type: granular
allocatedResources:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -3087,8 +3107,6 @@ spec:
type: array
phase:
type: string
resizeStatus:
type: string
type: object
type: object
volumesPerServer:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -3625,6 +3656,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -3970,6 +4003,11 @@ spec:
items:
type: string
type: array
allocatedResourceStatuses:
additionalProperties:
type: string
type: object
x-kubernetes-map-type: granular
allocatedResources:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -4010,8 +4048,6 @@ spec:
type: array
phase:
type: string
resizeStatus:
type: string
type: object
type: object
type: array
Expand Down Expand Up @@ -4743,8 +4779,6 @@ spec:
- name
type: object
type: array
required:
- containers
type: object
startup:
properties:
Expand Down

0 comments on commit d4c1641

Please sign in to comment.