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

Consolidate to single style for specifying environment-style parameters (env, buildArgs) #5877

Open
briandealwis opened this issue May 20, 2021 · 0 comments
Labels
area/config !! config-change !! kind/feature-request priority/p2 May take a couple of releases tech-debt Issues that relate to paying back technical debt.

Comments

@briandealwis
Copy link
Member

We have three styles of specifying environment-style variables in the skaffold.yaml. It's inconsistent and confusing for users (#5841).

Map-style

Seen in Docker and Kaniko's buildArgs:

        // BuildArgs are arguments passed to the docker build.
        // For example: `{"key1": "value1", "key2": "value2"}`.
        BuildArgs map[string]*string `yaml:"buildArgs,omitempty"`

The use of a pointer here allows using YAML's null to unset a value

  docker:
     buildArgs:
       name: value
       other: null

Array-style

Seen in Buildpacks's env:

        // Env are environment variables, in the `key=value` form,  passed to the build.
        // Values can use the go template syntax.
        // For example: `["key1=value1", "key2=value2", "key3={{.ENV_VARIABLE}}"]`.
        Env []string `yaml:"env,omitempty"`

Key-Value pairs (k8s.io/api/core/v1.EnvVar)

Seen in Kaniko's env:

        // Env are environment variables passed to the kaniko pod.
        // It also accepts environment variables via the go template syntax.
        // For example: `[{"name": "key1", "value": "value1"}, {"name": "key2", "value": "value2"}, {"name": "key3", "value": "'{{.ENV_VARIABLE}}'"}]`.
        Env []v1.EnvVar `yaml:"env,omitempty"`

We have other fields that are in a similar state:

  • Kaniko label is a map[string]*string
  • Cluster's annotations is a map[string]string
@briandealwis briandealwis added kind/feature-request area/config !! config-change !! tech-debt Issues that relate to paying back technical debt. labels May 20, 2021
@tejal29 tejal29 added the priority/p2 May take a couple of releases label May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config !! config-change !! kind/feature-request priority/p2 May take a couple of releases tech-debt Issues that relate to paying back technical debt.
Projects
None yet
Development

No branches or pull requests

2 participants