Skip to content

Commit

Permalink
[oadp-1.0] OADP-535 allow for nullable resource allocations (#715)
Browse files Browse the repository at this point in the history
* OADP-535 allow for nullable resource allocations

* Add missing nullables

* Include nullable on additionalProperties

Co-authored-by: Dylan Murray <dymurray@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and dymurray authored May 27, 2022
1 parent 2579d49 commit c5f772f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/oadp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
10 changes: 10 additions & 0 deletions bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,29 +206,34 @@ 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
of compute resources required. If Requests is omitted
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:
Expand Down Expand Up @@ -349,29 +354,34 @@ 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
of compute resources required. If Requests is omitted
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:
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,29 +208,34 @@ 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
of compute resources required. If Requests is omitted
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:
Expand Down Expand Up @@ -351,29 +356,34 @@ 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
of compute resources required. If Requests is omitted
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:
Expand Down

0 comments on commit c5f772f

Please sign in to comment.