Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable stylecheck linter #2505

Merged
merged 89 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
41261a0
Enable gocyclo linter
ankitjain235 Aug 3, 2023
118bc8a
Enable gocritic linter
ankitjain235 Aug 3, 2023
9fe8ef0
Fix typo for linters-settings, fix gocyclo lint failures
ankitjain235 Aug 3, 2023
88f1097
Add lll linter
ankitjain235 Aug 3, 2023
cf599c9
Add nakedret linter
ankitjain235 Aug 3, 2023
4c91b50
Enable dupl linter
ankitjain235 Aug 3, 2023
54d1d5e
Enable exportloopref linter
ankitjain235 Aug 3, 2023
ad04108
Enable importas linter
ankitjain235 Aug 3, 2023
953121f
Enable misspell linter
ankitjain235 Aug 3, 2023
605f039
Enable nestif linter
ankitjain235 Aug 3, 2023
31e838f
Fix minor typo
ankitjain235 Aug 7, 2023
b4cf462
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
2f1bbe4
Update new lint misses, add TODO for lint disables
ankitjain235 Oct 3, 2023
ef78a07
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
62b8959
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
41933d9
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
9c3b9a1
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
44a39cb
Fix misspell lint failure
ankitjain235 Oct 3, 2023
a874943
Merge master, resolve conflicts
ankitjain235 Nov 29, 2023
612154b
Apply linter to new changes
ankitjain235 Nov 29, 2023
0007316
Merge master, resolve conflicts
ankitjain235 Nov 29, 2023
7a3945a
Fix merge issues
ankitjain235 Nov 29, 2023
75b4f9d
Merge parent, resolve conflicts
ankitjain235 Nov 29, 2023
bc30421
Merge parent, resolve conflicts
ankitjain235 Nov 29, 2023
d0392d6
Enable gci linter
ankitjain235 Nov 29, 2023
3524aba
Enable goprintffuncname and nolintlint linters
ankitjain235 Nov 30, 2023
7d10e44
Enable stylecheck linter
ankitjain235 Nov 30, 2023
b8ad05f
Skip stylechecks with minimal change requirements
ankitjain235 Dec 1, 2023
f267cfd
Remove comment
ankitjain235 Dec 1, 2023
6695929
Merge master, resolve conflicts
ankitjain235 Dec 4, 2023
8c38dc0
Merge branch 'enable-linters-2' into enable-linters-3
ankitjain235 Dec 4, 2023
d522754
Add missing newlint
ankitjain235 Dec 4, 2023
32f0cae
Merge parent, resolve conflicts
ankitjain235 Dec 4, 2023
d9c9116
Merge parent, resolve conflicts
ankitjain235 Dec 4, 2023
1a5d695
Merge parent, resolve conflicts
ankitjain235 Dec 4, 2023
0ca4c20
Unexport local function
ankitjain235 Dec 4, 2023
fded60e
Add explanation for ignoring dupl linter
ankitjain235 Dec 4, 2023
3f68dab
Merge branch 'enable-linters-2' into enable-linters-3
ankitjain235 Dec 4, 2023
08e0240
Merge branch 'enable-linters-3' into enable-linters-4
ankitjain235 Dec 4, 2023
e30c1ce
Remove unnecessary comment
ankitjain235 Dec 4, 2023
21d4de0
Merge branch 'enable-linters-4' into enable-linters-5
ankitjain235 Dec 4, 2023
d425db5
Merge branch 'enable-linters-5' into enable-linters-6
ankitjain235 Dec 4, 2023
5b6234c
Merge branch 'master' into enable-linters-2
ankitjain235 Dec 6, 2023
5e97339
Address review comments
ankitjain235 Dec 18, 2023
da05972
Address review comments - move args
ankitjain235 Dec 19, 2023
a8795b2
Merge branch 'master' into enable-linters-2
ankitjain235 Dec 19, 2023
95d4b08
Merge parent, resolve conflicts
ankitjain235 Dec 19, 2023
7e7f3bf
Merge parent, resolve conflicts
ankitjain235 Dec 19, 2023
446c437
Temporarily disable depguard linter, lint fix
ankitjain235 Dec 19, 2023
8727b06
Merge branch 'enable-linters-2' into enable-linters-3
ankitjain235 Dec 19, 2023
a435fdf
Merge branch 'enable-linters-3' into enable-linters-4
ankitjain235 Dec 19, 2023
74180ac
Fix merge error
ankitjain235 Dec 19, 2023
4ab2e48
Merge parent, resolve conflicts
ankitjain235 Dec 19, 2023
ad4ff12
Merge parent, resolve conflicts
ankitjain235 Dec 19, 2023
7c84f68
Merge master, resolve conflicts
ankitjain235 Dec 21, 2023
d059a7f
Fix lint failure
ankitjain235 Dec 21, 2023
919627a
Merge branch 'enable-linters-5' into enable-linters-6
ankitjain235 Dec 21, 2023
52af19c
Fix lint failure
ankitjain235 Dec 21, 2023
36aa8b0
merge conflict resolved
saima-s May 23, 2024
e9d46c7
removed non deleted file and sync with master
saima-s May 23, 2024
25bec02
run linter fix command
saima-s May 23, 2024
f51525c
reverted the generated file change acc to master
saima-s May 23, 2024
6989300
merge conflict resolved
saima-s May 23, 2024
c7f953b
removed some nolint and addressed review comments
saima-s May 24, 2024
ca27e69
addressed review comment
saima-s May 24, 2024
217e307
Merge branch 'master' of github.com:kanisterio/kanister into enable-l…
saima-s Jun 5, 2024
d0e82c8
Merge branch 'master' of github.com:kanisterio/kanister into enable-l…
saima-s Jun 6, 2024
d19d6ce
fix err check and gci linter
saima-s Jun 20, 2024
d744221
merge conflict resolved
saima-s Jun 21, 2024
1e3a653
disabled stylecheck ST1000 and fix review comment
saima-s Jun 21, 2024
a39e2d2
run go mod tidy
saima-s Jun 21, 2024
57b1f33
fix nolintlint error
saima-s Jun 21, 2024
9cfbeee
fix space issue
saima-s Jun 21, 2024
fae52fc
merge conflict resolved
saima-s Jul 2, 2024
23551f2
enabled default linter
saima-s Jul 5, 2024
12134dc
Merge branch 'master' into enable-linters-5
saima-s Jul 5, 2024
55bcb92
Merge branch 'enable-linters-5' of github.com:kanisterio/kanister int…
saima-s Jul 5, 2024
712f628
enabled default linter
saima-s Jul 5, 2024
7571875
fix lint
saima-s Jul 9, 2024
7e1e43d
Merge branch 'enable-linters-5' of github.com:kanisterio/kanister int…
saima-s Jul 9, 2024
80d001e
fix unparam linter
saima-s Jul 9, 2024
d01f0db
merge conflict resolved
saima-s Jul 12, 2024
d9012c0
fix review comment
saima-s Jul 12, 2024
3634b86
fix review comment of nolint
saima-s Jul 12, 2024
f95cefa
fix linter issue
saima-s Jul 12, 2024
208794a
fix review comment
saima-s Jul 12, 2024
c8d6ec6
Update pkg/testing/integration_register.go
saima-s Jul 26, 2024
ebe1089
Merge branch 'master' into enable-linters-6
saima-s Jul 26, 2024
0aa55bc
Merge branch 'master' into enable-linters-6
mergify[bot] Jul 31, 2024
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
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ linters:
- importas
- misspell
- nestif
- gci
- goprintffuncname
- nolintlint
- stylecheck

run:
timeout: 10m # golangci-lint run's timeout.
Expand All @@ -32,6 +36,7 @@ run:
- "integration"

issues:
exclude-use-default: false
exclude-rules:
- path: '_test.go'
linters:
Expand All @@ -41,6 +46,8 @@ issues:
- dupl
- misspell
- nestif
- gci
- stylecheck

- text: "`ctx` is unused" # Context might not be in use in places, but for consistency, we pass it.
linters:
Expand All @@ -66,3 +73,19 @@ linters-settings:
alias: crv1alpha1
nestif:
min-complexity: 6
gci:
sections:
- standard
- default
- prefix(github.com/kanisterio/kanister)
- blank
- dot
skip-generated: true
stylecheck:
checks: [ "all", "-ST1001", "-ST1005", "-ST1016", "-ST1023", "-ST1000"]

exclude-dirs:
- pkg/client/applyconfiguration/cr/v1alpha1 # generated from code-gen
- pkg/client/clientset # generated from code-gen
- pkg/client/informers # generated from code-gen
- pkg/client/listers # generated from code-gen
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ builds:
main: cmd/kanctl/main.go
ldflags: &ldflags
- -extldflags "-static"
-X github.com/kanisterio/kanister/pkg/version.VERSION={{.Version}}
-X github.com/kanisterio/kanister/pkg/version.GIT_COMMIT={{.Commit}}
-X github.com/kanisterio/kanister/pkg/version.BUILD_DATE={{.Date}}
-X github.com/kanisterio/kanister/pkg/version.Version={{.Version}}
-X github.com/kanisterio/kanister/pkg/version.GitCommit={{.Commit}}
-X github.com/kanisterio/kanister/pkg/version.BuildDate={{.Date}}
env: &env
- GO111MODULE=on
- CGO_ENABLED=1
Expand Down
4 changes: 3 additions & 1 deletion cmd/reposervercontroller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/discovery"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand All @@ -40,7 +39,10 @@ import (
"github.com/kanisterio/kanister/pkg/log"
"github.com/kanisterio/kanister/pkg/resource"
"github.com/kanisterio/kanister/pkg/validatingwebhook"
//nolint:gci
//+kubebuilder:scaffold:imports

_ "k8s.io/client-go/plugin/pkg/client/auth"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions design/kanister-prometheus-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ controller/metrics.go

```golang
const (
ACTION_SET_COUNTER_VEC_LABEL_RES = "resolution"
saima-s marked this conversation as resolved.
Show resolved Hide resolved
ActionSetCounterVecLabelRes = "resolution"
ACTION_SET_COUNTER_VEC_LABEL_OP_TYPE = "operation_type"
)

Expand All @@ -228,7 +228,7 @@ type metrics struct {
func getActionSetCounterVecLabels() []kanistermetrics.BoundedLabel {
bl := make([]kanistermetrics.BoundedLabel, 2)
bl[0] = kanistermetrics.BoundedLabel{
LabelName: ACTION_SET_COUNTER_VEC_LABEL_RES,
LabelName: ActionSetCounterVecLabelRes,
LabelValues: []string{"success", "failure"},
}
bl[1] = kanistermetrics.BoundedLabel{
Expand All @@ -244,7 +244,7 @@ func getActionSetCounterVecLabels() []kanistermetrics.BoundedLabel {
func constructActionSetCounterVecLabels(operation_type string, resolution string) prometheus.Labels {
return prometheus.Labels{
ACTION_SET_COUNTER_VEC_LABEL_OP_TYPE: operation_type,
ACTION_SET_COUNTER_VEC_LABEL_RES: resolution,
ActionSetCounterVecLabelRes: resolution,
}
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/apis/cr/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ type Profile struct {
SkipSSLVerify bool `json:"skipSSLVerify"`
}

// LocationType
type LocationType string

const (
Expand All @@ -342,7 +341,6 @@ const (
LocationTypeKopia LocationType = "kopia"
)

// Location
type Location struct {
// Type specifies the kind of object storage that would be used to upload the
// backup objects. Currently supported values are: "GCS", "S3Compliant",
Expand All @@ -359,7 +357,6 @@ type Location struct {
Region string `json:"region"`
}

// CredentialType
type CredentialType string

const (
Expand All @@ -368,7 +365,6 @@ const (
CredentialTypeKopia CredentialType = "kopia"
)

// Credential
type Credential struct {
// Type represents the information about how the credentials are provided for the respective object storage.
Type CredentialType `json:"type"`
Expand All @@ -380,7 +376,6 @@ type Credential struct {
KopiaServerSecret *KopiaServerSecret `json:"kopiaServerSecret,omitempty"`
}

// KeyPair
type KeyPair struct {
// IDField specifies the corresponding key in the secret where the AWS Key ID value is stored.
IDField string `json:"idField"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/bp.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (
imagePrefix = "ghcr.io/kanisterio"
)

// Blueprint implements Blueprint() to return Blueprint specs for the app
// AppBlueprint implements Blueprint() to return Blueprint specs for the app
// Blueprint() returns Blueprint placed at ./blueprints/{app-name}-blueprint.yaml
type AppBlueprint struct {
App string
Expand Down Expand Up @@ -109,7 +109,7 @@ func updateImageTags(bp *crv1alpha1.Blueprint) {
}
}

// Blueprint returns Blueprint placed at ./blueprints/{app-name}-blueprint.yaml
// NewPITRBlueprint returns blueprint placed at ./blueprints/{app-name}-blueprint.yaml
func NewPITRBlueprint(app string, bpReposPath string, useDevImages bool) Blueprinter {
if bpReposPath == "" {
bpReposPath = blueprintsRepo
Expand Down
12 changes: 6 additions & 6 deletions pkg/app/cockroachdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ func (c *CockroachDB) IsReady(ctx context.Context) (bool, error) {
return false, errkit.Wrap(err, "Error while Creating ca.crt", "stderr", stderr)
}

createTlsCrtCmd := fmt.Sprintf("echo '%s'>> /cockroach/cockroach-client-certs/client.root.crt", c.tlscrt)
createTlsCrt := []string{"sh", "-c", createTlsCrtCmd}
_, stderr, err = c.execCommand(ctx, createTlsCrt)
createTLSCrtCmd := fmt.Sprintf("echo '%s'>> /cockroach/cockroach-client-certs/client.root.crt", c.tlscrt)
createTLSCrt := []string{"sh", "-c", createTLSCrtCmd}
_, stderr, err = c.execCommand(ctx, createTLSCrt)
if err != nil {
return false, errkit.Wrap(err, "Error while Creating tls.crt", "stderr", stderr)
}

createTlsKeyCmd := fmt.Sprintf("echo '%s' >> /cockroach/cockroach-client-certs/client.root.key", c.tlskey)
createTlsKey := []string{"sh", "-c", createTlsKeyCmd}
_, stderr, err = c.execCommand(ctx, createTlsKey)
createTLSKeyCmd := fmt.Sprintf("echo '%s' >> /cockroach/cockroach-client-certs/client.root.key", c.tlskey)
createTLSKey := []string{"sh", "-c", createTLSKeyCmd}
_, stderr, err = c.execCommand(ctx, createTLSKey)
if err != nil {
return false, errkit.Wrap(err, "Error while Creating tls.key", "stderr", stderr)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/app/couchbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ type CouchbaseDB struct {
}

// Last tested woking version "2.3.0"
//
//nolint:stylecheck
saima-s marked this conversation as resolved.
Show resolved Hide resolved
func NewCouchbaseDB(name string) App {
return &CouchbaseDB{
name: name,
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/csi-snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/kanisterio/kanister/pkg/log"
)

// Integration test app for CSI Snapshot functions
// TimeLogCSI is integration test app for CSI Snapshot functions.
type TimeLogCSI struct {
cli kubernetes.Interface
namespace string
Expand Down
2 changes: 2 additions & 0 deletions pkg/app/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type ElasticsearchInstance struct {
}

// Last tested on 8.5.1
//
//nolint:stylecheck
func NewElasticsearchInstance(name string) App {
return &ElasticsearchInstance{
name: name,
Expand Down
8 changes: 4 additions & 4 deletions pkg/app/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ func (kc *KafkaCluster) InsertRecord(ctx context.Context, namespace string) erro
if resp.StatusCode != 200 {
return errkit.New("Error inserting records in topic")
}
defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return err
Expand Down Expand Up @@ -617,7 +617,7 @@ func createConsumerGroup(uri string) error {
// we are checking if consumer is already present and if not present it should be created
return errkit.New("Error creating consumer")
}
defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return err
Expand Down Expand Up @@ -650,7 +650,7 @@ func subscribe(uri string) error {
if resp.StatusCode != 204 {
return errkit.New("Error subscribing to the topic")
}
defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return err
Expand All @@ -674,7 +674,7 @@ func consumeMessage(uri string) (int, error) {
if err != nil {
return 0, err
}
defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return 0, err
Expand Down
4 changes: 3 additions & 1 deletion pkg/app/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
mongoWaitTimeout = 5 * time.Minute
)

// IsMaster struct gets mapped to the output of the mongo command that checks if node is master or not.
// IsMasterOutput struct gets mapped to the output of the mongo command that checks if node is master or not.
type IsMasterOutput struct {
Ismaster bool `json:"ismaster"`
}
Expand All @@ -52,6 +52,8 @@ type MongoDB struct {
}

// Last tested working version "9.0.0"
//
//nolint:stylecheck
func NewMongoDB(name string) HelmApp {
return &MongoDB{
username: "root",
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type MysqlDB struct {

var _ HelmApp = &MysqlDB{}

// Last tested working version "6.14.11"
// NewMysqlDB was last tested with working version "6.14.11"
func NewMysqlDB(name string) HelmApp {
return &MysqlDB{
name: name,
Expand Down
4 changes: 3 additions & 1 deletion pkg/app/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ type PostgresDB struct {
namespace string
}

// Last tested chart version "10.12.3". Also we are using postgres version 13.4
// Last tested chart version "10.12.3". Also, we are using postgres version 13.4
//
//nolint:stylecheck
func NewPostgresDB(name string, subPath string) App {
return &PostgresDB{
name: name,
Expand Down
18 changes: 9 additions & 9 deletions pkg/aws/ec2/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type EC2 struct {
DryRun bool
}

// NewEC2Client returns ec2 client struct.
// NewClient returns ec2 client struct.
func NewClient(ctx context.Context, awsConfig *aws.Config, region string) (*EC2, error) {
s, err := session.NewSession(awsConfig)
if err != nil {
Expand All @@ -50,20 +50,20 @@ func (e EC2) DescribeSecurityGroup(ctx context.Context, groupName string) (*ec2.
return e.DescribeSecurityGroupsWithContext(ctx, sgi)
}

func (e EC2) CreateSecurityGroup(ctx context.Context, groupName, description, vpcId string) (*ec2.CreateSecurityGroupOutput, error) {
func (e EC2) CreateSecurityGroup(ctx context.Context, groupName, description, vpcID string) (*ec2.CreateSecurityGroupOutput, error) {
sgi := &ec2.CreateSecurityGroupInput{
DryRun: &e.DryRun,
Description: &description,
GroupName: &groupName,
VpcId: aws.String(vpcId),
VpcId: aws.String(vpcID),
}
return e.CreateSecurityGroupWithContext(ctx, sgi)
}

func (e EC2) AuthorizeSecurityGroupIngress(ctx context.Context, groupId, cidr, protocol string, port int64) (*ec2.AuthorizeSecurityGroupIngressOutput, error) {
func (e EC2) AuthorizeSecurityGroupIngress(ctx context.Context, groupID, cidr, protocol string, port int64) (*ec2.AuthorizeSecurityGroupIngressOutput, error) {
sgi := &ec2.AuthorizeSecurityGroupIngressInput{
DryRun: &e.DryRun,
GroupId: &groupId,
GroupId: &groupID,
CidrIp: &cidr,
IpProtocol: &protocol,
ToPort: &port,
Expand All @@ -72,20 +72,20 @@ func (e EC2) AuthorizeSecurityGroupIngress(ctx context.Context, groupId, cidr, p
return e.AuthorizeSecurityGroupIngressWithContext(ctx, sgi)
}

func (e EC2) DeleteSecurityGroup(ctx context.Context, groupId string) (*ec2.DeleteSecurityGroupOutput, error) {
func (e EC2) DeleteSecurityGroup(ctx context.Context, groupID string) (*ec2.DeleteSecurityGroupOutput, error) {
sgi := &ec2.DeleteSecurityGroupInput{
DryRun: &e.DryRun,
GroupId: aws.String(groupId),
GroupId: aws.String(groupID),
}
return e.DeleteSecurityGroupWithContext(ctx, sgi)
}

func (e EC2) DescribeSubnets(ctx context.Context, vpcId string) (*ec2.DescribeSubnetsOutput, error) {
func (e EC2) DescribeSubnets(ctx context.Context, vpcID string) (*ec2.DescribeSubnetsOutput, error) {
paramsEC2 := &ec2.DescribeSubnetsInput{
Filters: []*ec2.Filter{
{
Name: aws.String("vpc-id"),
Values: []*string{aws.String(vpcId)},
Values: []*string{aws.String(vpcID)},
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/aws/rds/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type RDS struct {
*rds.RDS
}

// NewRDSClient returns ec2 client struct.
// NewClient returns ec2 client struct.
func NewClient(ctx context.Context, awsConfig *aws.Config, region string) (*RDS, error) {
s, err := session.NewSession(awsConfig)
if err != nil {
Expand All @@ -48,7 +48,7 @@ func NewClient(ctx context.Context, awsConfig *aws.Config, region string) (*RDS,
return &RDS{RDS: rds.New(s, awsConfig.WithMaxRetries(maxRetries).WithRegion(region).WithCredentials(awsConfig.Credentials))}, nil
}

// CreateDBInstanceWithContext
// CreateDBInstance return DBInstance with context
func (r RDS) CreateDBInstance(
ctx context.Context,
storage *int64,
Expand Down Expand Up @@ -129,7 +129,7 @@ func (r RDS) WaitUntilDBClusterAvailable(ctx context.Context, dbClusterID string
})
}

// WaitDBCluster waits for DB cluster with instanceID
// WaitOnDBCluster waits for DB cluster with instanceID
func (r RDS) WaitOnDBCluster(ctx context.Context, dbClusterID, status string) error {
// describe the cluster return err if status is !Available
dci := &rds.DescribeDBClustersInput{
Expand Down
3 changes: 1 addition & 2 deletions pkg/blockstorage/awsebs/awsebs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ import (
. "gopkg.in/check.v1"

kaws "github.com/kanisterio/kanister/pkg/aws"
envconfig "github.com/kanisterio/kanister/pkg/config"

"github.com/kanisterio/kanister/pkg/blockstorage"
envconfig "github.com/kanisterio/kanister/pkg/config"
)

// Hook up gocheck into the "go test" runner.
Expand Down
Loading
Loading