Skip to content

Commit

Permalink
respect both config and container_config
Browse files Browse the repository at this point in the history
to be honest it's not clear what container_config is - maybe a
deprecated field? looks like we should be using 'config' as a few images
i've tried have only specified things there.
  • Loading branch information
vito committed Oct 1, 2018
1 parent 810e134 commit 3ed6ba7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/in/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,15 @@ func rootfsFormat(dest string, req InRequest, image v1.Image) {
return
}

env := append(cfg.Config.Env, cfg.ContainerConfig.Env...)
user := cfg.Config.User
if user == "" {
user = cfg.ContainerConfig.User
}

err = json.NewEncoder(meta).Encode(ImageMetadata{
Env: cfg.ContainerConfig.Env,
User: cfg.ContainerConfig.User,
Env: env,
User: user,
})
if err != nil {
logrus.Errorf("failed to write image metadata: %s", err)
Expand Down

0 comments on commit 3ed6ba7

Please sign in to comment.