Skip to content

Commit 52867cc

Browse files
Merge pull request #2874 from Nordix/Sunnatillo/remove-extra-functions
🌱 Remove checking m3Data from Associate function
2 parents 61cd81a + d5def63 commit 52867cc

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

baremetal/metal3machine_manager.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -382,41 +382,6 @@ func (m *MachineManager) Associate(ctx context.Context) error {
382382
return err
383383
}
384384

385-
if m.Metal3Machine.Spec.DataTemplate != nil {
386-
// Requeue to get the DataTemplate output. We need to requeue to trigger the
387-
// wait on the Metal3DataTemplate
388-
if err = m.WaitForM3Metadata(ctx); err != nil {
389-
return err
390-
}
391-
392-
// If the requeue is not needed, then get the updated host and set the host
393-
// specs
394-
host, helper, err = m.getHost(ctx)
395-
if err != nil {
396-
errMessage := "Failed to get BaremetalHost while setting Host Spec, requeuing"
397-
m.Log.Info(errMessage)
398-
return WithTransientError(errors.New(errMessage), requeueAfter)
399-
}
400-
401-
if err = m.setHostSpec(ctx, host); err != nil {
402-
return err
403-
}
404-
405-
// Update the BMH object.
406-
err = helper.Patch(ctx, host)
407-
if err != nil {
408-
var aggr kerrors.Aggregate
409-
if ok := errors.As(err, &aggr); ok {
410-
for _, kerr := range aggr.Errors() {
411-
if apierrors.IsConflict(kerr) {
412-
return WithTransientError(kerr, requeueAfter)
413-
}
414-
}
415-
}
416-
return err
417-
}
418-
}
419-
420385
m.Log.Info("Finished associating machine")
421386
return nil
422387
}

baremetal/metal3machine_manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ var _ = Describe("Metal3Machine manager", func() {
29782978
Host: newBareMetalHost(baremetalhostName, bmhSpecBMC(), bmov1alpha1.StateNone, nil, false, "metadata", false, ""),
29792979
BMCSecret: newBMCSecret("mycredentials", false),
29802980
ExpectClusterLabel: true,
2981-
ExpectRequeue: true,
2981+
ExpectRequeue: false,
29822982
ExpectOwnerRef: true,
29832983
},
29842984
),

0 commit comments

Comments
 (0)