Skip to content

Commit

Permalink
*: make compiler happy
Browse files Browse the repository at this point in the history
Signed-off-by: BornChanger <[email protected]>
  • Loading branch information
BornChanger committed Jun 28, 2023
1 parent 1bb611f commit 5284578
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions pkg/backup/snapshotter/snapshotter_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package snapshotter
import (
"errors"
"fmt"
bkutil "github.com/pingcap/tidb-operator/pkg/backup/util"
"github.com/pingcap/tidb-operator/pkg/backup/util"
"regexp"

"github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1"
Expand All @@ -40,9 +40,9 @@ type AWSSnapshotter struct {
}

func (s *AWSSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error {
s.BaseSnapshotter.Init(deps, conf)
err := s.BaseSnapshotter.Init(deps, conf)
s.volRegexp = regexp.MustCompile("vol-.*")
return nil
return err
}

func (s *AWSSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error) {
Expand Down Expand Up @@ -99,10 +99,8 @@ func (s *AWSSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudS
return s.BaseSnapshotter.prepareRestoreMetadata(r, csb, s)
}

type TagMap map[string]string

func (s *AWSSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error {
resourcesTags := make(map[string]bkutil.TagMap)
resourcesTags := make(map[string]util.TagMap)

for _, pv := range pvs {
podName := pv.GetAnnotations()[SourcePodNameKey]
Expand All @@ -115,7 +113,7 @@ func (s *AWSSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error {

resourcesTags[volId] = tags
}
ec2Session, err := bkutil.NewEC2Session(CloudAPIConcurrency)
ec2Session, err := util.NewEC2Session(CloudAPIConcurrency)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/backup/snapshotter/snapshotter_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ type GCPSnapshotter struct {
}

func (s *GCPSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error {
s.BaseSnapshotter.Init(deps, conf)
err := s.BaseSnapshotter.Init(deps, conf)
s.volRegexp = regexp.MustCompile(`^projects\/[^\/]+\/(zones|regions)\/[^\/]+\/disks\/[^\/]+$`)
return nil
return err
}

func (s *GCPSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error) {
Expand Down

0 comments on commit 5284578

Please sign in to comment.