Skip to content

Commit

Permalink
Merge pull request #7 from santinoncs/upgrade_kubewatch
Browse files Browse the repository at this point in the history
upgrade client-go libraries and modify the golang build method
  • Loading branch information
santinoncs authored Jun 17, 2019
2 parents e5ea7b5 + 29d8da4 commit 7b1cace
Show file tree
Hide file tree
Showing 5 changed files with 336 additions and 78 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ sudo: false
language: go

go:
- 1.8

install:
- go get github.com/softonic/kubewatch
- 1.11

script:
- true

env:
- GO111MODULE=on

install: true
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
#------------------------------------------------------------------------------
# Set the base image for subsequent instructions:
#------------------------------------------------------------------------------
FROM golang:1.12-stretch AS build

FROM alpine:3.5
MAINTAINER Marc Villacorta Morera <[email protected]>
ENV GO111MODULE=on

#------------------------------------------------------------------------------
# Environment variables:
#------------------------------------------------------------------------------
RUN mkdir /kubewatch
WORKDIR /kubewatch
COPY go.mod .
COPY go.sum .

ENV GOPATH="/go"
# Get dependancies - will also be cached if we won't change mod/sum
RUN go mod download
# COPY the source code as the last step
COPY . .

#------------------------------------------------------------------------------
# Build and install:
#------------------------------------------------------------------------------
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /usr/local/bin/kubewatch

RUN apk add -U --no-cache -t dev git go musl-dev \
&& go get github.com/softonic/kubewatch \
&& cp ${GOPATH}/bin/kubewatch /usr/local/bin \
&& apk del --purge dev && rm -rf /tmp/* /go

#------------------------------------------------------------------------------
# Entrypoint:
#------------------------------------------------------------------------------

ENTRYPOINT [ "kubewatch" ]
FROM debian:stretch-slim
COPY --from=build /usr/local/bin/kubewatch /usr/local/bin/kubewatch

ENTRYPOINT ["kubewatch"]
31 changes: 31 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module github.com/softonic/kubewatch

go 1.12

require (
github.com/Azure/go-autorest/autorest v0.2.0 // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gophercloud/gophercloud v0.1.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/json-iterator/go v1.1.6 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/sirupsen/logrus v1.4.2
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.3.0 // indirect
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect
golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.0.0-20190111032252-67edc246be36
k8s.io/apimachinery v0.0.0-20181127025237-2b1284ed4c93
k8s.io/client-go v10.0.0+incompatible
k8s.io/klog v0.3.2 // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
)
Loading

0 comments on commit 7b1cace

Please sign in to comment.