Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax committed May 17, 2024
1 parent 1155a65 commit 0c2de4f
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions internal/services/instance/helpers_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,29 +566,3 @@ func instanceServerAdditionalVolumeTemplate(api *BlockAndInstanceAPI, zone scw.Z

return nil, err
}

func instanceServerAdditionalVolumeIsLocalAndAttached(api *BlockAndInstanceAPI, zone scw.Zone, volumeID string) (bool, error) {
instanceVol, instanceErr := api.API.GetVolume(&instance.GetVolumeRequest{
Zone: zone,
VolumeID: volumeID,
})
if instanceErr == nil {
return instanceVol.Volume.VolumeType == instance.VolumeVolumeTypeLSSD && instanceVol.Volume.Server != nil && instanceVol.Volume.Server.ID != "", nil
}
if !httperrors.Is404(instanceErr) {
return false, instanceErr
}

_, blockErr := api.blockAPI.GetVolume(&blockSDK.GetVolumeRequest{
Zone: zone,
VolumeID: volumeID,
})
if blockErr == nil {
return false, nil
}
if !httperrors.Is404(blockErr) {
return false, fmt.Errorf("block volume %s not found: %w", volumeID, blockErr)
}

return false, instanceErr
}

0 comments on commit 0c2de4f

Please sign in to comment.