agent-stack-k8s
agent-stack-k8s copied to clipboard
[bug] global environment int variables cause golang error
If global environment variables are set in the top level pipeline file as an int, it'll cause a golang error and won't be processed
env:
myenv: 1
steps:
- label: build image
agents:
queue: kubernetes
plugins:
- kubernetes:
podSpec:
containers:
- image: alpine:latest
command: [echo]
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
args:
- "Hello, world!"
Also, the env variables should be merged, so any global envs should be merged into the local step envs
hi @agates4 - would you be able to post the golang error than having global int envars causes?
@moskyb the BUILDKITE_COMMAND
environment variable for container_0 is modified with the golang error:
BUILDKITE_COMMAND: echo "failed parsing Kubernetes plugin: json: cannot unmarshal bool into Go struct field EnvVar.PodSpec.containers.env.value of type string" && exit 1
similar error on container-0 when the gitEnvFrom
is misconfigured. an error should be thrown here instead.
- name: BUILDKITE_COMMAND
value: 'echo "failed parsing Kubernetes plugin: json: cannot unmarshal array into Go struct field EnvFromSource.GitEnvFrom.secretRef of type v1.SecretEnvSource" && exit 1'