From 2af4cdad7630f5d01d06dff04771c9bfb35f70e5 Mon Sep 17 00:00:00 2001 From: harishsurf Date: Mon, 9 Sep 2024 11:34:34 -0700 Subject: [PATCH 1/2] Bump go-version to 1.21 Signed-off-by: harishsurf --- .github/workflows/jobs.yml | 2 +- Dockerfile | 4 ++-- Dockerfile.online | 4 ++-- Makefile | 2 +- go.mod | 7 ++++++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 34065582..f4b3376d 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -55,7 +55,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4 with: - go-version: ^1.13 + go-version: ^1.21 id: go - name: Get dependencies diff --git a/Dockerfile b/Dockerfile index 332c290c..f2839962 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,8 @@ ENV GOROOT=/usr/local/go ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH # Get Go binary -RUN curl -o go1.16.4.linux-amd64.tar.gz https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz -RUN tar -xzf go1.16.4.linux-amd64.tar.gz &&\ +RUN curl -o go1.21.13.linux-amd64.tar.gz https://dl.google.com/go/go1.21.13.linux-amd64.tar.gz +RUN tar -xzf go1.21.13.linux-amd64.tar.gz &&\ mv go /usr/local COPY . /cli diff --git a/Dockerfile.online b/Dockerfile.online index a0ed19e6..693f2377 100644 --- a/Dockerfile.online +++ b/Dockerfile.online @@ -17,8 +17,8 @@ ENV GOROOT=/usr/local/go ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH # Get Go binary -RUN curl -o go1.16.4.linux-amd64.tar.gz https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz -RUN tar -xzf go1.16.4.linux-amd64.tar.gz &&\ +RUN curl -o go1.21.13.linux-amd64.tar.gz https://dl.google.com/go/go1.21.13.linux-amd64.tar.gz +RUN tar -xzf go1.21.13.linux-amd64.tar.gz &&\ mv go /usr/local COPY . /cli diff --git a/Makefile b/Makefile index 8573d275..de96ad40 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ RELEASE_VERSION ?= dev all: build-golang-executable: - $(CLIENT) run --rm -v ${PWD}:/usr/src:Z -w /usr/src docker.io/golang:1.16 go build -v \ + $(CLIENT) run --rm -v ${PWD}:/usr/src:Z -w /usr/src docker.io/golang:1.21 go build -v \ -ldflags "-X 'github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION}' -X 'github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.sqliteImage=${SQLITE_IMAGE}'" \ -o mirror-registry; diff --git a/go.mod b/go.mod index c0073331..33fd5986 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,17 @@ module github.com/quay/mirror-registry -go 1.16 +go 1.21 require ( github.com/lib/pq v1.10.0 github.com/sethvargo/go-password v0.2.0 github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.1.3 +) + +require ( + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.7.0 // indirect golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect From c89486ec22de6419d5062830e576c1c101b4dcc6 Mon Sep 17 00:00:00 2001 From: harishsurf Date: Mon, 9 Sep 2024 11:40:50 -0700 Subject: [PATCH 2/2] Replace deprecated go get with go install --- .github/workflows/jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index f4b3376d..86c1c513 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -60,7 +60,7 @@ jobs: - name: Get dependencies run: | - go get -v -t -d ./... + go install -v ./... if [ -f Gopkg.toml ]; then curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure