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.
Upstream-commit: 83bc5b7435565d227a7745f4832bc9ce6be7a80d
Component: engine
This commit is contained in:
Will Dietz
2013-05-23 15:54:51 -05:00
parent a518559330
commit ba9a93959a
+2 -2
View File
@@ -49,10 +49,10 @@ func CompareConfig(a, b *Config) bool {
}
func MergeConfig(userConf, imageConf *Config) {
if userConf.Hostname != "" {
if userConf.Hostname == "" {
userConf.Hostname = imageConf.Hostname
}
if userConf.User != "" {
if userConf.User == "" {
userConf.User = imageConf.User
}
if userConf.Memory == 0 {