Переглянути джерело

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.
Will Dietz 12 роки тому
батько
коміт
83bc5b7435
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      utils.go

+ 2 - 2
utils.go

@@ -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 {