Commit 675bd75f authored by Darren Shepherd's avatar Darren Shepherd
Browse files

Error out when an invalid nodePool is configured

Showing with 4 additions and 2 deletions
+4 -2
......@@ -140,10 +140,12 @@ func machineDeployments(cluster *rancherv1.Cluster, capiCluster *capi.Cluster, d
nodePoolNames := map[string]bool{}
for _, nodePool := range cluster.Spec.RKEConfig.NodePools {
if nodePool.Name == "" || nodePool.NodeConfig == nil || nodePool.NodeConfig.Name == "" || nodePool.NodeConfig.Kind == "" ||
(nodePool.Quantity != nil && *nodePool.Quantity == 0) {
if nodePool.Quantity != nil && *nodePool.Quantity == 0 {
continue
}
if nodePool.Name == "" || nodePool.NodeConfig == nil || nodePool.NodeConfig.Name == "" || nodePool.NodeConfig.Kind == "" {
return nil, fmt.Errorf("invalid nodePool [%s] missing name or valid config", nodePool.Name)
}
if !nodePool.EtcdRole &&
!nodePool.ControlPlaneRole &&
!nodePool.WorkerRole {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment