Accept --registry as a host alone again, completing it with the registry's port (hq ADR 0100)
This commit is contained in:
@@ -190,3 +190,17 @@ func TestTheRegistrysPortAndAddressAgree(t *testing.T) {
|
||||
t.Error("two ports for one registry were accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestARegistryGivenAsAHostAloneTakesTheRegistrysPort(t *testing.T) {
|
||||
_, opts, _, err := parseArgs([]string{"--registry", "192.0.2.10"})
|
||||
if err != nil || opts.Registry != "192.0.2.10:5000" || opts.Ports.Registry != 5000 {
|
||||
t.Errorf("--registry host alone: %s %d %v", opts.Registry, opts.Ports.Registry, err)
|
||||
}
|
||||
_, opts, _, err = parseArgs([]string{"--registry", "192.0.2.10", "--registry-port", "5100"})
|
||||
if err != nil || opts.Registry != "192.0.2.10:5100" {
|
||||
t.Errorf("--registry host with --registry-port: %s %v", opts.Registry, err)
|
||||
}
|
||||
if _, _, _, err := parseArgs([]string{"--registry", "192.0.2.10:notaport"}); err == nil {
|
||||
t.Error("a registry with a port that is not a number was accepted")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user