Skip to content

Commit

Permalink
support parse key-only environment variable
Browse files Browse the repository at this point in the history
fix #303
  • Loading branch information
ngtuna committed Dec 16, 2016
1 parent 4dd31da commit 247b247
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/loader/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ func loadEnvVars(envars []string) []kobject.EnvVar {

if character == "" {
envs = append(envs, kobject.EnvVar{
Name: e,
Name: e,
Value: os.Getenv(e),
})
} else {
values := strings.SplitN(e, character, 2)
// try to get value from os env
if values[1] == "" {
values[1] = os.Getenv(values[0])
}
envs = append(envs, kobject.EnvVar{
Name: values[0],
Value: values[1],
Expand Down

0 comments on commit 247b247

Please sign in to comment.