Skip to content

Commit 9ea9262

Browse files
committed
Remove dead code
This is no longer needed now that we don't wait for provisioner capacity when going from deprovisioning->deleting.
1 parent 113996a commit 9ea9262

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

controllers/metal3.io/baremetalhost_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,9 @@ func recordActionFailure(info *reconcileInfo, errorType metal3v1alpha1.ErrorType
334334
func recordActionDelayed(info *reconcileInfo, state metal3v1alpha1.ProvisioningState) actionResult {
335335
var counter prometheus.Counter
336336

337-
switch state {
338-
case metal3v1alpha1.StateDeprovisioning, metal3v1alpha1.StateDeleting:
337+
if state == metal3v1alpha1.StateDeprovisioning {
339338
counter = delayedDeprovisioningHostCounters.With(hostMetricLabels(info.request))
340-
default:
339+
} else {
341340
counter = delayedProvisioningHostCounters.With(hostMetricLabels(info.request))
342341
}
343342

controllers/metal3.io/host_state_machine_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,6 @@ func TestDeprovisioningCapacity(t *testing.T) {
187187
ExpectedDeprovisioningState: metal3v1alpha1.StateAvailable,
188188
ExpectedDelayed: false,
189189
},
190-
{
191-
Scenario: "transition-to-deleting",
192-
Host: host(metal3v1alpha1.StateDeprovisioning).setDeletion().build(),
193-
HasDeprovisioningCapacity: true,
194-
195-
ExpectedDeprovisioningState: metal3v1alpha1.StateDeleting,
196-
ExpectedDelayed: false,
197-
},
198190
}
199191

200192
for _, tc := range testCases {

0 commit comments

Comments
 (0)