Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

upgrade to Go 1.17, closes #440 #441

Merged
merged 8 commits into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"files.eol": "\n"
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.3
FROM golang:1.17

# For showing Git version via 'pgwatch2 --version'
ARG GIT_HASH
Expand All @@ -13,7 +13,7 @@ RUN cd /pgwatch2 && bash build_gatherer.sh
FROM ubuntu:16.04

RUN apt-get -q update \
&& apt-get -qy install wget apt-transport-https vim git postgresql postgresql-plpython3-9.5 postgresql-plpython-9.5 libfontconfig python3-pip python-pip libssl-dev libpq-dev \
&& apt-get -qy install wget apt-transport-https vim git postgresql postgresql-plpython3-9.5 postgresql-plpython-9.5 libfontconfig python3-pip python-pip libssl-dev libpq-dev libffi-dev \
&& pip install -U "pip < 21.0" && pip3 install -U "pip < 21.0" \
&& locale-gen "en_US.UTF-8" && apt autoremove -y \
&& pg_dropcluster 9.5 main ; pg_createcluster --locale en_US.UTF-8 9.5 main \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-daemon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.2
FROM golang:1.17

# For showing Git version via 'pgwatch2 --version'
ARG GIT_HASH
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile-nonroot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.3
FROM golang:1.17

# For showing Git version via 'pgwatch2 --version'
ARG GIT_HASH
Expand All @@ -13,7 +13,7 @@ RUN cd /pgwatch2 && bash build_gatherer.sh
FROM ubuntu:16.04

RUN apt-get -q update \
&& apt-get -qy install wget apt-transport-https vim git postgresql postgresql-plpython3-9.5 postgresql-plpython-9.5 libfontconfig python3-pip libssl-dev libpq-dev \
&& apt-get -qy install wget apt-transport-https vim git postgresql postgresql-plpython3-9.5 postgresql-plpython-9.5 libfontconfig python3-pip libssl-dev libpq-dev libffi-dev \
&& pip3 install -U "pip < 21.0"

RUN pip3 install supervisor \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-postgres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.3
FROM golang:1.17

# For showing Git version via 'pgwatch2 --version'
ARG GIT_HASH
Expand Down
13 changes: 7 additions & 6 deletions docker/test/smoke_test_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ fi
METRICDBTYPE=$1
IMAGE=$2
CONTAINER_NAME="smoke_test_$METRICDBTYPE"
PGHOST=localhost
PGPORT=$(shuf -i 10000-65000 -n 1)
PGUSER=pgwatch2
PGPASSWORD=pgwatch2admin
PGDATABASE=pgwatch2_metrics
WEBUIPORT=$(shuf -i 10000-65000 -n 1)
INFLUXPORT=$(shuf -i 10000-65000 -n 1)
GRAFANAPORT=$(shuf -i 10000-65000 -n 1)
LOCALHOST=127.0.0.1
# these vars are passed to subshell, so export them
export PGHOST=localhost
export PGPORT=$(shuf -i 10000-65000 -n 1)
export PGUSER=pgwatch2
export PGPASSWORD=pgwatch2admin
export PGDATABASE=pgwatch2_metrics

echo "starting smoke test of Postgres image $IMAGE ..."
echo "stopping and removing existing container named $CONTAINER_NAME if any"
Expand Down Expand Up @@ -60,7 +61,7 @@ sleep 180

echo "checking if metrics exists for added DB..."
if [ $METRICDBTYPE == "pg" ]; then
ROWS=$(psql -h $LOCALHOST -p $PGPORT -qXAtc "select count(distinct dbname) from db_stats where dbname like 'smoke%'")
ROWS=$(psql -qXAtc "SELECT count(distinct dbname) FROM db_stats WHERE dbname LIKE 'smoke%'")
else
ROWS=$(curl -sG http://$LOCALHOST:$INFLUXPORT/query?pretty=true --data-urlencode "db=pgwatch2" \
--data-urlencode "q=SELECT count(xlog_location_b) FROM wal WHERE dbname='smoke1'" \
Expand Down
62 changes: 41 additions & 21 deletions pgwatch2/go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,61 @@
module github.com/cybertec-postgresql/pgwatch2

go 1.14
go 1.17

replace github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.5
replace github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.6

require (
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
github.com/armon/go-metrics v0.3.8 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/coreos/bbolt v0.0.0-00010101000000-000000000000 // indirect
github.com/coreos/etcd v3.3.25+incompatible // indirect
github.com/coreos/etcd v3.3.27+incompatible // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/fatih/color v1.11.0 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/consul/api v1.8.1
github.com/hashicorp/consul/api v1.12.0
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v0.16.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
github.com/hashicorp/go-hclog v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab
github.com/jessevdk/go-flags v1.5.0
github.com/jmoiron/sqlx v1.3.3
github.com/json-iterator/go v1.1.11 // indirect
github.com/lib/pq v1.10.1
github.com/jmoiron/sqlx v1.3.4
github.com/json-iterator/go v1.1.12 // indirect
github.com/lib/pq v1.10.4
github.com/marpaia/graphite-golang v0.0.0-20190519024811-caf161d2c2b1
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/common v0.24.0 // indirect
github.com/prometheus/client_golang v1.12.0
github.com/prometheus/common v0.32.1 // indirect
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
github.com/shirou/gopsutil/v3 v3.21.4
github.com/shopspring/decimal v1.2.0
github.com/tklauser/go-sysconf v0.3.5 // indirect
go.etcd.io/etcd v3.3.25+incompatible
github.com/shirou/gopsutil/v3 v3.21.12
github.com/shopspring/decimal v1.3.1
github.com/tklauser/go-sysconf v0.3.9 // indirect
go.etcd.io/etcd v3.3.27+incompatible
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/serf v0.9.7 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/tklauser/numcpus v0.3.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
google.golang.org/protobuf v1.27.1 // indirect
)
Loading