From c5f772f342c6a322f39046c9227c30574d8acec8 Mon Sep 17 00:00:00 2001 From: OpenShift Cherrypick Robot Date: Fri, 27 May 2022 10:27:09 -0700 Subject: [PATCH] [oadp-1.0] OADP-535 allow for nullable resource allocations (#715) * OADP-535 allow for nullable resource allocations * Add missing nullables * Include nullable on additionalProperties Co-authored-by: Dylan Murray --- api/v1alpha1/oadp_types.go | 1 + .../oadp.openshift.io_dataprotectionapplications.yaml | 10 ++++++++++ .../oadp.openshift.io_dataprotectionapplications.yaml | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/api/v1alpha1/oadp_types.go b/api/v1alpha1/oadp_types.go index 11cc38cef4..153a96f14a 100644 --- a/api/v1alpha1/oadp_types.go +++ b/api/v1alpha1/oadp_types.go @@ -96,6 +96,7 @@ type PodConfig struct { Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // ResourceAllocations defines the CPU and Memory resource allocations for the restic Pod // +optional + // +nullable ResourceAllocations corev1.ResourceRequirements `json:"resourceAllocations,omitempty"` } diff --git a/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml b/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml index 49b5094e3b..72cc7a3316 100644 --- a/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml +++ b/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml @@ -206,22 +206,26 @@ spec: resourceAllocations: description: ResourceAllocations defines the CPU and Memory resource allocations for the restic Pod + nullable: true properties: limits: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object requests: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Requests describes the minimum amount @@ -229,6 +233,7 @@ spec: for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object type: object tolerations: @@ -349,22 +354,26 @@ spec: resourceAllocations: description: ResourceAllocations defines the CPU and Memory resource allocations for the restic Pod + nullable: true properties: limits: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object requests: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Requests describes the minimum amount @@ -372,6 +381,7 @@ spec: for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object type: object tolerations: diff --git a/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml b/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml index 5c4694eefd..9317d55a4d 100644 --- a/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml +++ b/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml @@ -208,22 +208,26 @@ spec: resourceAllocations: description: ResourceAllocations defines the CPU and Memory resource allocations for the restic Pod + nullable: true properties: limits: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object requests: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Requests describes the minimum amount @@ -231,6 +235,7 @@ spec: for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object type: object tolerations: @@ -351,22 +356,26 @@ spec: resourceAllocations: description: ResourceAllocations defines the CPU and Memory resource allocations for the restic Pod + nullable: true properties: limits: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object requests: additionalProperties: anyOf: - type: integer - type: string + nullable: true pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Requests describes the minimum amount @@ -374,6 +383,7 @@ spec: for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + nullable: true type: object type: object tolerations: