mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
apf: handle error from PollImmediateUntil
We should not attempt creation of mandatory objects if ensuring the suggested configuration resulted in an error. We rely on the presence of the "exempt" priority level configuration object in the cluster to indicate whether we should ensure suggested configuration.
This commit is contained in:
parent
980b79c857
commit
b776109427
@ -105,7 +105,7 @@ func (p RESTStorageProvider) PostStartHook() (string, genericapiserver.PostStart
|
||||
flowcontrolClientSet := flowcontrolclient.NewForConfigOrDie(hookContext.LoopbackClientConfig)
|
||||
go func() {
|
||||
const retryCreatingSuggestedSettingsInterval = time.Second
|
||||
_ = wait.PollImmediateUntil(
|
||||
err := wait.PollImmediateUntil(
|
||||
retryCreatingSuggestedSettingsInterval,
|
||||
func() (bool, error) {
|
||||
should, err := shouldEnsureSuggested(flowcontrolClientSet)
|
||||
@ -127,6 +127,17 @@ func (p RESTStorageProvider) PostStartHook() (string, genericapiserver.PostStart
|
||||
return true, nil
|
||||
},
|
||||
hookContext.StopCh)
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "Ensuring suggested configuration failed")
|
||||
|
||||
// We should not attempt creation of mandatory objects if ensuring the suggested
|
||||
// configuration resulted in an error.
|
||||
// This only happens when the stop channel is closed.
|
||||
// We rely on the presence of the "exempt" priority level configuration object in the cluster
|
||||
// to indicate whether we should ensure suggested configuration.
|
||||
return
|
||||
}
|
||||
|
||||
const retryCreatingMandatorySettingsInterval = time.Minute
|
||||
_ = wait.PollImmediateUntil(
|
||||
retryCreatingMandatorySettingsInterval,
|
||||
|
Loading…
Reference in New Issue
Block a user