1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

utils.go: Fix merge logic for user and hostname.

Fall back to image-specified hostname if user doesn't
provide one, instead of only using image-specified
hostname if the user *does* try to set one.
(ditto for username)

Closes #694.
This commit is contained in:
Will Dietz 2013-05-23 15:48:50 -05:00
parent 822056094a
commit 83bc5b7435

View file

@ -49,10 +49,10 @@ func CompareConfig(a, b *Config) bool {
} }
func MergeConfig(userConf, imageConf *Config) { func MergeConfig(userConf, imageConf *Config) {
if userConf.Hostname != "" { if userConf.Hostname == "" {
userConf.Hostname = imageConf.Hostname userConf.Hostname = imageConf.Hostname
} }
if userConf.User != "" { if userConf.User == "" {
userConf.User = imageConf.User userConf.User = imageConf.User
} }
if userConf.Memory == 0 { if userConf.Memory == 0 {