Skip to content

Commit

Permalink
Pass api server env vars as kaniko build args
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Dec 23, 2024
1 parent 772ce15 commit 848c995
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions api/pkg/imagebuilder/imagebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,9 @@ func (c *imageBuilder) createKanikoJobSpec(
volumes, volumeMounts = c.configureVolumesAndVolumeMountsToAddCredentials(volumes, volumeMounts)
envVars = c.configureEnvVarsToAddCredentials(envVars)

// Add all other env vars that are propagated from the API server
// Add all other env vars that are propagated from the API server as build args
for _, envVar := range c.config.KanikoAPIServerEnvVars {
envVars = append(envVars, v1.EnvVar{
Name: envVar,
Value: os.Getenv(envVar),
})
kanikoArgs = append(kanikoArgs, fmt.Sprintf("--build-arg=%s=%s", envVar, os.Getenv(envVar)))
}

var resourceRequirements RequestLimitResources
Expand Down

0 comments on commit 848c995

Please sign in to comment.