File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -523,7 +523,7 @@ func (d *MasterDaemon) InitServices() {
523
523
isLeader := func () bool {
524
524
return d .currState == "leader"
525
525
}
526
- networkpolicy .InitK8SServiceWatch (d .ListenURL , isLeader )
526
+ networkpolicy .InitK8SServiceWatch (d .ControlURL , isLeader )
527
527
}
528
528
}
529
529
Original file line number Diff line number Diff line change @@ -373,14 +373,11 @@ func (k8sNet *k8sContext) watchK8sEvents(errChan chan error) {
373
373
}
374
374
375
375
// InitK8SServiceWatch monitor k8s services
376
- func InitK8SServiceWatch (listenURL string , isLeader func () bool ) error {
376
+ func InitK8SServiceWatch (listenAddr string , isLeader func () bool ) error {
377
377
npLog = log .WithField ("k8s" , "netpolicy" )
378
378
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 )
384
381
if err != nil {
385
382
npLog .Errorf ("failed to create contivclient %s" , err )
386
383
return err
You can’t perform that action at this time.
0 commit comments