Skip to content

Commit

Permalink
Removed the hacks that were needed pre Golang v1.11
Browse files Browse the repository at this point in the history
This included special handling of go.sum and awkward downloading of
depenedencies.
  • Loading branch information
sgnn7 committed Aug 30, 2018
1 parent 9ccd8dc commit 730dcf7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 170 deletions.
14 changes: 1 addition & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,10 @@ ENV GOOS=linux \
CGO_ENABLED=1

COPY go.mod go.sum /secretless/

# There are checksum mismatches in various environments with client-go package
# so we for now manually remove it from the checksum file. Golang 1.11rc1+ seems
# to have fixed this issue.
RUN sed -i '/^k8s.io\/client-go\ /d' /secretless/go.sum

# https://github.com/golang/go/issues/26610
RUN go list -e $(go list -f '{{.Path}}' -m all 2>/dev/null)
RUN go mod download

COPY . /secretless

# There are checksum mismatches in various environments with client-go package
# so we for now manually remove it from the checksum file. Golang 1.11rc1+ seems
# to have fixed this issue.
RUN sed -i '/^k8s.io\/client-go\ /d' /secretless/go.sum

RUN go build -o dist/$GOOS/$GOARCH/secretless-broker ./cmd/secretless-broker && \
go build -o dist/$GOOS/$GOARCH/summon2 ./cmd/summon2

Expand Down
14 changes: 1 addition & 13 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ RUN go get -u github.com/jstemmer/go-junit-report && \
go get golang.org/x/tools/cmd/goimports

COPY go.mod go.sum /secretless/

# There are checksum mismatches in various environments with client-go package
# so we for now manually remove it from the checksum file. Golang 1.11rc1+ seems
# to have fixed this issue.
RUN sed -i '/^k8s.io\/client-go\ /d' /secretless/go.sum

# https://github.com/golang/go/issues/26610
RUN go list -e $(go list -f '{{.Path}}' -m all 2>/dev/null)
RUN go mod download

# TODO: Expand this with build args when we support other arches
ENV GOOS=linux \
Expand All @@ -45,11 +38,6 @@ ENV GOOS=linux \

COPY . .

# There are checksum mismatches in various environments with client-go package
# so we for now manually remove it from the checksum file. Golang 1.11rc1+ seems
# to have fixed this issue.
RUN sed -i '/^k8s.io\/client-go\ /d' /secretless/go.sum

# Not strictly needed but we might as well do this step too since
# the dev may want to run the binary
RUN go build -o dist/$GOOS/$GOARCH/secretless-broker ./cmd/secretless-broker && \
Expand Down
14 changes: 1 addition & 13 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ RUN apk add -u curl \
musl-dev

COPY go.mod go.sum /secretless/

# There are checksum mismatches in various environments with client-go package
# so we for now manually remove it from the checksum file. Golang 1.11rc1+ seems
# to have fixed this issue.
RUN sed -i '/^k8s.io\/client-go\ /d' /secretless/go.sum

# https://github.com/golang/go/issues/26610
RUN go list -e $(go list -f '{{.Path}}' -m all 2>/dev/null)
RUN go mod download

COPY . .

# There are checksum mismatches in various environments with client-go package
# so we for now manually remove it from the checksum file. Golang 1.11rc1+ seems
# to have fixed this issue.
RUN sed -i '/^k8s.io\/client-go\ /d' /secretless/go.sum
Loading

0 comments on commit 730dcf7

Please sign in to comment.