Skip to content
Permalink
Browse files

[bugfix] Fixes unnecessary wait when readinessindicatorfile is not pr…

…esent
  • Loading branch information
dougbtv authored and s1061123 committed Feb 10, 2020
1 parent 8334b73 commit 4fdaf3f427f0b1cfe04966639731aee02a16301d
Showing with 8 additions and 8 deletions.
  1. +8 −8 multus/multus.go
@@ -453,15 +453,15 @@ func cmdAdd(args *skel.CmdArgs, exec invoke.Exec, kubeClient *k8s.ClientInfo) (c
return nil, cmdErr(nil, "error getting k8s args: %v", err)
}

wait.ExponentialBackoff(defaultReadinessBackoff, func() (bool, error) {
_, err := os.Stat(n.ReadinessIndicatorFile)
switch {
case err == nil:
return true, nil
default:
return false, nil
if n.ReadinessIndicatorFile != "" {
err := wait.ExponentialBackoff(defaultReadinessBackoff, func() (bool, error) {
_, err := os.Stat(n.ReadinessIndicatorFile)
return err == nil, nil
})
if err != nil {
return nil, cmdErr(k8sArgs, "ExponentialBackoff error waiting for ReadinessIndicatorFile: %v", err)
}
})
}

if n.ClusterNetwork != "" {
err = k8s.GetDefaultNetworks(k8sArgs, n, kubeClient)

0 comments on commit 4fdaf3f

Please sign in to comment.
You can’t perform that action at this time.