Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 646: Add support for providing customized environment variables to controller #647

Merged
merged 2 commits into from
Dec 9, 2022

Conversation

anishakj
Copy link
Contributor

@anishakj anishakj commented Dec 2, 2022

Signed-off-by: anisha.kj anisha.kj@dell.com

Change log description

Added support to provide customized env variables to controller pods

Purpose of the change

Fixes #646

What the code does

Added new field ControllerEnvVars in Pravega spec. Also updated CRD

How to verify it

Verified that able to provide customized env variables to controller pods

… to controller

Signed-off-by: anisha.kj <anisha.kj@dell.com>
@@ -211,6 +211,9 @@ func makeControllerPodSpec(p *api.PravegaCluster) *corev1.PodSpec {
if p.Spec.Pravega.ControllerInitContainers != nil {
podSpec.InitContainers = append(podSpec.InitContainers, p.Spec.Pravega.ControllerInitContainers...)
}
if p.Spec.Pravega.ControllerEnvVars != nil {
podSpec.Containers[0].Env = p.Spec.Pravega.ControllerEnvVars
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not we rather append it to the existing array, like it's done for segment store?

podSpec.Containers[0].Env = append(podSpec.Containers[0].Env, p.Spec.Pravega.SegmentStoreContainerEnv...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For controller pods, there is no Env added to podspec as in segmentstore. That is the reason added like this

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it clashes with this assignement:

podSpec.Containers[0].Env = []corev1.EnvVar{
{
Name: "INFLUX_DB_SECRET_MOUNT_PATH",
Value: p.Spec.Pravega.InfluxDBSecret.MountPath,
},
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jkhalack for pointing this. I have modified it as suggested

Signed-off-by: anisha.kj <anisha.kj@dell.com>
@anishakj anishakj force-pushed the issue-146-customize-controller-env branch from 5ddeabd to 92236f8 Compare December 6, 2022 17:33
Copy link

@jkhalack jkhalack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekm derekm merged commit 8fb9ebc into master Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for providing customized environment variables to controller
3 participants