Skip to content

Commit

Permalink
deps: upgrade to go 1.20 (#272)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Santos <nick.santos@docker.com>
  • Loading branch information
nicks authored Feb 22, 2023
1 parent be1b350 commit 733a582
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .circleci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Similar to the release image (which contains everything BUT the build
# toolchain)

FROM golang:1.19-buster
FROM golang:1.20-buster

RUN apt update && apt install -y curl ca-certificates liblz4-tool rsync socat

Expand Down
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ orbs:
jobs:
build:
docker:
- image: cimg/go:1.19
- image: cimg/go:1.20
steps:
- checkout
- run: go get -v -t -d ./...
- run: go test -v ./...
- run: cd .. && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
- run: cd .. && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
- run: make golangci-lint
- slack/notify-on-failure:
only_for_branches: main

e2e-remote-docker:
docker:
- image: docker/tilt-ctlptl-ci@sha256:a06365a5d76f900883950aeec65d5a3cd49a96ee750a327ac34c3f4850298ee3
- image: docker/tilt-ctlptl-ci@sha256:9ca3c40113dc7d9bb7dc3bf92439264b3ebd539f4fc696757d713db6c2ed92e8
steps:
- checkout
- setup_remote_docker
Expand All @@ -32,9 +32,9 @@ jobs:
- kubernetes/install-kubectl
- run: |
set -ex
wget https://golang.org/dl/go1.19.linux-amd64.tar.gz
wget https://golang.org/dl/go1.20.linux-amd64.tar.gz
sudo rm -fR /usr/local/go
sudo tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
# We need a newer Docker version to work around a k3d/containerd bug.
# https://github.com/rancher/k3d/issues/807
- run: |
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

release-dry-run:
docker:
- image: golang:1.19-bullseye
- image: golang:1.20-bullseye
environment:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
Expand All @@ -92,7 +92,7 @@ jobs:

release:
docker:
- image: golang:1.19-bullseye
- image: golang:1.20-bullseye
environment:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ golangci-lint: $(GOLANGCILINT)
$(GOPATH)/bin/golangci-lint run --verbose

$(GOLANGCILINT):
(cd /; GO111MODULE=on GOPROXY="direct" GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.30.0)
(cd /; GO111MODULE=on GOPROXY="direct" GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2)

BUILDER=buildx-multiarch

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tilt-dev/ctlptl

go 1.19
go 1.20

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func TestCustomImage(t *testing.T) {
}

// ensure stable w/o image change
registry, err := f.c.Apply(context.Background(), &api.Registry{
_, err := f.c.Apply(context.Background(), &api.Registry{
TypeMeta: typeMeta,
Name: "kind-registry",
Image: "registry:2",
Expand All @@ -310,7 +310,7 @@ func TestCustomImage(t *testing.T) {
}

// change image, should be (re)created
registry, err = f.c.Apply(context.Background(), &api.Registry{
registry, err := f.c.Apply(context.Background(), &api.Registry{
TypeMeta: typeMeta,
Name: "kind-registry",
Image: "fake.tilt.dev/different-registry-image:latest",
Expand Down
10 changes: 8 additions & 2 deletions test/k3d-cluster-network/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM golang:1.18
RUN go install github.com/google/ko@latest
# syntax=docker/dockerfile:1

FROM golang:1.20-alpine
RUN apk update && apk add bash git
ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go install github.com/google/ko@latest
WORKDIR /go/github.com/tilt-dev/ctlptl/test/cluster-network
ADD . .
2 changes: 2 additions & 0 deletions test/k3d-cluster-network/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

set -exo pipefail

export DOCKER_BUILDKIT="1"

cd $(dirname $(realpath $0))
CLUSTER_NAME="k3d-ctlptl-test-cluster"
ctlptl apply -f registry.yaml
Expand Down
10 changes: 8 additions & 2 deletions test/kind-cluster-network/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM golang:1.18
RUN go install github.com/google/ko@latest
# syntax=docker/dockerfile:1

FROM golang:1.20-alpine
RUN apk update && apk add bash git
ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go install github.com/google/ko@latest
WORKDIR /go/github.com/tilt-dev/ctlptl/test/cluster-network
ADD . .
2 changes: 2 additions & 0 deletions test/kind-cluster-network/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

set -exo pipefail

export DOCKER_BUILDKIT="1"

cd $(dirname $(realpath $0))
CLUSTER_NAME="kind-ctlptl-test-cluster"
ctlptl apply -f registry.yaml
Expand Down
10 changes: 8 additions & 2 deletions test/minikube-cluster-network/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM golang:1.18
RUN go install github.com/google/ko@latest
# syntax=docker/dockerfile:1

FROM golang:1.20-alpine
RUN apk update && apk add bash git
ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go install github.com/google/ko@latest
WORKDIR /go/github.com/tilt-dev/ctlptl/test/cluster-network
ADD . .
2 changes: 2 additions & 0 deletions test/minikube-cluster-network/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

set -exo pipefail

export DOCKER_BUILDKIT="1"

cd $(dirname $(realpath $0))
CLUSTER_NAME="minikube-ctlptl-test-cluster"
ctlptl apply -f registry.yaml
Expand Down

0 comments on commit 733a582

Please sign in to comment.