Skip to content

Commit

Permalink
cli: increase kubecmd retry limit (#2500)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <[email protected]>
  • Loading branch information
daniel-weisse authored Oct 24, 2023
1 parent a1b4db4 commit d218f29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/internal/kubecmd/kubecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
)

const (
maxRetryAttempts = 5
maxRetryAttempts = 20
)

// ErrInProgress signals that an upgrade is in progress inside the cluster.
Expand Down Expand Up @@ -231,7 +231,7 @@ func (k *KubeCmd) ApplyJoinConfig(ctx context.Context, newAttestConfig config.At
}
retries++
k.log.Debugf("Getting join-config ConfigMap failed (attempt %d/%d): %s", retries, maxRetryAttempts, err)
return retries <= maxRetryAttempts
return retries < maxRetryAttempts
}

var joinConfig *corev1.ConfigMap
Expand Down Expand Up @@ -488,7 +488,7 @@ func retryAction(ctx context.Context, retryInterval time.Duration, maxRetries in
retrier := conretry.NewIntervalRetrier(&kubeDoer{action: action}, retryInterval, func(err error) bool {
ctr++
log.Debugf("Action failed (attempt %d/%d): %s", ctr, maxRetries, err)
return ctr <= maxRetries
return ctr < maxRetries
})
return retrier.Do(ctx)
}
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/kubecmd/kubecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ func TestApplyJoinConfig(t *testing.T) {
// be updated here
repeatedErrors := func(err error) []error {
var errs []error
for i := 0; i < 20; i++ {
for i := 0; i < 30; i++ {
errs = append(errs, err)
}
return errs
Expand Down

0 comments on commit d218f29

Please sign in to comment.