Skip to content

Commit

Permalink
Add a time.Sleep in calico-win to avoid polluting the logs
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Buil <[email protected]>
  • Loading branch information
manuelbuil committed Sep 25, 2023
1 parent 5cc9c77 commit e5c7b7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/windows/calico.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"path/filepath"
"strings"
"text/template"
"time"

"github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io"
daemonconfig "github.com/k3s-io/k3s/pkg/daemons/config"
Expand Down Expand Up @@ -267,6 +268,8 @@ func (c *Calico) Start(ctx context.Context) error {
}
for {
if err := startCalico(ctx, c.CNICfg); err != nil {
time.Sleep(5 * time.Second)
logrus.Errorf("Calico exited: %v. Retrying", err)
continue
}
break
Expand Down Expand Up @@ -480,7 +483,6 @@ func startCalico(ctx context.Context, config *CalicoConfig) error {
cmd.Stdout = outputFile
cmd.Stderr = outputFile
if err := cmd.Run(); err != nil {
logrus.Errorf("Calico exited: %v", err)
return err
}
return nil
Expand Down

0 comments on commit e5c7b7e

Please sign in to comment.