Skip to content

Commit 2fcba69

Browse files
committed
clusterapi: shutdown early when preserve bootstrap
Typically the CAPI system needs to continue to run until bootstrap destroy (because it is used in the bootstrap destroy process). Shut it down if we are preserving bootstrap resources.
1 parent eec5bfe commit 2fcba69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/infrastructure/clusterapi/clusterapi.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ func (i *InfraProvider) Provision(ctx context.Context, dir string, parents asset
307307
}
308308

309309
logrus.Infof("Cluster API resources have been created. Waiting for cluster to become ready...")
310+
311+
// If we're skipping bootstrap destroy, shutdown the local control plane.
312+
// Otherwise, we will shut it down after bootstrap destroy.
313+
if oi, ok := os.LookupEnv("OPENSHIFT_INSTALL_PRESERVE_BOOTSTRAP"); ok && oi != "" {
314+
logrus.Warn("OPENSHIFT_INSTALL_PRESERVE_BOOTSTRAP is set, shutting down local control plane.")
315+
clusterapi.System().Teardown()
316+
}
317+
310318
return fileList, nil
311319
}
312320

0 commit comments

Comments
 (0)