Skip to content

Commit

Permalink
Merge pull request spidernet-io#2971 from Icarus9913/fix/wk/kubevirt
Browse files Browse the repository at this point in the history
fix:  spiderpool-agent crashes when kubevirt static IP feature is off
  • Loading branch information
weizhoublue authored Dec 21, 2023
2 parents 2e5ef5c + 16548f1 commit 2aa98aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions cmd/spiderpool-agent/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,12 @@ func initAgentServiceManagers(ctx context.Context) {
}
agentContext.StsManager = statefulSetManager

if agentContext.Cfg.EnableKubevirtStaticIP {
logger.Debug("Begin to initialize Kubevirt manager")
kubevirtManager := kubevirtmanager.NewKubevirtManager(
agentContext.CRDManager.GetClient(),
agentContext.CRDManager.GetAPIReader(),
)
agentContext.KubevirtManager = kubevirtManager
}
logger.Debug("Begin to initialize Kubevirt manager")
kubevirtManager := kubevirtmanager.NewKubevirtManager(
agentContext.CRDManager.GetClient(),
agentContext.CRDManager.GetAPIReader(),
)
agentContext.KubevirtManager = kubevirtManager

logger.Debug("Begin to initialize Endpoint manager")
endpointManager, err := workloadendpointmanager.NewWorkloadEndpointManager(
Expand Down
14 changes: 6 additions & 8 deletions cmd/spiderpool-controller/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,12 @@ func initControllerServiceManagers(ctx context.Context) {
}
controllerContext.StsManager = statefulSetManager

if controllerContext.Cfg.EnableKubevirtStaticIP {
logger.Debug("Begin to initialize Kubevirt manager")
kubevirtManager := kubevirtmanager.NewKubevirtManager(
controllerContext.CRDManager.GetClient(),
controllerContext.CRDManager.GetAPIReader(),
)
controllerContext.KubevirtManager = kubevirtManager
}
logger.Debug("Begin to initialize Kubevirt manager")
kubevirtManager := kubevirtmanager.NewKubevirtManager(
controllerContext.CRDManager.GetClient(),
controllerContext.CRDManager.GetAPIReader(),
)
controllerContext.KubevirtManager = kubevirtManager

logger.Debug("Begin to initialize Endpoint manager")
endpointManager, err := workloadendpointmanager.NewWorkloadEndpointManager(
Expand Down

0 comments on commit 2aa98aa

Please sign in to comment.