Skip to content

Commit e5c396e

Browse files
committed
CAPI: Extend bootstrap destroy timeout to 5 min
I have noticed in some cases that the bootstrap destroy timeout is exceeded at 2 minutes. Let's bump this up to 5 minutes, especially as there is very little harm in doing so. This also fixes the logging so that the log message of "Finished destroying bootstrap resources" is only shown if there is no timeout.
1 parent d2782de commit e5c396e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/infrastructure/clusterapi/clusterapi.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func (i *InfraProvider) DestroyBootstrap(ctx context.Context, dir string) error
386386
return fmt.Errorf("failed to delete bootstrap machine: %w", err)
387387
}
388388

389-
machineDeletionTimeout := 2 * time.Minute
389+
machineDeletionTimeout := 5 * time.Minute
390390
logrus.Infof("Waiting up to %v for bootstrap machine deletion %s/%s...", machineDeletionTimeout, machineNamespace, machineName)
391391
ctx, cancel := context.WithTimeout(ctx, machineDeletionTimeout)
392392
wait.UntilWithContext(ctx, func(context.Context) {
@@ -406,10 +406,10 @@ func (i *InfraProvider) DestroyBootstrap(ctx context.Context, dir string) error
406406

407407
err = ctx.Err()
408408
if err != nil && !errors.Is(err, context.Canceled) {
409-
logrus.Infof("Timeout deleting bootstrap machine: %s", err)
409+
logrus.Warnf("Timeout deleting bootstrap machine: %s", err)
410+
} else {
411+
logrus.Infof("Finished destroying bootstrap resources")
410412
}
411-
412-
logrus.Infof("Finished destroying bootstrap resources")
413413
clusterapi.System().Teardown()
414414

415415
return nil

0 commit comments

Comments
 (0)