Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

environment variables don't get injected on init-containers after upgrading to SCDF 2.11.5 #507

Open
juanpablo-santos opened this issue Jan 23, 2025 · 1 comment
Labels
type/bug Is a bug report
Milestone

Comments

@juanpablo-santos
Copy link

juanpablo-santos commented Jan 23, 2025

Hi,

kind of follow-up of #465, after upgrading to SCDF 2.11.5, we've noticed that environment variables aren't translated into the initContainer. Our tasks are launched with

deployer.TASK_NAME.kubernetes.init-container.container-name=batch
deployer.TASK_NAME.kubernetes.init-container.environment-variables=FRAMEWORK_DIR=/shared-libs,CERTIFICATES_DIR=/certificates
deployer.TASK_NAME.kubernetes.init-container.image-name=XXXXX/YYYY:ZZZ
deployer.TASK_NAME.kubernetes.init-container.volume-mounts=[{"name":"vol-shared-libs","mountPath":"/shared-libs"},{"name":"vol-certificates","mountPath":"/certificates"}]

Everything gets translated except the environment-variables bit. We've also tried with

deployer.TASK_NAME.kubernetes.init-container.env=[{"name":"FRAMEWORK_DIR","value":"/shared-dir"},{"name":"CERTIFICATES_DIR","value":"/certificates"}]

obtaining the same result, also using environmentVariables instead of environment-variables. The only way we are now able to pass environmentVariables is by setting the following property

deployer.TASK_NAME.kubernetes.init-containers=[{"container-name":"batch","environmentVariables":["FRAMEWORK_DIR=/shared-dir","CERTIFICATES_DIR=/certificates"],"image-name":"XXXXX/YYYY:ZZZ","volume-mounts":[{"name":"vol-shared-libs","mountPath":"/shared-libs"},{"name":"vol-certificates","mountPath":"/certificates"}]}]

(note that environmentVariables must be used, environment-variables isn't recognized; also, it's weird that deployer.TASK_NAME.kubernetes.init-container.environmentVariables:["FRAMEWORK_DIR=/shared-dir","CERTIFICATES_DIR=/certificates"] doesn't pick up the env vars)

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Jan 23, 2025
@cppwfs cppwfs added type/bug Is a bug report and removed status/need-triage Team needs to triage and take a first look labels Jan 23, 2025
@cppwfs cppwfs added this to the 3.0.x milestone Jan 23, 2025
@juanpablo-santos
Copy link
Author

juanpablo-santos commented Jan 24, 2025

Hi,

good news, as there seems to be a syntax that is compatible with 2.11.5 and earlier versions, json notation with environmentVariables being named exactly that way, but at least there's a workaround that allows our scripts to behave the same, no matter the version of SCDF used:

deployer.TASK_NAME.kubernetes.init-container={"container-name":"batch","environmentVariables":["FRAMEWORK_DIR=/shared-dir","CERTIFICATES_DIR=/certificates"],"image-name":"XXXXX/YYYY:ZZZ","volume-mounts":[{"name":"vol-shared-libs","mountPath":"/shared-libs"},{"name":"vol-certificates","mountPath":"/certificates"}]}

cheers,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/bug Is a bug report
Development

No branches or pull requests

2 participants