Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release 1.26] Add a time.Sleep in calico-win to avoid polluting the logs #4792

Merged
merged 1 commit into from Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/windows/calico.go
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