-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
FR: ko
builder to support envvars in labels
config field
#6916
Labels
Comments
aaron-prindle
added
kind/todo
implementation task/epic for the skaffold team
kind/question
User question
kind/design discussion
triage/discuss
Items for discussion
and removed
kind/question
User question
kind/todo
implementation task/epic for the skaffold team
labels
Nov 29, 2021
halvards
added a commit
to halvards/skaffold
that referenced
this issue
Dec 7, 2021
This change enables `ko` builder users to substitute environment variable values in the `labels` and `env` config fields. These fields are used for image labels and build-time environment variables, respectively. Envvar templating of image labels can be used to add information such as the Git commit SHA to the image, see GoogleContainerTools#6916. Also, environment variable expansion of `flags` and `ldflags` in the `ko` builder configuration now supports Skaffold's templating syntax, for consistency. For backwards compatibility, `ko`'s templating syntax still works with `flags` and `ldflags`: Skaffold: `{{.FOO}}` `ko`: `{{.Env.FOO}}` Tracking: GoogleContainerTools#6041 Fixes: GoogleContainerTools#6916
halvards
added a commit
to halvards/skaffold
that referenced
this issue
Dec 8, 2021
This change enables `ko` builder users to substitute environment variable values in the `labels` and `env` config fields. These fields are used for image labels and build-time environment variables, respectively. Envvar templating of image labels can be used to add information such as the Git commit SHA to the image, see GoogleContainerTools#6916. Also, environment variable expansion of `flags` and `ldflags` in the `ko` builder configuration now supports Skaffold's templating syntax, for consistency. For backwards compatibility, `ko`'s templating syntax still works with `flags` and `ldflags`: Skaffold: `{{.FOO}}` `ko`: `{{.Env.FOO}}` Tracking: GoogleContainerTools#6041 Fixes: GoogleContainerTools#6916
halvards
added a commit
to halvards/skaffold
that referenced
this issue
Dec 9, 2021
This change enables `ko` builder users to substitute environment variable values in the `labels` and `env` config fields. These fields are used for image labels and build-time environment variables, respectively. Envvar templating of image labels can be used to add information such as the Git commit SHA to the image, see GoogleContainerTools#6916. Also, environment variable expansion of `flags` and `ldflags` in the `ko` builder configuration now supports Skaffold's templating syntax, for consistency. For backwards compatibility, `ko`'s templating syntax still works with `flags` and `ldflags`: Skaffold: `{{.FOO}}` `ko`: `{{.Env.FOO}}` Tracking: GoogleContainerTools#6041 Fixes: GoogleContainerTools#6916
tejal29
pushed a commit
that referenced
this issue
Dec 13, 2021
This change enables `ko` builder users to substitute environment variable values in the `labels` and `env` config fields. These fields are used for image labels and build-time environment variables, respectively. Envvar templating of image labels can be used to add information such as the Git commit SHA to the image, see #6916. Also, environment variable expansion of `flags` and `ldflags` in the `ko` builder configuration now supports Skaffold's templating syntax, for consistency. For backwards compatibility, `ko`'s templating syntax still works with `flags` and `ldflags`: Skaffold: `{{.FOO}}` `ko`: `{{.Env.FOO}}` Tracking: #6041 Fixes: #6916
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Desired behavior
When using Skaffold to publish a "releaseable" container image in a CI build, users often want to add image labels with information such as release tag, git SHA, and more.
Example: https://github.com/google/k8s-digester/blob/main/.github/workflows/release.yml#L136
Current behavior
The
ko
builderlabels
config field doesn't support expansion of environment variables.Design considerations
The
flags
andldflags
ko
builder config fields support expansion of environment variables. However, this expansion is currently handled by the upstreamko
implementation, which uses a slightly different syntax to other Skaffold config fields that support envvar expansion.Skaffold:
{{.FOO}}
ko
:{{.Env.FOO}}
Would we accept different envvar handling and syntax for different fields within the same builder config?
Or should we consider moving envvar expansion of the
flags
andldflags
fields to Skaffold?Tracking: #6041
The text was updated successfully, but these errors were encountered: