reduce parameters for func JoinOptionPriority
Signed-off-by: fanjiyun <fan.jiyun@zte.com.cn>
This commit is contained in:
parent
b1729e8588
commit
a24e5f5fd4
3 changed files with 6 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue