Skip to content

Commit

Permalink
fix: fix the bug that cases panic of controller and agent
Browse files Browse the repository at this point in the history
1. remove the leader-election from argument list of agent
2. assign correct value to pvcListerSynced
  • Loading branch information
fengzixu authored and NickrenREN committed Jul 6, 2020
1 parent bb8bac3 commit 76fc3fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ spec:
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
- name: MY_NAME
valueFrom:
Expand All @@ -47,4 +46,4 @@ spec:

volumes:
- name: socket-dir
emptyDir:
emptyDir:
2 changes: 1 addition & 1 deletion pkg/agent/pv_monitor_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func NewPVMonitorAgent(client kubernetes.Interface, driverName string, conn *grp

// PVC informer
agent.pvcLister = pvcInformer.Lister()
agent.pvListerSynced = pvcInformer.Informer().HasSynced
agent.pvcListerSynced = pvcInformer.Informer().HasSynced

// Pod informer
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/pv_monitor_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func NewPVMonitorController(client kubernetes.Interface, conn *grpc.ClientConn,

// PVC informer
ctrl.pvcLister = pvcInformer.Lister()
ctrl.pvListerSynced = pvcInformer.Informer().HasSynced
ctrl.pvcListerSynced = pvcInformer.Informer().HasSynced

// Pod informer
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
Expand Down

0 comments on commit 76fc3fd

Please sign in to comment.