Skip to content

Commit

Permalink
address more review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderboltsid committed Jul 31, 2024
1 parent 5cecf9d commit 452336c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions controllers/nutanixmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,17 @@ func (r *NutanixMachineReconciler) detachVolumeGroups(rctx *nctx.MachineContext,
return err

Check warning on line 403 in controllers/nutanixmachine_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/nutanixmachine_controller.go#L400-L403

Added lines #L400 - L403 were not covered by tests
}

if createV4Client {
v4Client, err := getPrismCentralV4ClientForCluster(rctx.Context, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer)
if err != nil {
err := fmt.Errorf("error occurred while fetching Prism Central v4 client: %w", err)
return err
}
if !createV4Client {
return nil

Check warning on line 407 in controllers/nutanixmachine_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/nutanixmachine_controller.go#L406-L407

Added lines #L406 - L407 were not covered by tests
}

if err := detachVolumeGroupsFromVM(rctx.Context, v4Client, vmUUID); err != nil {
err := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %w", rctx.Machine.Name, vmUUID, err)
return err
}
v4Client, err := getPrismCentralV4ClientForCluster(rctx.Context, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer)
if err != nil {
return fmt.Errorf("error occurred while fetching Prism Central v4 client: %w", err)

Check warning on line 412 in controllers/nutanixmachine_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/nutanixmachine_controller.go#L410-L412

Added lines #L410 - L412 were not covered by tests
}

if err := detachVolumeGroupsFromVM(rctx.Context, v4Client, vmUUID); err != nil {
return fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %w", rctx.Machine.Name, vmUUID, err)

Check warning on line 416 in controllers/nutanixmachine_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/nutanixmachine_controller.go#L415-L416

Added lines #L415 - L416 were not covered by tests
}

return nil

Check warning on line 419 in controllers/nutanixmachine_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/nutanixmachine_controller.go#L419

Added line #L419 was not covered by tests
Expand Down

0 comments on commit 452336c

Please sign in to comment.