mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #92191 from deads2k/azure-panic-protection
prevent panic in azure cloud provider from killing the process
This commit is contained in:
commit
a794874fad
@ -29,6 +29,7 @@ import (
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
"k8s.io/klog/v2"
|
||||
azcache "k8s.io/legacy-cloud-providers/azure/cache"
|
||||
@ -90,9 +91,12 @@ func newDelayedRouteUpdater(az *Cloud, interval time.Duration) *delayedRouteUpda
|
||||
|
||||
// run starts the updater reconciling loop.
|
||||
func (d *delayedRouteUpdater) run() {
|
||||
for {
|
||||
err := wait.PollImmediateInfinite(d.interval, func() (bool, error) {
|
||||
d.updateRoutes()
|
||||
time.Sleep(d.interval)
|
||||
return false, nil
|
||||
})
|
||||
if err != nil { // this should never happen, if it does, panic
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user