mirror of https://github.com/kubernetes/kops.git
Merge pull request #8192 from Aresforchina/fix-staticcheck-pkg-resources-digitalocean
pkg/resources-fix staticcheck
This commit is contained in:
commit
a5ea3809fc
|
@ -2,8 +2,6 @@ cloudmock/aws/mockelbv2
|
||||||
cmd/kops
|
cmd/kops
|
||||||
node-authorizer/pkg/authorizers/aws
|
node-authorizer/pkg/authorizers/aws
|
||||||
node-authorizer/pkg/server
|
node-authorizer/pkg/server
|
||||||
pkg/resources/digitalocean
|
|
||||||
pkg/resources/digitalocean/dns
|
|
||||||
pkg/resources/openstack
|
pkg/resources/openstack
|
||||||
upup/pkg/fi
|
upup/pkg/fi
|
||||||
upup/pkg/fi/cloudup
|
upup/pkg/fi/cloudup
|
||||||
|
|
|
@ -55,8 +55,6 @@ type Cloud struct {
|
||||||
|
|
||||||
// RegionName holds the region, renamed to avoid conflict with Region()
|
// RegionName holds the region, renamed to avoid conflict with Region()
|
||||||
RegionName string
|
RegionName string
|
||||||
|
|
||||||
tags map[string]string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ fi.Cloud = &Cloud{}
|
var _ fi.Cloud = &Cloud{}
|
||||||
|
|
|
@ -504,16 +504,6 @@ func createRecord(c *godo.Client, zoneName string, createRequest *godo.DomainRec
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// editRecord edits a record given an associated zone and a godo.DomainRecordEditRequest
|
|
||||||
func editRecord(c *godo.Client, zoneName string, recordID int, editRequest *godo.DomainRecordEditRequest) error {
|
|
||||||
_, _, err := c.Domains.EditRecord(context.TODO(), zoneName, recordID, editRequest)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("error editing record: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// deleteRecord deletes a record given an associated zone and a record ID
|
// deleteRecord deletes a record given an associated zone and a record ID
|
||||||
func deleteRecord(c *godo.Client, zoneName string, recordID int) error {
|
func deleteRecord(c *godo.Client, zoneName string, recordID int) error {
|
||||||
_, err := c.Domains.DeleteRecord(context.TODO(), zoneName, recordID)
|
_, err := c.Domains.DeleteRecord(context.TODO(), zoneName, recordID)
|
||||||
|
|
|
@ -317,12 +317,13 @@ func deleteRecord(cloud fi.Cloud, domain string, t *resources.Resource) error {
|
||||||
|
|
||||||
func waitForDetach(cloud *Cloud, action *godo.Action) error {
|
func waitForDetach(cloud *Cloud, action *godo.Action) error {
|
||||||
timeout := time.After(10 * time.Second)
|
timeout := time.After(10 * time.Second)
|
||||||
tick := time.Tick(500 * time.Millisecond)
|
ticker := time.NewTicker(500 * time.Millisecond)
|
||||||
|
defer ticker.Stop()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
return errors.New("timed out waiting for volume to detach")
|
return errors.New("timed out waiting for volume to detach")
|
||||||
case <-tick:
|
case <-ticker.C:
|
||||||
updatedAction, _, err := cloud.Client.Actions.Get(context.TODO(), action.ID)
|
updatedAction, _, err := cloud.Client.Actions.Get(context.TODO(), action.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue