From 309fd3561ed6482ba7d5cf68cc537cffb89a1df4 Mon Sep 17 00:00:00 2001 From: thde Date: Mon, 26 Aug 2024 13:45:55 +0200 Subject: [PATCH 1/2] build(deps): update apis --- go.mod | 4 +--- go.sum | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1df460d..19b5b83 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 4ce9a41..19cd481 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= @@ -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= From 6be11ade4ae6756bab82d74c66a5fa58b66f4cff Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 26 Aug 2024 14:18:43 +0200 Subject: [PATCH 2/2] fix: machine types in tests --- get/mysql_test.go | 22 +++++++++++----------- get/postgres_test.go | 22 +++++++++++----------- update/mysql_test.go | 14 +++++++------- update/postgres_test.go | 14 +++++++------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/get/mysql_test.go b/get/mysql_test.go index 021980c..2738ebe 100644 --- a/get/mysql_test.go +++ b/get/mysql_test.go @@ -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"}, diff --git a/get/postgres_test.go b/get/postgres_test.go index 5120b26..b12d6e8 100644 --- a/get/postgres_test.go +++ b/get/postgres_test.go @@ -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"}, diff --git a/update/mysql_test.go b/update/mysql_test.go index 6f993b8..862b107 100644 --- a/update/mysql_test.go +++ b/update/mysql_test.go @@ -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", @@ -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 { diff --git a/update/postgres_test.go b/update/postgres_test.go index 7620a70..9529b61 100644 --- a/update/postgres_test.go +++ b/update/postgres_test.go @@ -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", @@ -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 {