fix: Ensure we keep observing
This commit is contained in:
parent
01946451cb
commit
f17f8acfef
1 changed files with 4 additions and 2 deletions
|
@ -108,7 +108,10 @@ func main() {
|
|||
RetryPeriod: 5 * time.Second,
|
||||
Callbacks: leaderelection.LeaderCallbacks{
|
||||
OnStartedLeading: func(ctx context.Context) {
|
||||
loop(ctx, clientset)
|
||||
for {
|
||||
// ensure that we keep observing
|
||||
loop(ctx, clientset)
|
||||
}
|
||||
},
|
||||
OnStoppedLeading: func() {
|
||||
klog.Infof("leader lost: %s", id)
|
||||
|
@ -155,7 +158,6 @@ func loop(ctx context.Context, clientset *kubernetes.Clientset) {
|
|||
klog.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue