Skip to content

Commit 3c0f877

Browse files
authored
OADP-1150 Add Env to PodConfig (#886)
1 parent 0f24e41 commit 3c0f877

File tree

9 files changed

+702
-10
lines changed

9 files changed

+702
-10
lines changed

api/v1alpha1/oadp_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ type PodConfig struct {
101101
// +optional
102102
// +nullable
103103
ResourceAllocations corev1.ResourceRequirements `json:"resourceAllocations,omitempty"`
104+
// env defines the list of environment variables to be supplied to podSpec
105+
// +optional
106+
Env []corev1.EnvVar `json:"env,omitempty"`
104107
}
105108

106109
// ResticConfig is the configuration for restic server

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,86 @@ spec:
156156
podConfig:
157157
description: Pod specific configuration
158158
properties:
159+
env:
160+
description: env defines the list of environment variables to be supplied to podSpec
161+
items:
162+
description: EnvVar represents an environment variable present in a Container.
163+
properties:
164+
name:
165+
description: Name of the environment variable. Must be a C_IDENTIFIER.
166+
type: string
167+
value:
168+
description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".'
169+
type: string
170+
valueFrom:
171+
description: Source for the environment variable's value. Cannot be used if value is not empty.
172+
properties:
173+
configMapKeyRef:
174+
description: Selects a key of a ConfigMap.
175+
properties:
176+
key:
177+
description: The key to select.
178+
type: string
179+
name:
180+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?'
181+
type: string
182+
optional:
183+
description: Specify whether the ConfigMap or its key must be defined
184+
type: boolean
185+
required:
186+
- key
187+
type: object
188+
fieldRef:
189+
description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels[''<KEY>'']`, `metadata.annotations[''<KEY>'']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.'
190+
properties:
191+
apiVersion:
192+
description: Version of the schema the FieldPath is written in terms of, defaults to "v1".
193+
type: string
194+
fieldPath:
195+
description: Path of the field to select in the specified API version.
196+
type: string
197+
required:
198+
- fieldPath
199+
type: object
200+
resourceFieldRef:
201+
description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.'
202+
properties:
203+
containerName:
204+
description: 'Container name: required for volumes, optional for env vars'
205+
type: string
206+
divisor:
207+
anyOf:
208+
- type: integer
209+
- type: string
210+
description: Specifies the output format of the exposed resources, defaults to "1"
211+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
212+
x-kubernetes-int-or-string: true
213+
resource:
214+
description: 'Required: resource to select'
215+
type: string
216+
required:
217+
- resource
218+
type: object
219+
secretKeyRef:
220+
description: Selects a key of a secret in the pod's namespace
221+
properties:
222+
key:
223+
description: The key of the secret to select from. Must be a valid secret key.
224+
type: string
225+
name:
226+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?'
227+
type: string
228+
optional:
229+
description: Specify whether the Secret or its key must be defined
230+
type: boolean
231+
required:
232+
- key
233+
type: object
234+
type: object
235+
required:
236+
- name
237+
type: object
238+
type: array
159239
labels:
160240
additionalProperties:
161241
type: string
@@ -268,6 +348,86 @@ spec:
268348
podConfig:
269349
description: Pod specific configuration
270350
properties:
351+
env:
352+
description: env defines the list of environment variables to be supplied to podSpec
353+
items:
354+
description: EnvVar represents an environment variable present in a Container.
355+
properties:
356+
name:
357+
description: Name of the environment variable. Must be a C_IDENTIFIER.
358+
type: string
359+
value:
360+
description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".'
361+
type: string
362+
valueFrom:
363+
description: Source for the environment variable's value. Cannot be used if value is not empty.
364+
properties:
365+
configMapKeyRef:
366+
description: Selects a key of a ConfigMap.
367+
properties:
368+
key:
369+
description: The key to select.
370+
type: string
371+
name:
372+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?'
373+
type: string
374+
optional:
375+
description: Specify whether the ConfigMap or its key must be defined
376+
type: boolean
377+
required:
378+
- key
379+
type: object
380+
fieldRef:
381+
description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels[''<KEY>'']`, `metadata.annotations[''<KEY>'']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.'
382+
properties:
383+
apiVersion:
384+
description: Version of the schema the FieldPath is written in terms of, defaults to "v1".
385+
type: string
386+
fieldPath:
387+
description: Path of the field to select in the specified API version.
388+
type: string
389+
required:
390+
- fieldPath
391+
type: object
392+
resourceFieldRef:
393+
description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.'
394+
properties:
395+
containerName:
396+
description: 'Container name: required for volumes, optional for env vars'
397+
type: string
398+
divisor:
399+
anyOf:
400+
- type: integer
401+
- type: string
402+
description: Specifies the output format of the exposed resources, defaults to "1"
403+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
404+
x-kubernetes-int-or-string: true
405+
resource:
406+
description: 'Required: resource to select'
407+
type: string
408+
required:
409+
- resource
410+
type: object
411+
secretKeyRef:
412+
description: Selects a key of a secret in the pod's namespace
413+
properties:
414+
key:
415+
description: The key of the secret to select from. Must be a valid secret key.
416+
type: string
417+
name:
418+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?'
419+
type: string
420+
optional:
421+
description: Specify whether the Secret or its key must be defined
422+
type: boolean
423+
required:
424+
- key
425+
type: object
426+
type: object
427+
required:
428+
- name
429+
type: object
430+
type: array
271431
labels:
272432
additionalProperties:
273433
type: string

0 commit comments

Comments
 (0)