Skip to content

Commit 2ca733f

Browse files
cbandyJonathan S. Katz
andcommitted
Switch to Go modules to manage dependencies
As was planned for some time, `dep` was officially deprecated and its repository was archived this last week. There may some more work to do with the PGOROOT variable in Makefile and elsewhere. The following commands where used to make this transition: go mod init github.com/crunchydata/postgres-operator sed -i '' -e 's,gopkg.in/robfig/cron.v3,github.com/robfig/cron/v3,' \ ./go.mod ./pgo-scheduler/*/*.go go mod tidy rm -r vendor Gopkg.* Co-authored-by: Jonathan S. Katz <jonathan.katz@crunchydata.com> Issue: [ch9453]
1 parent c6c9b5d commit 2ca733f

File tree

11 files changed

+553
-1126
lines changed

11 files changed

+553
-1126
lines changed

Gopkg.lock

Lines changed: 0 additions & 1035 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 74 deletions
This file was deleted.

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,13 @@ pgo-base-docker: pgo-base-build
220220
cli-docs:
221221
cd $(PGOROOT)/docs/content/operatorcli/cli && go run $(PGOROOT)/pgo/generatedocs.go
222222

223-
clean:
223+
clean: clean-deprecated
224224
rm -rf $(GOPATH)/pkg/* $(GOBIN)/postgres-operator $(GOBIN)/apiserver $(GOBIN)/*pgo
225225

226+
clean-deprecated:
227+
@# packages used to be downloaded into the vendor directory
228+
[ ! -d vendor ] || rm -r vendor
229+
226230
push: $(images:%=push-%) ;
227231

228232
push-%:

bin/get-deps.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ else
8282
fi
8383
fi
8484

85-
if which dep; then
86-
echo -n " Found: " && (dep version | egrep '^ version')
87-
else
88-
echo "=== Installing dep ==="
89-
curl -S https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
90-
fi
91-
9285
# Download Postgres Exporter, only required to build the Crunchy Postgres Exporter container
9386
wget -O $PGOROOT/postgres_exporter.tar.gz https://github.com/wrouesnel/postgres_exporter/releases/download/v${POSTGRES_EXPORTER_VERSION?}/postgres_exporter_v${POSTGRES_EXPORTER_VERSION?}_linux-amd64.tar.gz
9487

deploy/upgrade-pgo.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ $DIR/install-rbac.sh
4040
# Deploy the new Operator
4141
$DIR/deploy.sh
4242

43-
# Run 'dep ensure' to update needed libraries
44-
dep ensure
45-
4643
# Store the current location of the PGO client
4744
MYPGO=`which pgo`
4845
# Store the expected location of the PGO client

docs/content/contributing/developer-setup.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ The setup target ensures the presence of:
6464
* `GOPATH` and `PATH` as described in the prerequisites
6565
* EPEL yum repository
6666
* [`go`](https://golang.org/) compiler version 1.13+
67-
* [`dep`](https://golang.github.io/dep/) dependency manager
6867
* NSQ messaging binaries
6968
* `docker` container tool
7069
* `buildah` OCI image building tool version 1.14.9+
@@ -110,8 +109,6 @@ This assumes you have Docker installed and running on your development host.
110109
By default, the Makefile will use buildah to build the container images, to override this default to use docker to build the images, set the IMGBUILDER variable to `docker`
111110

112111

113-
The project uses the golang dep package manager to vendor all the golang source dependencies into the `vendor` directory. You typically do not need to run any `dep` commands unless you are adding new golang package dependencies into the project outside of what is within the project for a given release.
114-
115112
After a full compile, you will have a `pgo` binary in `$HOME/odev/bin` and the Operator images in your local Docker registry.
116113

117114
# Deployment

go.mod

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module github.com/crunchydata/postgres-operator
2+
3+
go 1.15
4+
5+
require (
6+
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
7+
github.com/fatih/color v1.9.0
8+
github.com/gogo/protobuf v1.3.1 // indirect
9+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
10+
github.com/google/gofuzz v1.1.0 // indirect
11+
github.com/googleapis/gnostic v0.4.0 // indirect
12+
github.com/gorilla/mux v1.7.4
13+
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
14+
github.com/mattn/go-colorable v0.1.6 // indirect
15+
github.com/nsqio/go-nsq v1.0.8
16+
github.com/pkg/errors v0.9.1 // indirect
17+
github.com/robfig/cron/v3 v3.0.1
18+
github.com/sirupsen/logrus v1.5.0
19+
github.com/spf13/cobra v0.0.5
20+
github.com/spf13/pflag v1.0.5
21+
github.com/xdg/stringprep v1.0.0
22+
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59
23+
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
24+
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
25+
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
26+
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
27+
google.golang.org/appengine v1.6.5 // indirect
28+
k8s.io/api v0.17.9
29+
k8s.io/apimachinery v0.17.9
30+
k8s.io/client-go v0.17.9
31+
sigs.k8s.io/controller-runtime v0.5.10
32+
sigs.k8s.io/yaml v1.2.0
33+
)

0 commit comments

Comments
 (0)