File tree 5 files changed +39
-13
lines changed 5 files changed +39
-13
lines changed Original file line number Diff line number Diff line change @@ -1644,11 +1644,19 @@ spec:
1644
1644
type : object
1645
1645
type : object
1646
1646
envVariablesOverride :
1647
- description : " huh "
1647
+ description : Override variables for all pods managed by NooBaa's operator
1648
1648
type : object
1649
1649
properties :
1650
1650
core :
1651
- description : " List of environment variables to set in the Core statefulset container. Cannot be updated."
1651
+ description : " List of environment variables to set in the Core statefulset containers."
1652
+ items :
1653
+ description : EnvVar represents an environment variable present in a Container.
1654
+ x-kubernetes-preserve-unknown-fields : true
1655
+ type : object
1656
+ x-kubernetes-preserve-unknown-fields : true
1657
+ type : array
1658
+ endpoint :
1659
+ description : " List of environment variables to set in the Endpoint deployment containers."
1652
1660
items :
1653
1661
description : EnvVar represents an environment variable present in a Container.
1654
1662
x-kubernetes-preserve-unknown-fields : true
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ type AutoscalerSpec struct {
254
254
type EnvVariablesOverrideSpec struct {
255
255
// Variables override for core statefulset
256
256
Core []corev1.EnvVar `json:"core,omitempty"`
257
+
258
+ // Variables override for endpoint deployment
259
+ Endpoint []corev1.EnvVar `json:"endpoint,omitempty"`
257
260
}
258
261
259
262
Original file line number Diff line number Diff line change @@ -1423,7 +1423,7 @@ spec:
1423
1423
status: {}
1424
1424
`
1425
1425
1426
- const Sha256_deploy_crds_noobaa_io_noobaas_yaml = "c354dda7e40756f33fe9daf07a240e92b55ac9c537bdf51101e8fe0f47cefc7e "
1426
+ const Sha256_deploy_crds_noobaa_io_noobaas_yaml = "d159d72a783f65f4c9ff716fc2c2c7ba4983c36d73ad3ca3b29c87cfe3707767 "
1427
1427
1428
1428
const File_deploy_crds_noobaa_io_noobaas_yaml = `---
1429
1429
apiVersion: apiextensions.k8s.io/v1
@@ -3071,11 +3071,19 @@ spec:
3071
3071
type: object
3072
3072
type: object
3073
3073
envVariablesOverride:
3074
- description: "huh"
3074
+ description: Override variables for all pods managed by NooBaa's operator
3075
3075
type: object
3076
3076
properties:
3077
3077
core:
3078
- description: "List of environment variables to set in the Core statefulset container. Cannot be updated."
3078
+ description: "List of environment variables to set in the Core statefulset containers."
3079
+ items:
3080
+ description: EnvVar represents an environment variable present in a Container.
3081
+ x-kubernetes-preserve-unknown-fields: true
3082
+ type: object
3083
+ x-kubernetes-preserve-unknown-fields: true
3084
+ type: array
3085
+ endpoint:
3086
+ description: "List of environment variables to set in the Endpoint deployment containers."
3079
3087
items:
3080
3088
description: EnvVar represents an environment variable present in a Container.
3081
3089
x-kubernetes-preserve-unknown-fields: true
Original file line number Diff line number Diff line change @@ -477,14 +477,6 @@ func (r *Reconciler) setDesiredCoreEnv(c *corev1.Container) {
477
477
}
478
478
util .MergeEnvArrays (& c .Env , & []corev1.EnvVar {envVar });
479
479
}
480
-
481
- if r .NooBaa .Spec .EnvVariablesOverride != nil && r .NooBaa .Spec .EnvVariablesOverride .Core != nil {
482
- // util.MergeEnvArrays will keep variables of the first array provided in
483
- // arguments in case of a conflict, so we provide the override array first
484
- // and then set the container Env array to the resulting merged array
485
- util .MergeEnvArrays (& r .NooBaa .Spec .EnvVariablesOverride .Core , & c .Env );
486
- c .Env = r .NooBaa .Spec .EnvVariablesOverride .Core ;
487
- }
488
480
}
489
481
490
482
// SetDesiredCoreApp updates the CoreApp as desired for reconciling
@@ -623,6 +615,14 @@ func (r *Reconciler) SetDesiredCoreApp() error {
623
615
util .MergeVolumeMountList (& c .VolumeMounts , & configMapVolumeMounts )
624
616
}
625
617
}
618
+
619
+ if r .NooBaa .Spec .EnvVariablesOverride != nil && r .NooBaa .Spec .EnvVariablesOverride .Core != nil {
620
+ // util.MergeEnvArrays will keep variables of the first array provided in
621
+ // arguments in case of a conflict, so we provide the override array first
622
+ // and then set the container Env array to the resulting merged array
623
+ util .MergeEnvArrays (& r .NooBaa .Spec .EnvVariablesOverride .Core , & c .Env );
624
+ c .Env = r .NooBaa .Spec .EnvVariablesOverride .Core ;
625
+ }
626
626
}
627
627
if r .NooBaa .Spec .ImagePullSecret == nil {
628
628
podSpec .ImagePullSecrets =
Original file line number Diff line number Diff line change @@ -440,6 +440,13 @@ func (r *Reconciler) SetDesiredDeploymentEndpoint() error {
440
440
441
441
r .DeploymentEndpoint .Spec .Template .Annotations ["noobaa.io/configmap-hash" ] = r .CoreAppConfig .Annotations ["noobaa.io/configmap-hash" ]
442
442
443
+ if r .NooBaa .Spec .EnvVariablesOverride != nil && r .NooBaa .Spec .EnvVariablesOverride .Endpoint != nil {
444
+ // util.MergeEnvArrays will keep variables of the first array provided in
445
+ // arguments in case of a conflict, so we provide the override array first
446
+ // and then set the container Env array to the resulting merged array
447
+ util .MergeEnvArrays (& r .NooBaa .Spec .EnvVariablesOverride .Endpoint , & c .Env );
448
+ c .Env = r .NooBaa .Spec .EnvVariablesOverride .Endpoint ;
449
+ }
443
450
return r .setDesiredEndpointMounts (podSpec , c )
444
451
}
445
452
}
You can’t perform that action at this time.
0 commit comments