[BUG] [Spark plugin] Environment variables in the pod_template that use ValueFrom
don't work
#4530
Closed
2 tasks done
Labels
Describe the bug
If we have a task like this
This results in the resulting SparkApplication spec
SECRET_ENV_VAR
is set to empty string.Expected behavior
The SparkApplication spec should look like this
Additional context to reproduce
I have a change to the unittests which can catch this.
The bug seems to be in how the pod_template is converted into a spark application. Specifically I think the problem comes from
createSparkPodSpec
where we just take theValue
of thecorev1.EnvVar
which is expected to be empty when usingValueFrom
.This is done because currently we try to funnel the
[]EnvVar
fromContainer.Env
intomap[string]string
at SparkPodSpec.EnvVars. I propose we instead put these values in SparkPodSpec.Env which has type[]EnvVar
meaning no type conversion is required and it will support all features ofcorev1.EnvVar
.I can make a PR with this change if my proposal seems sensible.
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: