Skip to content

Commit 6dbef33

Browse files
committed
error out if env_from is absolute path
1 parent b4045af commit 6dbef33

File tree

1 file changed

+2
-1
lines changed
  • internal/devconfig/configfile

1 file changed

+2
-1
lines changed

internal/devconfig/configfile/env.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ func (c *ConfigFile) ParseEnvsFromDotEnv() (map[string]string, error) {
2727
return nil, fmt.Errorf("env file does not have a .env extension")
2828
}
2929
envFileAbsPath := filepath.Dir(c.AbsRootPath)
30+
// We don't allow absolute path for env_from as it breaks reproducibility
3031
if filepath.IsAbs(c.EnvFrom) {
31-
envFileAbsPath = path.Join(envFileAbsPath, path.Base(c.EnvFrom))
32+
return nil, fmt.Errorf("`env_from` field can't take an absolute path")
3233
} else {
3334
envFileAbsPath = path.Join(envFileAbsPath, c.EnvFrom)
3435
}

0 commit comments

Comments
 (0)