fix/cluster: do not use the same nodestartopts value for all nodes
This commit is contained in:
parent
9efe980789
commit
6d45a15e05
@ -875,13 +875,12 @@ func ClusterStart(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clust
|
|||||||
* Server Nodes
|
* Server Nodes
|
||||||
*/
|
*/
|
||||||
l.Log().Infoln("Starting servers...")
|
l.Log().Infoln("Starting servers...")
|
||||||
nodeStartOpts := &k3d.NodeStartOpts{
|
for _, serverNode := range servers {
|
||||||
|
if err := NodeStart(ctx, runtime, serverNode, &k3d.NodeStartOpts{
|
||||||
Wait: true,
|
Wait: true,
|
||||||
NodeHooks: startClusterOpts.NodeHooks,
|
NodeHooks: startClusterOpts.NodeHooks,
|
||||||
EnvironmentInfo: startClusterOpts.EnvironmentInfo,
|
EnvironmentInfo: startClusterOpts.EnvironmentInfo,
|
||||||
}
|
}); err != nil {
|
||||||
for _, serverNode := range servers {
|
|
||||||
if err := NodeStart(ctx, runtime, serverNode, nodeStartOpts); err != nil {
|
|
||||||
return fmt.Errorf("Failed to start server %s: %+v", serverNode.Name, err)
|
return fmt.Errorf("Failed to start server %s: %+v", serverNode.Name, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -896,7 +895,11 @@ func ClusterStart(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clust
|
|||||||
for _, agentNode := range agents {
|
for _, agentNode := range agents {
|
||||||
currentAgentNode := agentNode
|
currentAgentNode := agentNode
|
||||||
agentWG.Go(func() error {
|
agentWG.Go(func() error {
|
||||||
return NodeStart(aCtx, runtime, currentAgentNode, nodeStartOpts)
|
return NodeStart(aCtx, runtime, currentAgentNode, &k3d.NodeStartOpts{
|
||||||
|
Wait: true,
|
||||||
|
NodeHooks: startClusterOpts.NodeHooks,
|
||||||
|
EnvironmentInfo: startClusterOpts.EnvironmentInfo,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if err := agentWG.Wait(); err != nil {
|
if err := agentWG.Wait(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user