Skip to content

Commit

Permalink
Incorporate review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
srikiz committed Jun 1, 2021
1 parent b5154bb commit 4f295dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
8 changes: 3 additions & 5 deletions upup/pkg/fi/cloudup/do/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ type TokenSource struct {
// DOCloud exposes all the interfaces required to operate on DigitalOcean resources
type DOCloud interface {
fi.Cloud
//Client() *godo.Client
DropletsService() godo.DropletsService
DropletActionService() godo.DropletActionsService
VolumeService() godo.StorageService
Expand All @@ -82,7 +81,7 @@ type doCloudImplementation struct {

dns dnsprovider.Interface

// region holds the DO region
// region holds the DO region.
region string
}

Expand Down Expand Up @@ -184,8 +183,7 @@ func (c *doCloudImplementation) Region() string {
}

func (c *doCloudImplementation) DNS() (dnsprovider.Interface, error) {
provider := dns.NewProvider(c.Client)
return provider, nil
return c.dns, nil
}

// Volumes returns an implementation of godo.StorageService
Expand Down Expand Up @@ -221,7 +219,7 @@ func (c *doCloudImplementation) ActionsService() godo.ActionsService {

// FindVPCInfo is not implemented, it's only here to satisfy the fi.Cloud interface
func (c *doCloudImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {
return nil, errors.New("Not implemented")
return nil, errors.New("not implemented")
}

func (c *doCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error) {
Expand Down
21 changes: 5 additions & 16 deletions upup/pkg/fi/cloudup/do/mock_do_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ import (

var _ fi.Cloud = (*doCloudMockImplementation)(nil)

// Cloud exposes all the interfaces required to operate on DigitalOcean resources
// type MockDOCloudService struct {
// MockDroplets godo.DropletsService
// MockDropletAction godo.DropletActionsService
// MockVolume godo.StorageService
// MockVolumeAction godo.StorageActionsService
// MockLoadBalancers godo.LoadBalancersService
// MockDomain godo.DomainsService
// MockActions godo.ActionsService
// }

type doCloudMockImplementation struct {
Client *godo.Client

Expand All @@ -68,7 +57,7 @@ func (c *doCloudMockImplementation) DNS() (dnsprovider.Interface, error) {

// FindVPCInfo is not implemented, it's only here to satisfy the fi.Cloud interface
func (c *doCloudMockImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {
return nil, errors.New("Not implemented")
return nil, errors.New("not implemented")
}

// DeleteGroup is not implemented yet, is a func that needs to delete a DO instance group.
Expand All @@ -77,7 +66,7 @@ func (c *doCloudMockImplementation) DeleteGroup(g *cloudinstances.CloudInstanceG
}

func (c *doCloudMockImplementation) DeleteInstance(instance *cloudinstances.CloudInstance) error {
return errors.New("Not tested")
return errors.New("not tested")
}

// DetachInstance is not implemented yet. It needs to cause a cloud instance to no longer be counted against the group's size limits.
Expand All @@ -86,16 +75,16 @@ func (c *doCloudMockImplementation) DetachInstance(i *cloudinstances.CloudInstan
}

func (c *doCloudMockImplementation) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {
return nil, errors.New("Not tested")
return nil, errors.New("not tested")
}

// FindClusterStatus discovers the status of the cluster, by inspecting the cloud objects
func (c *doCloudMockImplementation) FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error) {
return nil, errors.New("Not tested")
return nil, errors.New("not tested")
}

func (c *doCloudMockImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error) {
return nil, errors.New("Not tested")
return nil, errors.New("not tested")
}

func (c *doCloudMockImplementation) DropletsService() godo.DropletsService {
Expand Down

0 comments on commit 4f295dc

Please sign in to comment.