feat(image-builder): Add mechanism to pass api server env vars to kaniko build jobs #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Similar to what had been performed for Merlin in this PR caraml-dev/merlin#621, this PR introduces a new mechanism for environment variables from the Turing API server to be propagated to the build environment of the Kaniko build jobs that it spins up, reducing the need for redundant repetition of configuration, especially if these environment variables are common to both the Turing API server and the build environment of the Kaniko build jobs.
Since these variables are passed to the Kaniko build jobs as build arguments (as opposed to environment variables of the container where the image gets built; see GoogleContainerTools/kaniko#2824 for more details), these variables get passed as additional arguments in the Kaniko build job.
Modifications
api/turing/config/config.go
- Addition of configs to specify environment variables to pass from the Turing API server to the Kaniko jobapi/turing/imagebuilder/imagebuilder.go
- Addition of a step to add Turing API server environment variables as Kaniko build args