Skip to content

Commit

Permalink
Use Go Modules (#274)
Browse files Browse the repository at this point in the history
And while we're at it, upgrade to Go 1.20. In the process I had to
change a lot of the dependencies. Some because the dependencies wouldn't
resolve using Go modules, some because they were incompatible with
others. The long and the short of it is: 1) the kubernetes dependency
ecosystem is very rough and 2) this should be carefully validated during
rollout given the number of dependency shifts.

Some other minor notes include some lint changes, or rewriting a very
small bit of code to drop a dependency to have one less to fight with.

---------

Co-authored-by: Seth Saperstein <[email protected]>
  • Loading branch information
danielmmetz and sethsaperstein-lyft authored Mar 31, 2023
1 parent d3a6fe4 commit 12959ee
Show file tree
Hide file tree
Showing 25 changed files with 934 additions and 1,335 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.12
- name: install
run: make install
go-version: "1.20"
- name: test
run: make test_unit
lint:
Expand All @@ -42,9 +40,7 @@ jobs:
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.12
- name: install
run: make install
go-version: "1.20"
- name: test
run: make lint
integration-tests:
Expand All @@ -63,7 +59,7 @@ jobs:
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.12
go-version: "1.20"
- name: install
run: integ/install.sh
- name: setup
Expand Down
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
FROM golang:1.13.4-alpine3.10 as builder
FROM golang:1.20.2-alpine3.17 as builder
RUN apk add git openssh-client make curl bash

COPY boilerplate/lyft/golang_test_targets/dep_install.sh /go/src/github.com/lyft/flinkk8soperator/

# COPY only the dep files for efficient caching
COPY Gopkg.* /go/src/github.com/lyft/flinkk8soperator/
COPY go.mod go.sum /go/src/github.com/lyft/flinkk8soperator/
WORKDIR /go/src/github.com/lyft/flinkk8soperator

# Pull dependencies
RUN : \
&& sh dep_install.sh \
&& dep ensure -vendor-only
RUN go mod download

# COPY the rest of the source code
COPY . /go/src/github.com/lyft/flinkk8soperator/

# This 'linux_compile' target should compile binaries to the /artifacts directory
# The main entrypoint should be compiled to /artifacts/flinkk8soperator
RUN make linux_compile
RUN go mod vendor && make linux_compile

# update the PATH to include the /artifacts directory
ENV PATH="/artifacts:${PATH}"

# This will eventually move to centurylink/ca-certs:latest for minimum possible image size
FROM alpine:3.10
FROM alpine:3.17
COPY --from=builder /artifacts /bin
CMD ["flinkoperator"]
Loading

0 comments on commit 12959ee

Please sign in to comment.