Skip to content

Commit 1db1fc4

Browse files
justaugustusk8s-ci-robot
authored andcommitted
Add GetControlPlaneMachines function (#213)
Signed-off-by: Stephen Augustus <[email protected]>
1 parent c4131ee commit 1db1fc4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/cloud/azure/actuators/machine/actuator.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ func NewActuator(params ActuatorParams) *Actuator {
5454
}
5555
}
5656

57+
// GetControlPlaneMachines retrieves all control plane nodes from a MachineList
58+
func GetControlPlaneMachines(machineList *clusterv1.MachineList) []*clusterv1.Machine {
59+
var cpm []*clusterv1.Machine
60+
for _, m := range machineList.Items {
61+
if m.Spec.Versions.ControlPlane != "" {
62+
cpm = append(cpm, m.DeepCopy())
63+
}
64+
}
65+
return cpm
66+
}
67+
5768
// Create creates a machine and is invoked by the machine controller.
5869
func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error {
5970
if cluster == nil {

0 commit comments

Comments
 (0)