Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions pkg/client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,20 @@ func ClusterRun(ctx context.Context, runtime k3drt.Runtime, clusterConfig *confi
return fmt.Errorf("Failed Cluster Preparation: %+v", err)
}

// Create tools-node for later steps

g, _ := errgroup.WithContext(ctx)
g.Go(func() error {
_, err := EnsureToolsNode(ctx, runtime, &clusterConfig.Cluster)
return err
})

/*
* Step 1: Create Containers
*/
if err := ClusterCreate(ctx, runtime, &clusterConfig.Cluster, &clusterConfig.ClusterCreateOpts); err != nil {
return fmt.Errorf("failed Cluster Creation: %+v", err)
}

// Wait for tools node to be available
if err := g.Wait(); err != nil {
// Create tools-node after cluster containers exist so ClusterGet can find them.
// This must happen after ClusterCreate because EnsureToolsNode calls ClusterGet
// to discover the cluster's network and image volume from existing node labels.
// Running this in parallel with ClusterCreate caused race conditions where
// ClusterGet would fail with "No nodes found" on slower container runtimes
// (particularly rootless Podman).
if _, err := EnsureToolsNode(ctx, runtime, &clusterConfig.Cluster); err != nil {
return fmt.Errorf("failed to ensure tools node: %w", err)
}

Expand Down