Skip to content

Commit

Permalink
Fix ampm naming scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Dec 14, 2022
1 parent 4c0a9b3 commit a8aa372
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion azure/scope/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,18 @@ func (m *MachinePoolScope) applyAzureMachinePoolMachines(ctx context.Context) er
}

func (m *MachinePoolScope) createMachine(ctx context.Context, machine azure.VMSSVM) error {
ctx, _, done := tele.StartSpanWithLogger(ctx, "scope.MachinePoolScope.createMachine")
defer done()

parsed, err := azure2.ParseResourceID(machine.ID)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("failed to parse resource id %q", machine.ID))
}
instanceID := strings.ReplaceAll(parsed.ResourceName, "_", "-")

ampm := infrav1exp.AzureMachinePoolMachine{
ObjectMeta: metav1.ObjectMeta{
Name: strings.ReplaceAll(parsed.ResourceName, "_", "-"),
Name: m.AzureMachinePool.Name + "-" + instanceID,
Namespace: m.AzureMachinePool.Namespace,
OwnerReferences: []metav1.OwnerReference{
{
Expand Down

0 comments on commit a8aa372

Please sign in to comment.