File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -523,7 +523,7 @@ func (d *MasterDaemon) InitServices() {
523523 isLeader := func () bool {
524524 return d .currState == "leader"
525525 }
526- networkpolicy .InitK8SServiceWatch (d .ListenURL , isLeader )
526+ networkpolicy .InitK8SServiceWatch (d .ControlURL , isLeader )
527527 }
528528}
529529
Original file line number Diff line number Diff line change @@ -373,14 +373,11 @@ func (k8sNet *k8sContext) watchK8sEvents(errChan chan error) {
373373}
374374
375375// InitK8SServiceWatch monitor k8s services
376- func InitK8SServiceWatch (listenURL string , isLeader func () bool ) error {
376+ func InitK8SServiceWatch (listenAddr string , isLeader func () bool ) error {
377377 npLog = log .WithField ("k8s" , "netpolicy" )
378378
379- listenAddr := strings .Split (listenURL , ":" )
380- if len (listenAddr [0 ]) <= 0 {
381- listenAddr [0 ] = "localhost"
382- }
383- contivClient , err := client .NewContivClient ("http://" + listenAddr [0 ] + ":" + listenAddr [1 ])
379+ npLog .Infof ("Create contiv client at http://%s" , listenAddr )
380+ contivClient , err := client .NewContivClient ("http://" + listenAddr )
384381 if err != nil {
385382 npLog .Errorf ("failed to create contivclient %s" , err )
386383 return err
You can’t perform that action at this time.
0 commit comments