Skip to content

Commit

Permalink
Merge pull request #145 from ninech/thde/apis
Browse files Browse the repository at this point in the history
build(deps): update apis
  • Loading branch information
olknegate authored Aug 26, 2024
2 parents 7d64275 + 6be11ad commit 622c3f6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 45 deletions.
22 changes: 11 additions & 11 deletions get/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,32 @@ func TestMySQL(t *testing.T) {
},
{
name: "single",
instances: map[string]storage.MySQLParameters{"test": {MachineType: infra.MachineType("nine-standard-1")}},
wantContain: []string{"nine-standard-1"},
instances: map[string]storage.MySQLParameters{"test": {MachineType: infra.MachineType("nine-db-prod-s")}},
wantContain: []string{"nine-db-prod-s"},
},
{
name: "multiple",
instances: map[string]storage.MySQLParameters{
"test1": {MachineType: infra.MachineType("nine-standard-1")},
"test2": {MachineType: infra.MachineType("nine-standard-2")},
"test3": {MachineType: infra.MachineType("nine-standard-4")},
"test1": {MachineType: infra.MachineType("nine-db-prod-s")},
"test2": {MachineType: infra.MachineType("nine-db-prod-m")},
"test3": {MachineType: infra.MachineType("nine-db-prod-l")},
},
wantContain: []string{"nine-standard-1", "nine-standard-2", "test3"},
wantContain: []string{"nine-db-prod-s", "nine-db-prod-m", "test3"},
},
{
name: "get-by-name",
instances: map[string]storage.MySQLParameters{
"test1": {MachineType: infra.MachineType("nine-standard-1")},
"test2": {MachineType: infra.MachineType("nine-standard-2")},
"test1": {MachineType: infra.MachineType("nine-db-prod-s")},
"test2": {MachineType: infra.MachineType("nine-db-prod-m")},
},
get: mySQLCmd{resourceCmd: resourceCmd{Name: "test1"}},
wantContain: []string{"test1", "nine-standard-1"},
wantContain: []string{"test1", "nine-db-prod-s"},
},
{
name: "show-password",
instances: map[string]storage.MySQLParameters{
"test1": {MachineType: infra.MachineType("nine-standard-1")},
"test2": {MachineType: infra.MachineType("nine-standard-2")},
"test1": {MachineType: infra.MachineType("nine-db-prod-s")},
"test2": {MachineType: infra.MachineType("nine-db-prod-m")},
},
get: mySQLCmd{resourceCmd: resourceCmd{Name: "test2"}, PrintPassword: true},
wantContain: []string{"test2-topsecret"},
Expand Down
22 changes: 11 additions & 11 deletions get/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,32 @@ func TestPostgres(t *testing.T) {
},
{
name: "single",
instances: map[string]storage.PostgresParameters{"test": {MachineType: infra.MachineType("nine-standard-1")}},
wantContain: []string{"nine-standard-1"},
instances: map[string]storage.PostgresParameters{"test": {MachineType: infra.MachineType("nine-db-prod-s")}},
wantContain: []string{"nine-db-prod-s"},
},
{
name: "multiple",
instances: map[string]storage.PostgresParameters{
"test1": {MachineType: infra.MachineType("nine-standard-1")},
"test2": {MachineType: infra.MachineType("nine-standard-2")},
"test3": {MachineType: infra.MachineType("nine-standard-4")},
"test1": {MachineType: infra.MachineType("nine-db-prod-s")},
"test2": {MachineType: infra.MachineType("nine-db-prod-m")},
"test3": {MachineType: infra.MachineType("nine-db-prod-l")},
},
wantContain: []string{"nine-standard-1", "nine-standard-2", "test3"},
wantContain: []string{"nine-db-prod-s", "nine-db-prod-m", "test3"},
},
{
name: "get-by-name",
instances: map[string]storage.PostgresParameters{
"test1": {MachineType: infra.MachineType("nine-standard-1")},
"test2": {MachineType: infra.MachineType("nine-standard-2")},
"test1": {MachineType: infra.MachineType("nine-db-prod-s")},
"test2": {MachineType: infra.MachineType("nine-db-prod-m")},
},
get: postgresCmd{resourceCmd: resourceCmd{Name: "test1"}},
wantContain: []string{"test1", "nine-standard-1"},
wantContain: []string{"test1", "nine-db-prod-s"},
},
{
name: "show-password",
instances: map[string]storage.PostgresParameters{
"test1": {MachineType: infra.MachineType("nine-standard-1")},
"test2": {MachineType: infra.MachineType("nine-standard-2")},
"test1": {MachineType: infra.MachineType("nine-db-prod-s")},
"test2": {MachineType: infra.MachineType("nine-db-prod-m")},
},
get: postgresCmd{resourceCmd: resourceCmd{Name: "test2"}, PrintPassword: true},
wantContain: []string{"test2-topsecret"},
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/moby v27.1.1+incompatible
github.com/moby/term v0.5.0
github.com/ninech/apis v0.0.0-20240717115641-af232c334dc6
github.com/ninech/apis v0.0.0-20240826100033-c578ac718e3f
github.com/posener/complete v1.2.3
github.com/prometheus/common v0.55.0
github.com/stretchr/testify v1.9.0
Expand Down Expand Up @@ -75,7 +75,6 @@ require (
github.com/coreos/go-oidc/v3 v3.10.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/crossplane-contrib/provider-helm v0.17.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
Expand Down Expand Up @@ -245,7 +244,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
helm.sh/helm/v3 v3.14.3 // indirect
k8s.io/cli-runtime v0.29.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240403164606-bc84c2ddaf99 // indirect
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/crossplane-contrib/provider-helm v0.17.0 h1:1fKpzVhlN1UfDoQFMu1IwwqHELMTMBNJV2EhqACLGeU=
github.com/crossplane-contrib/provider-helm v0.17.0/go.mod h1:Wz/1YAQrj2JWxsqee3PDfypOnqQg/PP0mYJOPzUDv3s=
github.com/crossplane/crossplane-runtime v1.15.1 h1:g1h75tNYOQT152IUNxs8ZgSsRFQKrZN9z69KefMujXs=
github.com/crossplane/crossplane-runtime v1.15.1/go.mod h1:kRcJjJQmBFrR2n/KhwL8wYS7xNfq3D8eK4JliEScOHI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -602,8 +600,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/ninech/apis v0.0.0-20240717115641-af232c334dc6 h1:Hs62qefdgMZF+fytMYsYhm413XtjYsIkIBgpMA/2Ehs=
github.com/ninech/apis v0.0.0-20240717115641-af232c334dc6/go.mod h1:6lFCwHqvcTFZvJ6zY0rxaPIoKc0CX9sHhtH/nyo/5is=
github.com/ninech/apis v0.0.0-20240826100033-c578ac718e3f h1:4V6Q4IqjQUzzbN3S8pbUVRjZ0plIY1JRBAOHPn+mfMw=
github.com/ninech/apis v0.0.0-20240826100033-c578ac718e3f/go.mod h1:hrhn1IP1wHHyWfE8xvDAl39yVcT1RDr9qJOv1FYpDAU=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
Expand Down Expand Up @@ -1222,8 +1220,6 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
helm.sh/helm/v3 v3.14.3 h1:HmvRJlwyyt9HjgmAuxHbHv3PhMz9ir/XNWHyXfmnOP4=
helm.sh/helm/v3 v3.14.3/go.mod h1:v6myVbyseSBJTzhmeE39UcPLNv6cQK6qss3dvgAySaE=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
14 changes: 7 additions & 7 deletions update/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ func TestMySQL(t *testing.T) {
},
{
name: "increase-machineType",
update: mySQLCmd{MachineType: ptr.To(infra.MachineType("nine-standard-1"))},
want: storage.MySQLParameters{MachineType: infra.MachineType("nine-standard-1")},
update: mySQLCmd{MachineType: ptr.To(infra.MachineType("nine-db-prod-s"))},
want: storage.MySQLParameters{MachineType: infra.MachineType("nine-db-prod-s")},
},
{
name: "decrease-machineType",
create: storage.MySQLParameters{MachineType: infra.MachineType("nine-standard-2")},
update: mySQLCmd{MachineType: ptr.To(infra.MachineType("nine-standard-1"))},
want: storage.MySQLParameters{MachineType: infra.MachineType("nine-standard-1")},
create: storage.MySQLParameters{MachineType: infra.MachineType("nine-db-prod-m")},
update: mySQLCmd{MachineType: ptr.To(infra.MachineType("nine-db-prod-s"))},
want: storage.MySQLParameters{MachineType: infra.MachineType("nine-db-prod-s")},
},
{
name: "sqlMode-no-mode-set-initially",
Expand Down Expand Up @@ -91,8 +91,8 @@ func TestMySQL(t *testing.T) {
{
name: "multi-update",
create: storage.MySQLParameters{AllowedCIDRs: []meta.IPv4CIDR{"0.0.0.0/0"}},
update: mySQLCmd{MachineType: ptr.To(infra.MachineType("nine-standard-1"))},
want: storage.MySQLParameters{MachineType: infra.MachineType("nine-standard-1"), AllowedCIDRs: []meta.IPv4CIDR{meta.IPv4CIDR("0.0.0.0/0")}},
update: mySQLCmd{MachineType: ptr.To(infra.MachineType("nine-db-prod-s"))},
want: storage.MySQLParameters{MachineType: infra.MachineType("nine-db-prod-s"), AllowedCIDRs: []meta.IPv4CIDR{meta.IPv4CIDR("0.0.0.0/0")}},
},
}
for _, tt := range tests {
Expand Down
14 changes: 7 additions & 7 deletions update/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ func TestPostgres(t *testing.T) {
},
{
name: "increase-machineType",
update: postgresCmd{MachineType: ptr.To(infra.MachineType("nine-standard-1"))},
want: storage.PostgresParameters{MachineType: infra.MachineType("nine-standard-1")},
update: postgresCmd{MachineType: ptr.To(infra.MachineType("nine-db-prod-s"))},
want: storage.PostgresParameters{MachineType: infra.MachineType("nine-db-prod-s")},
},
{
name: "decrease-machineType",
create: storage.PostgresParameters{MachineType: infra.MachineType("nine-standard-2")},
update: postgresCmd{MachineType: ptr.To(infra.MachineType("nine-standard-1"))},
want: storage.PostgresParameters{MachineType: infra.MachineType("nine-standard-1")},
create: storage.PostgresParameters{MachineType: infra.MachineType("nine-db-prod-m")},
update: postgresCmd{MachineType: ptr.To(infra.MachineType("nine-db-prod-s"))},
want: storage.PostgresParameters{MachineType: infra.MachineType("nine-db-prod-s")},
},
{
name: "sshKeys",
Expand All @@ -60,8 +60,8 @@ func TestPostgres(t *testing.T) {
{
name: "multi-update",
create: storage.PostgresParameters{AllowedCIDRs: []meta.IPv4CIDR{"0.0.0.0/0"}},
update: postgresCmd{MachineType: ptr.To(infra.MachineType("nine-standard-1"))},
want: storage.PostgresParameters{MachineType: infra.MachineType("nine-standard-1"), AllowedCIDRs: []meta.IPv4CIDR{meta.IPv4CIDR("0.0.0.0/0")}},
update: postgresCmd{MachineType: ptr.To(infra.MachineType("nine-db-prod-s"))},
want: storage.PostgresParameters{MachineType: infra.MachineType("nine-db-prod-s"), AllowedCIDRs: []meta.IPv4CIDR{meta.IPv4CIDR("0.0.0.0/0")}},
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 622c3f6

Please sign in to comment.