fix controller Start method signature

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-11 09:05:53 +00:00
parent 810bfb618a
commit 2fcfb81066
39 changed files with 106 additions and 120 deletions

View File

@@ -692,8 +692,8 @@ func NewNSNetworkPolicyController(
return controller
}
func (c *NSNetworkPolicyController) Start(stopCh <-chan struct{}) error {
return c.Run(defaultThread, defaultSync, stopCh)
func (c *NSNetworkPolicyController) Start(ctx context.Context) error {
return c.Run(defaultThread, defaultSync, ctx.Done())
}
// Run starts the controller.

View File

@@ -17,6 +17,7 @@ limitations under the License.
package nsnetworkpolicy
import (
"context"
"fmt"
"reflect"
"strings"
@@ -157,7 +158,7 @@ var _ = Describe("Nsnetworkpolicy", func() {
c.workspaceInformerSynced = alwaysReady
c.informerSynced = alwaysReady
go c.Start(stopCh)
go c.Start(context.Background())
})
It("test func namespaceNetworkIsolateEnabled", func() {