1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #2550 from fanjiyun/control-network-interface-order-for-containers

reduce parameters for func JoinOptionPriority
This commit is contained in:
Sebastiaan van Stijn 2020-10-31 19:02:54 +01:00 committed by GitHub
commit 5602e9b969
3 changed files with 6 additions and 6 deletions

View file

@ -1055,7 +1055,7 @@ func CreateOptionLoadBalancer() EndpointOption {
// JoinOptionPriority function returns an option setter for priority option to
// be passed to the endpoint.Join() method.
func JoinOptionPriority(ep Endpoint, prio int) EndpointOption {
func JoinOptionPriority(prio int) EndpointOption {
return func(ep *endpoint) {
// ep lock already acquired
c := ep.network.getController()

View file

@ -51,7 +51,7 @@ fe90::2 somehost.example.com somehost
t.Fatal(err)
}
if err := ep1.Join(sbx, JoinOptionPriority(ep1, 1)); err != nil {
if err := ep1.Join(sbx, JoinOptionPriority(1)); err != nil {
t.Fatal(err)
}

View file

@ -110,15 +110,15 @@ func TestSandboxAddMultiPrio(t *testing.T) {
t.Fatal(err)
}
if err := ep1.Join(sbx, JoinOptionPriority(ep1, 1)); err != nil {
if err := ep1.Join(sbx, JoinOptionPriority(1)); err != nil {
t.Fatal(err)
}
if err := ep2.Join(sbx, JoinOptionPriority(ep2, 2)); err != nil {
if err := ep2.Join(sbx, JoinOptionPriority(2)); err != nil {
t.Fatal(err)
}
if err := ep3.Join(sbx, JoinOptionPriority(ep3, 3)); err != nil {
if err := ep3.Join(sbx, JoinOptionPriority(3)); err != nil {
t.Fatal(err)
}
@ -145,7 +145,7 @@ func TestSandboxAddMultiPrio(t *testing.T) {
}
// Re-add ep3 back
if err := ep3.Join(sbx, JoinOptionPriority(ep3, 3)); err != nil {
if err := ep3.Join(sbx, JoinOptionPriority(3)); err != nil {
t.Fatal(err)
}