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 (
maxRetryAttempts = 5
maxRetryAttempts = 20
)
// 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++
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
@ -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)
}

View File

@ -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