mirror of https://github.com/docker/cli.git
Merge pull request #2261 from zappy-shu/19.03_backport_2250-reverse-port-long-format-order
[19.03 backport] Reverse order of long-form ports
This commit is contained in:
commit
e6e0fa0c8f
|
@ -799,7 +799,7 @@ func parsePortOpts(publishOpts []string) ([]string, error) {
|
||||||
|
|
||||||
params[opt[0]] = opt[1]
|
params[opt[0]] = opt[1]
|
||||||
}
|
}
|
||||||
optsList = append(optsList, fmt.Sprintf("%s:%s/%s", params["target"], params["published"], params["protocol"]))
|
optsList = append(optsList, fmt.Sprintf("%s:%s/%s", params["published"], params["target"], params["protocol"]))
|
||||||
}
|
}
|
||||||
return optsList, nil
|
return optsList, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -854,3 +854,9 @@ func TestParseSystemPaths(t *testing.T) {
|
||||||
assert.DeepEqual(t, readonlyPaths, tc.readonly)
|
assert.DeepEqual(t, readonlyPaths, tc.readonly)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestParsePortOpts(t *testing.T) {
|
||||||
|
parsed, err := parsePortOpts([]string{"published=1500,target=200", "target=80,published=90"})
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.DeepEqual(t, []string{"1500:200/tcp", "90:80/tcp"}, parsed)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue