-
Name Previous Value Current Value Assignee
robin
wh
-
-
Fixed by merging
CommandFacade.getEnvMap()into the Kubernetes step container env when building the pod spec, matching how Docker and shell executors already apply step env vars.Please review pr #108
| Type |
Bug
|
| Priority |
Major
|
| Assignee | |
| Affected Versions |
16.4.1
|
| Labels |
No labels
|
Issue Votes (0)
Environment variables defined on a CommandStep under
envVarsare not present in the container when the job runs on a KubernetesExecutor. The same buildspec works on a RemoteDockerExecutor.Versions: OneDev 16.4.1, k8s-helper 4.2.0, k3s v1.35.5.
Reproduce:
echo "FOO=$FOO".Expected: FOO=bar Actual: FOO=
The server does send the variable to the pod.
/onedev-build/job-datainside the build pod contains the name and value but nothing applies it:/onedev-build/command/<step>.shcontains no exportIn KubernetesExecutor each container spec is built with
and commonEnvs only ever holds those three entries; the step's env vars are never merged in.
Impact: any job secret passed through envVars arrives empty, so steps fail in confusing ways (an empty SSH key gives
Load key: error in libcryptofollowed byPermission denied (publickey)), and deployment jobs can run with empty credentials rather than failing outright.Workaround: export the variables inline at the top of the command text, where
@secret:...@interpolation still works.