skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

skaffold.env does not respect system envs

Open Aaur1s opened this issue 9 months ago • 2 comments

When using skaffold.env like this:

DOCKER_REGISTRY_ADDRESS=docker.aaur1s.dev
SKAFFOLD_DEFAULT_REPO=$DOCKER_REGISTRY_ADDRESS/portaler-backend

skaffold uses DOCKER_REGISTRY_ADDRESS from file, despite DOCKER_REGISTRY_ADDRESS being set in system envs. SKAFFOLD_DEFAULT_REPO however works just fine.

OS: Windows 11 Skaffold: v2.13.2

Aaur1s avatar Apr 20 '25 21:04 Aaur1s

My understanding is that Skaffold uses its own environment and so the only way to pass variables to Skaffold is either through skaffold.env or by using a command prefix like this:

MY_VAR=foo skaffold dev

Skaffold will not see the values from your native environment.

bhardwick avatar Apr 23 '25 19:04 bhardwick

If SKAFFOLD_DEFAULT_REPO is set in system environment it's overwriting one in skaffold.env, but this logic doesn't work with non-skaffold defined env

Aaur1s avatar Apr 25 '25 12:04 Aaur1s