fix overwrites EXPOSE

This commit is contained in:
Victor Vieux 2013-07-19 02:47:35 +00:00
parent d6fb313220
commit a0eec14c7d
2 changed files with 5 additions and 5 deletions

View File

@ -78,7 +78,7 @@ func MergeConfig(userConf, imageConf *Config) {
imageNat, _ := parseNat(imagePortSpec) imageNat, _ := parseNat(imagePortSpec)
for _, userPortSpec := range userConf.PortSpecs { for _, userPortSpec := range userConf.PortSpecs {
userNat, _ := parseNat(userPortSpec) userNat, _ := parseNat(userPortSpec)
if imageNat.Proto == userNat.Proto && imageNat.Frontend == userNat.Frontend { if imageNat.Proto == userNat.Proto && imageNat.Backend == userNat.Backend {
found = true found = true
} }
} }

View File

@ -148,7 +148,7 @@ func TestMergeConfig(t *testing.T) {
volumesUser["/test3"] = struct{}{} volumesUser["/test3"] = struct{}{}
configUser := &Config{ configUser := &Config{
Dns: []string{"3.3.3.3"}, Dns: []string{"3.3.3.3"},
PortSpecs: []string{"2222:3333", "3333:3333"}, PortSpecs: []string{"3333:2222", "3333:3333"},
Env: []string{"VAR2=3", "VAR3=3"}, Env: []string{"VAR2=3", "VAR3=3"},
Volumes: volumesUser, Volumes: volumesUser,
} }
@ -165,11 +165,11 @@ func TestMergeConfig(t *testing.T) {
} }
if len(configUser.PortSpecs) != 3 { if len(configUser.PortSpecs) != 3 {
t.Fatalf("Expected 3 portSpecs, 1111:1111, 2222:3333 and 3333:3333, found %d", len(configUser.PortSpecs)) t.Fatalf("Expected 3 portSpecs, 1111:1111, 3333:2222 and 3333:3333, found %d", len(configUser.PortSpecs))
} }
for _, portSpecs := range configUser.PortSpecs { for _, portSpecs := range configUser.PortSpecs {
if portSpecs != "1111:1111" && portSpecs != "2222:3333" && portSpecs != "3333:3333" { if portSpecs != "1111:1111" && portSpecs != "3333:2222" && portSpecs != "3333:3333" {
t.Fatalf("Expected 1111:1111 or 2222:3333 or 3333:3333, found %s", portSpecs) t.Fatalf("Expected 1111:1111 or 3333:2222 or 3333:3333, found %s", portSpecs)
} }
} }
if len(configUser.Env) != 3 { if len(configUser.Env) != 3 {