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

[bug] global environment int variables cause golang error #202

Open
agates4 opened this issue Sep 6, 2023 · 3 comments
Open

[bug] global environment int variables cause golang error #202

agates4 opened this issue Sep 6, 2023 · 3 comments

Comments

@agates4
Copy link

agates4 commented Sep 6, 2023

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

@agates4 agates4 changed the title [bug] global environment variables replace step level environment variables entirely [bug] global environment int variables cause golang error Sep 7, 2023
@moskyb
Copy link
Contributor

moskyb commented Sep 19, 2023

hi @agates4 - would you be able to post the golang error than having global int envars causes?

@agates4
Copy link
Author

agates4 commented Sep 28, 2023

@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

@calvinbui
Copy link

calvinbui commented Feb 21, 2024

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'

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

No branches or pull requests

3 participants