Skip to content

Commit c5f772f

Browse files
[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 <dymurray@redhat.com>
1 parent 2579d49 commit c5f772f

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

api/v1alpha1/oadp_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ type PodConfig struct {
9696
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
9797
// ResourceAllocations defines the CPU and Memory resource allocations for the restic Pod
9898
// +optional
99+
// +nullable
99100
ResourceAllocations corev1.ResourceRequirements `json:"resourceAllocations,omitempty"`
100101
}
101102

bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,29 +206,34 @@ spec:
206206
resourceAllocations:
207207
description: ResourceAllocations defines the CPU and Memory
208208
resource allocations for the restic Pod
209+
nullable: true
209210
properties:
210211
limits:
211212
additionalProperties:
212213
anyOf:
213214
- type: integer
214215
- type: string
216+
nullable: true
215217
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
216218
x-kubernetes-int-or-string: true
217219
description: 'Limits describes the maximum amount
218220
of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
221+
nullable: true
219222
type: object
220223
requests:
221224
additionalProperties:
222225
anyOf:
223226
- type: integer
224227
- type: string
228+
nullable: true
225229
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
226230
x-kubernetes-int-or-string: true
227231
description: 'Requests describes the minimum amount
228232
of compute resources required. If Requests is omitted
229233
for a container, it defaults to Limits if that is
230234
explicitly specified, otherwise to an implementation-defined
231235
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
236+
nullable: true
232237
type: object
233238
type: object
234239
tolerations:
@@ -349,29 +354,34 @@ spec:
349354
resourceAllocations:
350355
description: ResourceAllocations defines the CPU and Memory
351356
resource allocations for the restic Pod
357+
nullable: true
352358
properties:
353359
limits:
354360
additionalProperties:
355361
anyOf:
356362
- type: integer
357363
- type: string
364+
nullable: true
358365
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
359366
x-kubernetes-int-or-string: true
360367
description: 'Limits describes the maximum amount
361368
of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
369+
nullable: true
362370
type: object
363371
requests:
364372
additionalProperties:
365373
anyOf:
366374
- type: integer
367375
- type: string
376+
nullable: true
368377
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
369378
x-kubernetes-int-or-string: true
370379
description: 'Requests describes the minimum amount
371380
of compute resources required. If Requests is omitted
372381
for a container, it defaults to Limits if that is
373382
explicitly specified, otherwise to an implementation-defined
374383
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
384+
nullable: true
375385
type: object
376386
type: object
377387
tolerations:

config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,29 +208,34 @@ spec:
208208
resourceAllocations:
209209
description: ResourceAllocations defines the CPU and Memory
210210
resource allocations for the restic Pod
211+
nullable: true
211212
properties:
212213
limits:
213214
additionalProperties:
214215
anyOf:
215216
- type: integer
216217
- type: string
218+
nullable: true
217219
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
218220
x-kubernetes-int-or-string: true
219221
description: 'Limits describes the maximum amount
220222
of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
223+
nullable: true
221224
type: object
222225
requests:
223226
additionalProperties:
224227
anyOf:
225228
- type: integer
226229
- type: string
230+
nullable: true
227231
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
228232
x-kubernetes-int-or-string: true
229233
description: 'Requests describes the minimum amount
230234
of compute resources required. If Requests is omitted
231235
for a container, it defaults to Limits if that is
232236
explicitly specified, otherwise to an implementation-defined
233237
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
238+
nullable: true
234239
type: object
235240
type: object
236241
tolerations:
@@ -351,29 +356,34 @@ spec:
351356
resourceAllocations:
352357
description: ResourceAllocations defines the CPU and Memory
353358
resource allocations for the restic Pod
359+
nullable: true
354360
properties:
355361
limits:
356362
additionalProperties:
357363
anyOf:
358364
- type: integer
359365
- type: string
366+
nullable: true
360367
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
361368
x-kubernetes-int-or-string: true
362369
description: 'Limits describes the maximum amount
363370
of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
371+
nullable: true
364372
type: object
365373
requests:
366374
additionalProperties:
367375
anyOf:
368376
- type: integer
369377
- type: string
378+
nullable: true
370379
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
371380
x-kubernetes-int-or-string: true
372381
description: 'Requests describes the minimum amount
373382
of compute resources required. If Requests is omitted
374383
for a container, it defaults to Limits if that is
375384
explicitly specified, otherwise to an implementation-defined
376385
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
386+
nullable: true
377387
type: object
378388
type: object
379389
tolerations:

0 commit comments

Comments
 (0)