mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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"
|
"github.com/Azure/go-autorest/autorest/to"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
cloudprovider "k8s.io/cloud-provider"
|
cloudprovider "k8s.io/cloud-provider"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
azcache "k8s.io/legacy-cloud-providers/azure/cache"
|
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.
|
// run starts the updater reconciling loop.
|
||||||
func (d *delayedRouteUpdater) run() {
|
func (d *delayedRouteUpdater) run() {
|
||||||
for {
|
err := wait.PollImmediateInfinite(d.interval, func() (bool, error) {
|
||||||
d.updateRoutes()
|
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