Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 0 additions & 100 deletions cloud/services/disks/disks.go

This file was deleted.

48 changes: 0 additions & 48 deletions cloud/services/disks/service.go

This file was deleted.

26 changes: 0 additions & 26 deletions controllers/azurestackhcivirtualmachine_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
infrav1 "github.com/microsoft/cluster-api-provider-azurestackhci/api/v1beta1"
azurestackhci "github.com/microsoft/cluster-api-provider-azurestackhci/cloud"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/scope"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/services/disks"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/services/networkinterfaces"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/services/virtualmachines"
infrav1util "github.com/microsoft/cluster-api-provider-azurestackhci/pkg/util"
Expand All @@ -45,7 +44,6 @@ type azureStackHCIVirtualMachineService struct {
vmScope *scope.VirtualMachineScope
networkInterfacesSvc azurestackhci.Service
virtualMachinesSvc azurestackhci.GetterService
disksSvc azurestackhci.GetterService
}

// newAzureStackHCIMachineService populates all the services based on input scope
Expand All @@ -54,7 +52,6 @@ func newAzureStackHCIVirtualMachineService(vmScope *scope.VirtualMachineScope) *
vmScope: vmScope,
networkInterfacesSvc: networkinterfaces.NewService(vmScope),
virtualMachinesSvc: virtualmachines.NewService(vmScope),
disksSvc: disks.NewService(vmScope),
}
}

Expand Down Expand Up @@ -137,15 +134,6 @@ func (s *azureStackHCIVirtualMachineService) Delete() error {
return errors.Wrapf(err, "Unable to delete network interface")
}

diskSpec := &disks.Spec{
Name: azurestackhci.GenerateOSDiskName(s.vmScope.Name()),
}

err = s.disksSvc.Delete(s.vmScope.Context, diskSpec)
if err != nil {
return errors.Wrapf(err, "Unable to delete os disk of machine %s", s.vmScope.Name())
}

return nil
}

Expand Down Expand Up @@ -214,20 +202,6 @@ func (s *azureStackHCIVirtualMachineService) getVirtualMachineZone() (string, er
return "", nil
}

func (s *azureStackHCIVirtualMachineService) reconcileDisk(disk infrav1.OSDisk) error {
diskSpec := &disks.Spec{
Name: azurestackhci.GenerateOSDiskName(s.vmScope.Name()), //disk.Name,
Source: disk.Source,
}

err := s.disksSvc.Reconcile(s.vmScope.Context, diskSpec)
if err != nil {
return errors.Wrap(err, "unable to create VM OS disk")
}

return err
}

func (s *azureStackHCIVirtualMachineService) reconcileNetworkInterface(nicName string, ipconfigs networkinterfaces.IPConfigurations) error {
networkInterfaceSpec := &networkinterfaces.Spec{
Name: nicName,
Expand Down