cli: increase kubecmd retry limit (#2500)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-10-24 08:10:43 +02:00 committed by GitHub
parent a1b4db4175
commit d218f296ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -52,7 +52,7 @@ import (
) )
const ( const (
maxRetryAttempts = 5 maxRetryAttempts = 20
) )
// ErrInProgress signals that an upgrade is in progress inside the cluster. // ErrInProgress signals that an upgrade is in progress inside the cluster.
@ -231,7 +231,7 @@ func (k *KubeCmd) ApplyJoinConfig(ctx context.Context, newAttestConfig config.At
} }
retries++ retries++
k.log.Debugf("Getting join-config ConfigMap failed (attempt %d/%d): %s", retries, maxRetryAttempts, err) 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 var joinConfig *corev1.ConfigMap
@ -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 { retrier := conretry.NewIntervalRetrier(&kubeDoer{action: action}, retryInterval, func(err error) bool {
ctr++ ctr++
log.Debugf("Action failed (attempt %d/%d): %s", ctr, maxRetries, err) log.Debugf("Action failed (attempt %d/%d): %s", ctr, maxRetries, err)
return ctr <= maxRetries return ctr < maxRetries
}) })
return retrier.Do(ctx) return retrier.Do(ctx)
} }

View file

@ -484,7 +484,7 @@ func TestApplyJoinConfig(t *testing.T) {
// be updated here // be updated here
repeatedErrors := func(err error) []error { repeatedErrors := func(err error) []error {
var errs []error var errs []error
for i := 0; i < 20; i++ { for i := 0; i < 30; i++ {
errs = append(errs, err) errs = append(errs, err)
} }
return errs return errs