Skip to content

Commit 825000a

Browse files
authored
Merge pull request #415 from terwey/go1.18
Update files for compatibility with Go 1.18. go.mod has been set to 1.16
2 parents 29047bf + 83d4052 commit 825000a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+421
-7258
lines changed

cluster/prov_k8s.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cluster
22

33
import (
4+
"context"
45
"encoding/json"
56

67
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -34,7 +35,7 @@ func (cluster *Cluster) K8SGetNodes() ([]Agent, error) {
3435
cluster.LogPrintf(LvlErr, "Cannot init Kubernetes client API %s ", err)
3536
return nil, err
3637
}
37-
nodes, err := client.CoreV1().Nodes().List(metav1.ListOptions{})
38+
nodes, err := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
3839
agents := []Agent{}
3940
for _, n := range nodes.Items {
4041
var agent Agent

cluster/prov_k8s_db.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cluster
22

33
import (
4+
"context"
45
"strconv"
56

67
appsv1 "k8s.io/api/apps/v1"
@@ -18,7 +19,7 @@ func (cluster *Cluster) K8SProvisionDatabaseService(s *ServerMonitor) {
1819
return
1920
}
2021
namespace := &apiv1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: cluster.Name}}
21-
_, err = client.CoreV1().Namespaces().Create(namespace)
22+
_, err = client.CoreV1().Namespaces().Create(context.TODO(), namespace, metav1.CreateOptions{})
2223
if err != nil {
2324
cluster.LogPrintf(LvlErr, "Cannot create namespace %s ", err)
2425
}
@@ -88,7 +89,7 @@ func (cluster *Cluster) K8SProvisionDatabaseService(s *ServerMonitor) {
8889
},
8990
},
9091
}
91-
pvcresult, pvcerr := persistentVolumeClaims.Create(pvc)
92+
pvcresult, pvcerr := persistentVolumeClaims.Create(context.TODO(), pvc, metav1.CreateOptions{})
9293
if pvcerr != nil {
9394
cluster.LogPrintf(LvlErr, "Cannot deploy Kubernetes pvc %s ", pvcerr)
9495
}
@@ -182,7 +183,7 @@ func (cluster *Cluster) K8SProvisionDatabaseService(s *ServerMonitor) {
182183

183184
// Create Deployment
184185
cluster.LogPrintf(LvlInfo, "Creating Kubernetes deployment...")
185-
result, err := deploymentsClient.Create(deployment)
186+
result, err := deploymentsClient.Create(context.TODO(), deployment, metav1.CreateOptions{})
186187
if err != nil {
187188
cluster.LogPrintf(LvlErr, "Cannot deploy Kubernetes deployment %s ", err)
188189
}
@@ -209,7 +210,7 @@ func (cluster *Cluster) K8SProvisionDatabaseService(s *ServerMonitor) {
209210
},
210211
}
211212
cluster.LogPrintf(LvlInfo, "Creating service...")
212-
result2, err2 := servicesClient.Create(service)
213+
result2, err2 := servicesClient.Create(context.TODO(), service, metav1.CreateOptions{})
213214
if err2 != nil {
214215
cluster.LogPrintf(LvlErr, "Cannot deploy Kubernetes service %s ", err2)
215216
cluster.errorChan <- err2
@@ -238,15 +239,15 @@ func (cluster *Cluster) K8SUnprovisionDatabaseService(s *ServerMonitor) {
238239
}
239240

240241
deletePolicy := metav1.DeletePropagationForeground
241-
if err := deploymentsClient.Delete(s.Name, &metav1.DeleteOptions{
242+
if err := deploymentsClient.Delete(context.TODO(), s.Name, metav1.DeleteOptions{
242243
PropagationPolicy: &deletePolicy,
243244
}); err != nil {
244245
cluster.LogPrintf(LvlErr, "Cannot delete Kubernetes deployment %s %s ", s.Name, err)
245246
cluster.errorChan <- err
246247
}
247248
cluster.LogPrintf(LvlInfo, "Deleted Kubernetes deployment %s.", s.Name)
248249
servicesClient := client.CoreV1().Services(cluster.Name)
249-
if err := servicesClient.Delete(s.Name, &metav1.DeleteOptions{
250+
if err := servicesClient.Delete(context.TODO(), s.Name, metav1.DeleteOptions{
250251
PropagationPolicy: &deletePolicy,
251252
}); err != nil {
252253
cluster.LogPrintf(LvlErr, "Cannot delete Kubernetes service %s %s ", s.Name, err)

cluster/prov_k8s_prx.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cluster
22

33
import (
4+
"context"
45
"errors"
56
"strconv"
67

@@ -57,7 +58,7 @@ func (cluster *Cluster) K8SProvisionProxyService(prx DatabaseProxy) {
5758

5859
// Create Deployment
5960
cluster.LogPrintf(LvlInfo, "Creating deployment...")
60-
result, err := deploymentsClient.Create(deployment)
61+
result, err := deploymentsClient.Create(context.TODO(), deployment, metav1.CreateOptions{})
6162

6263
if err != nil {
6364
cluster.LogPrintf(LvlErr, "Cannot deploy Kubernetes service %s ", err)

go.mod

+76-91
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,158 @@
11
module github.com/signal18/replication-manager
22

3-
go 1.12
3+
go 1.16
44

55
replace github.com/kahing/goofys => github.com/georgyo/goofys v0.21.0
66

77
require (
88
github.com/Azure/azure-pipeline-go v0.2.2
9-
github.com/Azure/azure-sdk-for-go v33.2.0+incompatible
9+
github.com/Azure/azure-sdk-for-go v44.0.0+incompatible
1010
github.com/Azure/azure-storage-blob-go v0.8.0
11-
github.com/Azure/go-autorest v12.2.0+incompatible
12-
github.com/Azure/go-autorest/autorest v0.9.0
13-
github.com/Azure/go-autorest/autorest/adal v0.6.0
14-
github.com/Azure/go-autorest/autorest/azure/auth v0.3.0
15-
github.com/Azure/go-autorest/autorest/azure/cli v0.3.0
16-
github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect
17-
github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
11+
github.com/Azure/go-autorest/autorest v0.11.0
12+
github.com/Azure/go-autorest/autorest/adal v0.9.0
13+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.0
14+
github.com/Azure/go-autorest/autorest/azure/cli v0.4.0
1815
github.com/BurntSushi/toml v0.3.1
1916
github.com/JaderDias/movingmedian v0.0.0-20170611140316-de8c410559fa
2017
github.com/NYTimes/gziphandler v0.0.0-20180125165240-289a3b81f5ae
21-
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
22-
github.com/aclements/go-moremath v0.0.0-20170210193428-033754ab1fee
2318
github.com/alyu/configparser v0.0.0-20151125021232-26b2fe18bee1
24-
github.com/armon/go-metrics v0.0.0-20171117184120-7aa49fde8082
2519
github.com/asaskevich/govalidator v0.0.0-20180115102450-4b3d68f87f17
2620
github.com/aws/aws-sdk-go v1.29.24
2721
github.com/bluele/logrus_slack v0.0.0-20170812021752-74aa3c9b7cc3
28-
github.com/bluele/slack v0.0.0-20180528010058-b4b4d354a079
2922
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d
3023
github.com/codegangsta/negroni v0.3.0
3124
github.com/davecgh/go-spew v1.1.1
32-
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
3325
github.com/dgrijalva/jwt-go v3.2.0+incompatible
3426
github.com/dgryski/carbonzipper v0.0.0-20170426152955-d1a3cec4169b
3527
github.com/dgryski/go-expirecache v0.0.0-20170314133854-743ef98b2adb
3628
github.com/dgryski/go-onlinestats v0.0.0-20170612111826-1c7d19468768
3729
github.com/dgryski/go-trigram v0.0.0-20160407183937-79ec494e1ad0
3830
github.com/dgryski/httputil v0.0.0-20160116060654-189c2918cd08
3931
github.com/dustin/go-humanize v1.0.0
40-
github.com/elgs/gojq v0.0.0-20201120033525-b5293fef2759
41-
github.com/elgs/gosplitargs v0.0.0-20161028071935-a491c5eeb3c8 // indirect
4232
github.com/evmar/gocairo v0.0.0-20160222165215-ddd30f837497
43-
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5
44-
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
4533
github.com/facebookgo/grace v0.0.0-20170218225239-4afe952a37a4
46-
github.com/facebookgo/httpdown v0.0.0-20160323221027-a3b1354551a2
4734
github.com/facebookgo/pidfile v0.0.0-20150612191647-f242e2999868
48-
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4
49-
github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3 // indirect
50-
github.com/fsnotify/fsnotify v1.4.7
51-
github.com/fsouza/go-dockerclient v1.7.3
52-
github.com/gin-contrib/cors v1.3.1
53-
github.com/gin-gonic/gin v1.7.2
54-
github.com/go-ole/go-ole v1.2.5 // indirect
5535
github.com/go-sql-driver/mysql v1.5.0
5636
github.com/gogo/protobuf v1.3.2
57-
github.com/gonum/blas v0.0.0-20180125090452-e7c5890b24cf
58-
github.com/gonum/floats v0.0.0-20180125090339-7de1f4ea7ab5
59-
github.com/gonum/internal v0.0.0-20180125090855-fda53f8d2571
60-
github.com/gonum/lapack v0.0.0-20180125091020-f0b8b25edece
6137
github.com/gonum/matrix v0.0.0-20180124231301-a41cc49d4c29
6238
github.com/google/uuid v1.1.2
63-
github.com/googleapis/gnostic v0.3.1 // indirect
64-
github.com/gorilla/context v1.1.1
6539
github.com/gorilla/handlers v1.3.0
6640
github.com/gorilla/mux v1.8.0
67-
github.com/gorilla/securecookie v1.1.1
68-
github.com/gorilla/sessions v0.0.0-20180209192218-6ba88b7f1c1e
6941
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
70-
github.com/grpc-ecosystem/grpc-gateway v1.9.0
7142
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
7243
github.com/gwenn/yacr v0.0.0-20180209192453-77093bdc7e72
73-
github.com/hashicorp/consul v0.0.0-20180215214858-1ce90e2a19ea
74-
github.com/hashicorp/go-cleanhttp v0.0.0-20171218145408-d5fe4b57a186
75-
github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa
76-
github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90
77-
github.com/hashicorp/golang-lru v0.5.1
78-
github.com/hashicorp/hcl v1.0.0
79-
github.com/hashicorp/serf v0.0.0-20180213013805-d4f33d5b6a0b
8044
github.com/helloyi/go-sshclient v1.0.0
8145
github.com/howeyc/fsnotify v0.0.0-20151003194602-f0c08ee9c607
8246
github.com/hpcloud/tail v1.0.0
8347
github.com/hydrogen18/stalecucumber v0.0.0-20161215203336-0a94983f3e27
8448
github.com/improbable-eng/grpc-web v0.14.0
85-
github.com/inconshreveable/mousetrap v1.0.0
8649
github.com/iu0v1/gelada v1.2.2
8750
github.com/jacobsa/fuse v0.0.0-20211125163655-ffd6c474e806
8851
github.com/jmoiron/sqlx v1.2.0
8952
github.com/jordan-wright/email v0.0.0-20160301001728-a62870b0c368
90-
github.com/juju/errors v0.0.0-20170703010042-c7d06af17c68
91-
github.com/juju/go4 v0.0.0-20160222163258-40d72ab9641a // indirect
92-
github.com/juju/persistent-cookiejar v0.0.0-20171026135701-d5e5a8405ef9 // indirect
93-
github.com/kahing/goofys v0.23.1
94-
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
95-
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
53+
github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9
9654
github.com/kisielk/og-rek v0.0.0-20170425174049-dd41cde712de
9755
github.com/lestrrat/go-file-rotatelogs v0.0.0-20171229092148-f984502973a0
9856
github.com/lestrrat/go-strftime v0.0.0-20170113112000-04ef93e28531
9957
github.com/lib/pq v1.3.0
100-
github.com/lxc/lxd v0.0.0-20210622204105-d8ec22465902
101-
github.com/magiconair/properties v1.8.0
10258
github.com/magneticio/vamp-router v0.0.0-20151116102511-29379b621548
103-
github.com/mattn/go-runewidth v0.0.0-20170510074858-97311d9f7767
10459
github.com/mattn/go-sqlite3 v1.9.0
105-
github.com/micro/go-log v0.1.0 // indirect
10660
github.com/micro/go-micro v0.1.4
107-
github.com/micro/misc v0.1.0 // indirect
108-
github.com/miekg/dns v1.1.43
10961
github.com/mitchellh/go-homedir v1.1.0
110-
github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452
111-
github.com/mitchellh/mapstructure v1.1.2
11262
github.com/mjibson/go-dsp v0.0.0-20170104183934-49dba8372707
11363
github.com/nsf/termbox-go v0.0.0-20180129072728-88b7b944be8b
114-
github.com/pborman/uuid v1.2.0 // indirect
115-
github.com/pelletier/go-toml v1.2.0
11664
github.com/percona/go-mysql v0.0.0-20190307200310-f5cfaf6a5e55
11765
github.com/peterbourgon/g2g v0.0.0-20161124161852-0c2bab2b173d
11866
github.com/pingcap/dumpling v0.0.0-20200319081211-255ce0d25719
119-
github.com/pingcap/errors v0.11.4
120-
github.com/pires/go-proxyproto v0.0.0-20190615163442-2c19fd512994
121-
github.com/pkg/errors v0.9.1
122-
github.com/pmezard/go-difflib v1.0.0
123-
github.com/rs/cors v1.7.0 // indirect
12467
github.com/satori/go.uuid v1.2.0
12568
github.com/shirou/gopsutil v2.20.2+incompatible
126-
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24
12769
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
128-
github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed
12970
github.com/siddontang/go-mysql v0.0.0-20190311123328-7fc3b28d6104
13071
github.com/siddontang/go-mysql-elasticsearch v0.0.0-20180201161913-f34f371d4391
13172
github.com/sirupsen/logrus v1.7.0
132-
github.com/spf13/afero v1.1.2
133-
github.com/spf13/cast v1.3.0
13473
github.com/spf13/cobra v0.0.6
135-
github.com/spf13/jwalterweatherman v1.0.0
136-
github.com/spf13/pflag v1.0.3
74+
github.com/spf13/pflag v1.0.5
13775
github.com/spf13/viper v1.4.0
138-
github.com/stretchr/testify v1.5.1
139-
github.com/swaggest/swgui v1.4.2 // indirect
76+
github.com/stretchr/testify v1.6.1
14077
github.com/tebeka/strftime v0.1.5
14178
github.com/urfave/cli v1.22.3
142-
github.com/walle/lll v1.0.1 // indirect
14379
github.com/wangjohn/quickselect v0.0.0-20161129230411-ed8402a42d5f
14480
github.com/xwb1989/sqlparser v0.0.0-20171128062118-da747e0c62c4
14581
github.com/yoheimuta/protolint v0.32.0
146-
go.uber.org/zap v1.14.0
14782
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
14883
golang.org/x/net v0.0.0-20211105192438-b53810dc28af
149-
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
150-
golang.org/x/text v0.3.6
151-
google.golang.org/appengine v1.6.6
84+
google.golang.org/api v0.30.0
15285
google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced
15386
google.golang.org/grpc v1.38.0
15487
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
15588
google.golang.org/protobuf v1.26.0
156-
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
157-
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b
158-
gopkg.in/fsnotify/fsnotify.v1 v1.4.7
159-
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
89+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
16090
gopkg.in/ini.v1 v1.55.0
161-
gopkg.in/macaroon-bakery.v2 v2.3.0 // indirect
16291
gopkg.in/natefinch/lumberjack.v2 v2.0.0
163-
gopkg.in/retry.v1 v1.0.3 // indirect
164-
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5 // indirect
165-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
166-
gopkg.in/yaml.v2 v2.4.0
167-
k8s.io/api v0.0.0-20191016225839-816a9b7df678
168-
k8s.io/apimachinery v0.0.0-20191017185446-6e68a40eebf9
169-
k8s.io/client-go v0.0.0-20190620085101-78d2af792bab
170-
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
171-
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
92+
k8s.io/api v0.18.2
93+
k8s.io/apimachinery v0.18.2
94+
k8s.io/client-go v0.18.2
95+
)
96+
97+
require (
98+
github.com/Microsoft/go-winio v0.5.0 // indirect
99+
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
100+
github.com/aclements/go-moremath v0.0.0-20170210193428-033754ab1fee // indirect
101+
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
102+
github.com/armon/go-radix v1.0.0 // indirect
103+
github.com/bluele/slack v0.0.0-20180528010058-b4b4d354a079 // indirect
104+
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
105+
github.com/docker/go-connections v0.4.0 // indirect
106+
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
107+
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
108+
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
109+
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
110+
github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9 // indirect
111+
github.com/facebookgo/httpdown v0.0.0-20160323221027-a3b1354551a2 // indirect
112+
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
113+
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4 // indirect
114+
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
115+
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
116+
github.com/gin-gonic/gin v1.7.2 // indirect
117+
github.com/go-ole/go-ole v1.2.5 // indirect
118+
github.com/gonum/blas v0.0.0-20180125090452-e7c5890b24cf // indirect
119+
github.com/gonum/floats v0.0.0-20180125090339-7de1f4ea7ab5 // indirect
120+
github.com/gonum/internal v0.0.0-20180125090855-fda53f8d2571 // indirect
121+
github.com/gonum/lapack v0.0.0-20180125091020-f0b8b25edece // indirect
122+
github.com/googleapis/gnostic v0.3.1 // indirect
123+
github.com/gorilla/context v1.1.1 // indirect
124+
github.com/gorilla/securecookie v1.1.1 // indirect
125+
github.com/gorilla/sessions v0.0.0-20180209192218-6ba88b7f1c1e // indirect
126+
github.com/hashicorp/consul v0.0.0-20180215214858-1ce90e2a19ea // indirect
127+
github.com/hashicorp/go-discover v0.0.0-20220105235006-b95dfa40aaed // indirect
128+
github.com/hashicorp/go-memdb v1.3.2 // indirect
129+
github.com/hashicorp/go-msgpack v1.1.5 // indirect
130+
github.com/hashicorp/go-multierror v1.1.1 // indirect
131+
github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90 // indirect
132+
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
133+
github.com/hashicorp/go-syslog v1.0.0 // indirect
134+
github.com/hashicorp/go-uuid v1.0.2 // indirect
135+
github.com/hashicorp/go-version v1.4.0 // indirect
136+
github.com/hashicorp/hil v0.0.0-20210521165536-27a72121fd40 // indirect
137+
github.com/hashicorp/logutils v1.0.0 // indirect
138+
github.com/hashicorp/memberlist v0.3.1 // indirect
139+
github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69 // indirect
140+
github.com/hashicorp/raft v1.3.6 // indirect
141+
github.com/hashicorp/raft-boltdb v0.0.0-20211202195631-7d34b9fb3f42 // indirect
142+
github.com/hashicorp/serf v0.0.0-20180213013805-d4f33d5b6a0b // indirect
143+
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
144+
github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 // indirect
145+
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect
146+
github.com/mattn/go-runewidth v0.0.0-20170510074858-97311d9f7767 // indirect
147+
github.com/miekg/dns v1.1.43 // indirect
148+
github.com/mitchellh/cli v1.1.2 // indirect
149+
github.com/mitchellh/copystructure v1.2.0 // indirect
150+
github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 // indirect
151+
github.com/pkg/xattr v0.4.6
152+
github.com/rs/cors v1.7.0 // indirect
153+
github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed // indirect
154+
github.com/smartystreets/goconvey v1.7.2 // indirect
155+
golang.org/x/tools v0.1.7 // indirect
156+
google.golang.org/grpc/examples v0.0.0-20220316190256-c4cabf78f4a2 // indirect
172157
nhooyr.io/websocket v1.8.7 // indirect
173158
)

0 commit comments

Comments
 (0)