Skip to content

Commit

Permalink
Update deps and fix of source compatibility issues (#13)
Browse files Browse the repository at this point in the history
* Update deps and fix of source compatibility issues

./
v1.16.11     ⇒ v1.30.3     	github.com/aws/aws-sdk-go-v2
v1.17.1      ⇒ v1.27.27    	github.com/aws/aws-sdk-go-v2/config
v1.54.0      ⇒ v1.173.0    	github.com/aws/aws-sdk-go-v2/service/ec2
v1.14.14     ⇒ v1.27.5     	github.com/aws/aws-sdk-go-v2/service/pi
v1.24.0      ⇒ v1.82.0     	github.com/aws/aws-sdk-go-v2/service/rds
v0.6.6       ⇒ v0.7.1      	github.com/montanaflynn/stats
v3.13.1      ⇒ v3.14.6     	github.com/schollz/progressbar/v3
v1.2.1       ⇒ v1.8.1      	github.com/spf13/cobra
v0.2.0       ⇒ v0.4.0      	go.uber.org/mock

* update dominikh/staticcheck-action to v1.3.1
  • Loading branch information
fogfish authored Sep 26, 2024
1 parent 06ba440 commit 23f6925
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 647 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
## actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

## dominikh/[email protected].0
- uses: dominikh/staticcheck-action@ba605356b4b29a60e87ab9404b712f3461e566dc
## dominikh/[email protected].1
- uses: dominikh/staticcheck-action@fe1dd0c3658873b46f8c9bb3291096a617310ca6
with:
install-go: false
51 changes: 27 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
module github.com/zalando/rds-health

go 1.21
go 1.22

toolchain go1.22.0

require (
github.com/aws/aws-sdk-go-v2 v1.16.11
github.com/aws/aws-sdk-go-v2/config v1.17.1
github.com/aws/aws-sdk-go-v2/service/ec2 v1.54.0
github.com/aws/aws-sdk-go-v2/service/pi v1.14.14
github.com/aws/aws-sdk-go-v2/service/rds v1.24.0
github.com/aws/aws-sdk-go-v2 v1.31.0
github.com/aws/aws-sdk-go-v2/config v1.27.37
github.com/aws/aws-sdk-go-v2/service/ec2 v1.179.0
github.com/aws/aws-sdk-go-v2/service/pi v1.28.1
github.com/aws/aws-sdk-go-v2/service/rds v1.85.0
github.com/lynn9388/supsub v0.0.0-20210304091550-458423b0e16a
github.com/montanaflynn/stats v0.6.6
github.com/schollz/progressbar/v3 v3.13.1
github.com/spf13/cobra v1.2.1
go.uber.org/mock v0.2.0
github.com/montanaflynn/stats v0.7.1
github.com/schollz/progressbar/v3 v3.16.0
github.com/spf13/cobra v1.8.1
go.uber.org/mock v0.4.0
)

require (
github.com/aws/aws-sdk-go-v2/credentials v1.12.14 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 // indirect
github.com/aws/smithy-go v1.12.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.35 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.23.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.31.1 // indirect
github.com/aws/smithy-go v1.21.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
)
671 changes: 59 additions & 612 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (api Cluster) toCluster(c rdstypes.DBCluster) types.Cluster {
node := types.Node{
Name: aws.ToString(member.DBInstanceIdentifier),
}
if member.IsClusterWriter {
if aws.ToBool(member.IsClusterWriter) {
cluster.Writer = append(cluster.Writer, node)
} else {
cluster.Reader = append(cluster.Reader, node)
Expand Down
4 changes: 2 additions & 2 deletions internal/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ func TestLookup(t *testing.T) {
DBClusterMembers: []rdstypes.DBClusterMember{
{
DBInstanceIdentifier: aws.String("test-1"),
IsClusterWriter: true,
IsClusterWriter: aws.Bool(true),
},
{
DBInstanceIdentifier: aws.String("test-2"),
IsClusterWriter: false,
IsClusterWriter: aws.Bool(false),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (db *Database) toNode(instance rdstypes.DBInstance) types.Node {

storage := types.Storage{
Type: aws.ToString(instance.StorageType),
Size: types.BiB(instance.AllocatedStorage) * types.GiB,
Size: types.BiB(aws.ToInt32(instance.AllocatedStorage)) * types.GiB,
}

az := types.AvailabilityZones{}
Expand Down
4 changes: 2 additions & 2 deletions internal/database/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestLookupAllSuccess(t *testing.T) {
Engine: aws.String("postgres"),
EngineVersion: aws.String("13.14"),
StorageType: aws.String(""),
AllocatedStorage: 100,
AllocatedStorage: aws.Int32(100),
AvailabilityZone: aws.String("eu-central-1a"),
SecondaryAvailabilityZone: nil,
},
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestLookupSuccess(t *testing.T) {
Engine: aws.String("postgres"),
EngineVersion: aws.String("13.14"),
StorageType: aws.String(""),
AllocatedStorage: 100,
AllocatedStorage: aws.Int32(100),
AvailabilityZone: aws.String("eu-central-1a"),
SecondaryAvailabilityZone: nil,
},
Expand Down
6 changes: 3 additions & 3 deletions internal/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func database(name string) rdstypes.DBInstance {
Engine: aws.String("postgres"),
EngineVersion: aws.String("13.14"),
StorageType: aws.String("gp2"),
AllocatedStorage: 100,
AllocatedStorage: aws.Int32(100),
AvailabilityZone: aws.String("eu-central-1a"),
SecondaryAvailabilityZone: nil,
}
Expand All @@ -119,14 +119,14 @@ func cluster(name string, writer string, reader string) rdstypes.DBCluster {
if writer != "" {
members = append(members, rdstypes.DBClusterMember{
DBInstanceIdentifier: aws.String(writer),
IsClusterWriter: true,
IsClusterWriter: aws.Bool(true),
})
}

if reader != "" {
members = append(members, rdstypes.DBClusterMember{
DBInstanceIdentifier: aws.String(reader),
IsClusterWriter: false,
IsClusterWriter: aws.Bool(false),
})
}

Expand Down

0 comments on commit 23f6925

Please sign in to comment.