Skip to content

Commit

Permalink
Issue 98: Switch to go 1.13.8 and use gomodules (#145)
Browse files Browse the repository at this point in the history
* Updated go version to 1.13

Signed-off-by: anisha.kj <[email protected]>

* corrected path

Signed-off-by: anisha.kj <[email protected]>
  • Loading branch information
anishakj authored Mar 23, 2020
1 parent ed1f1d1 commit 20106e8
Show file tree
Hide file tree
Showing 7 changed files with 554 additions and 79 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- '1.12'
- '1.13.8'
- tip
sudo: required
env:
Expand All @@ -9,9 +9,7 @@ env:
services:
- docker
script:
- go get -u github.com/golang/dep/...
- make check
- make dep
- make test
- make build
- make clean
Expand Down
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
FROM golang:1.12.10-alpine3.10 as go-builder
ARG GO_VERSION=1.13.8
ARG ALPINE_VERSION=3.11
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as go-builder

ARG PROJECT_NAME=zookeeper-operator
ARG REPO_PATH=github.com/pravega/$PROJECT_NAME
ARG BUILD_PATH=${REPO_PATH}/cmd/manager

# Build version and commit should be passed in when performing docker build
ARG VERSION=0.0.0-localdev
ARG GIT_SHA=0000000

RUN mkdir -p /go/src/${REPO_PATH}/vendor
WORKDIR /src
COPY pkg ./pkg
COPY cmd ./cmd
COPY go.mod ./

COPY pkg /go/src/${REPO_PATH}/pkg
COPY cmd /go/src/${REPO_PATH}/cmd
COPY vendor /go/src/${REPO_PATH}/vendor
# Download all dependencies.
RUN go mod download

RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ${GOBIN}/${PROJECT_NAME} \
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /src/${PROJECT_NAME} \
-ldflags "-X ${REPO_PATH}/pkg/version.Version=${VERSION} -X ${REPO_PATH}/pkg/version.GitSHA=${GIT_SHA}" \
$BUILD_PATH
/src/cmd/manager

# =============================================================================
FROM alpine:3.7 AS final
FROM alpine:${ALPINE_VERSION} AS final

ARG PROJECT_NAME=zookeeper-operator
ARG REPO_PATH=github.com/pravega/$PROJECT_NAME

COPY --from=go-builder ${GOBIN}/${PROJECT_NAME} /usr/local/bin/${PROJECT_NAME}
COPY --from=go-builder /src/${PROJECT_NAME} /usr/local/bin/${PROJECT_NAME}

RUN adduser -D ${PROJECT_NAME}
USER ${PROJECT_NAME}
Expand Down
60 changes: 0 additions & 60 deletions Gopkg.toml

This file was deleted.

5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ GIT_SHA=$(shell git rev-parse --short HEAD)

.PHONY: all build check clean test

all: dep check build

dep:
dep ensure -v
all: check build

build: test build-go build-image

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ $ kubectl delete -f deploy/all_ns
### Build the operator image

Requirements:
- Go 1.12+
- Go 1.13+

Use the `make` command to build the Zookeeper operator image.

Expand Down
75 changes: 75 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module github.com/pravega/zookeeper-operator

go 1.13

require (
cloud.google.com/go v0.55.0
github.com/PuerkitoBio/purell v1.1.1
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
github.com/beorn7/perks v1.0.1
github.com/davecgh/go-spew v1.1.1
github.com/emicklei/go-restful v2.12.0+incompatible
github.com/fsnotify/fsnotify v1.4.9
github.com/ghodss/yaml v1.0.0
github.com/go-logr/logr v0.1.0
github.com/go-logr/zapr v0.1.1
github.com/go-openapi/jsonpointer v0.19.3
github.com/go-openapi/jsonreference v0.19.3
github.com/go-openapi/spec v0.19.7
github.com/go-openapi/swag v0.19.8
github.com/gogo/protobuf v1.3.1
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/golang/protobuf v1.3.5
github.com/google/btree v1.0.0
github.com/google/gofuzz v1.1.0
github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.4.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/hashicorp/golang-lru v0.5.4
github.com/hpcloud/tail v1.0.0
github.com/imdario/mergo v0.3.8
github.com/json-iterator/go v1.1.9
github.com/mailru/easyjson v0.7.1
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a
github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 v1.0.1
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/operator-framework/operator-sdk v0.3.0
github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709
github.com/petar/GoLLRB v0.0.0-20190514000832-33fb24c13b99
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.9.1
github.com/prometheus/procfs v0.0.11
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
github.com/spf13/pflag v1.0.5
go.uber.org/atomic v1.6.0
go.uber.org/multierr v1.5.0
go.uber.org/zap v1.14.1
golang.org/x/crypto v0.0.0-20200320181102-891825fb96df
golang.org/x/mod v0.2.0
golang.org/x/net v0.0.0-20200320220750-118fecf932d8
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sys v0.0.0-20200320181252-af34d8274f85
golang.org/x/text v0.3.2
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
golang.org/x/tools v0.0.0-20200321014904-268ba720d32c
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
google.golang.org/appengine v1.6.5
gopkg.in/inf.v0 v0.9.1
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.0.0-20181126151915-b503174bad59
k8s.io/apimachinery v0.0.0-20181126123746-eddba98df674
k8s.io/client-go v0.0.0-20181126152608-d082d5923d3c
k8s.io/code-generator v0.0.0-20180823001027-3dcf91f64f63
k8s.io/gengo v0.0.0-20200205140755-e0e292d8aa12
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20200204173128-addea2498afe
sigs.k8s.io/controller-runtime v0.1.8
)
Loading

0 comments on commit 20106e8

Please sign in to comment.