From 64665ebccf2ec699ce034ff2f2b996b245a77579 Mon Sep 17 00:00:00 2001 From: rna-afk Date: Mon, 12 Sep 2022 09:40:34 -0400 Subject: [PATCH] aws: Restrict CPMS from being created with single node clusters Single node clusters do not need the CPMS manifests and hence adding a check to stop the creation of CPMS when the Replicas is set to anything below 1. Ideally, the replicas are set to 0 when the installer needs to create single node clusters. --- pkg/asset/machines/master.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index d10889832a..8e0896b395 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -508,7 +508,7 @@ func (m *Master) Generate(dependencies asset.Parents) error { } m.MachineFiles = make([]*asset.File, len(machines)) - if controlPlaneMachineSet != nil { + if controlPlaneMachineSet != nil && *pool.Replicas > 1 { data, err := yaml.Marshal(controlPlaneMachineSet) if err != nil { return errors.Wrapf(err, "marshal control plane machine set")