From 13cfaa941ae69616f92bb75d094d67d2569eb4cc Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Mon, 8 Jul 2024 20:22:29 +0800 Subject: [PATCH] fix: use goharbor/golang 1.21.12 Signed-off-by: Shengwen Yu --- .github/workflows/CI.yml | 16 ++++++++-------- .github/workflows/build-package.yml | 4 ++-- CONTRIBUTING.md | 2 +- Makefile | 4 ++-- docs/compile_guide.md | 8 ++++---- docs/use_make.md | 4 ++-- make/photon/chartserver/Dockerfile.base | 2 +- make/photon/clair-adapter/Dockerfile.binary | 2 +- make/photon/clair/Dockerfile.binary | 2 +- make/photon/core/Dockerfile.base | 2 +- make/photon/db/Dockerfile.base | 2 +- make/photon/jobservice/Dockerfile.base | 2 +- make/photon/log/Dockerfile.base | 2 +- make/photon/nginx/Dockerfile.base | 2 +- make/photon/notary-server/Dockerfile.base | 2 +- make/photon/notary-signer/Dockerfile.base | 2 +- make/photon/portal/Dockerfile.base | 2 +- make/photon/prepare/Dockerfile.base | 2 +- make/photon/redis/Dockerfile.base | 2 +- make/photon/registry/Dockerfile.base | 2 +- make/photon/registry/Dockerfile.binary | 2 +- make/photon/registryctl/Dockerfile.base | 2 +- src/go.mod | 2 +- tests/ci/api_common_install.sh | 2 +- tests/ci/distro_installer.sh | 4 ++-- 25 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1672eaac521..66e46fe7301 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,10 +29,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -95,10 +95,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -155,10 +155,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -213,10 +213,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index de6b641cb12..a83e3a61984 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -25,10 +25,10 @@ jobs: with: version: '285.0.0' - run: gcloud info - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v4 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: Setup Docker uses: docker-practice/actions-setup-docker@master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31a3df9b98e..47a994fb348 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,7 +128,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo | 1.7 | 1.9.2 | | 1.8 | 1.11.2 | | 1.9 | 1.12.12 | -| 1.10 | 1.22.5 | +| 1.10 | 1.21.12 | Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions. diff --git a/Makefile b/Makefile index 910ff85be0b..f5ff0ad7d63 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ # compile_golangimage: # compile from golang image # for example: make compile_golangimage -e GOBUILDIMAGE= \ -# golang:1.22.5 +# goharbor/golang:1.21.12 # compile_core, compile_jobservice: compile specific binary # # build: build Harbor docker images from photon baseimage @@ -137,7 +137,7 @@ GOINSTALL=$(GOCMD) install GOTEST=$(GOCMD) test GODEP=$(GOTEST) -i GOFMT=gofmt -w -GOVERSION=1.22.5 +GOVERSION=1.21.12 GOBUILDIMAGE=goharbor/golang:$(GOVERSION) PUSHGOIMAGE=false GOBUILDPATH=/harbor diff --git a/docs/compile_guide.md b/docs/compile_guide.md index b217da0d51a..02d1805adf4 100644 --- a/docs/compile_guide.md +++ b/docs/compile_guide.md @@ -43,25 +43,25 @@ You can compile the code by one of the three approaches: - Get official Golang image from docker hub: ```sh - $ docker pull goharbor/golang:1.22.5 + $ docker pull goharbor/golang:1.21.12 ``` - Build, install and bring up Harbor without Notary: ```sh - $ make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage + $ make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage ``` - Build, install and bring up Harbor with Notary: ```sh - $ make install GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true + $ make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true ``` - Build, install and bring up Harbor with Clair: ```sh - $ make install GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage CLAIRFLAG=true + $ make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage CLAIRFLAG=true ``` #### II. Compile code with your own Golang environment, then build Harbor diff --git a/docs/use_make.md b/docs/use_make.md index cdf8490f8ea..3b3e3524774 100644 --- a/docs/use_make.md +++ b/docs/use_make.md @@ -36,10 +36,10 @@ version | set harbor version #### EXAMPLE: #### Build and run harbor from source code. -make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true +make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true ### Package offline installer -make package_offline GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true +make package_offline GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true ### Start harbor with notary make -e NOTARYFLAG=true start diff --git a/make/photon/chartserver/Dockerfile.base b/make/photon/chartserver/Dockerfile.base index d66f19627ac..54a15d5302d 100644 --- a/make/photon/chartserver/Dockerfile.base +++ b/make/photon/chartserver/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y shadow sudo >>/dev/null\ && tdnf clean all \ diff --git a/make/photon/clair-adapter/Dockerfile.binary b/make/photon/clair-adapter/Dockerfile.binary index 93cba569d62..89964e560f3 100644 --- a/make/photon/clair-adapter/Dockerfile.binary +++ b/make/photon/clair-adapter/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM golang:1.22.5 +FROM goharbor/golang:1.21.12 ADD . /go/src/github.com/goharbor/harbor-scanner-clair/ WORKDIR /go/src/github.com/goharbor/harbor-scanner-clair/ diff --git a/make/photon/clair/Dockerfile.binary b/make/photon/clair/Dockerfile.binary index 96986f235cb..43fe74f974a 100644 --- a/make/photon/clair/Dockerfile.binary +++ b/make/photon/clair/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM golang:1.22.5 +FROM goharbor/golang:1.21.12 ADD . /go/src/github.com/quay/clair/ WORKDIR /go/src/github.com/quay/clair/ diff --git a/make/photon/core/Dockerfile.base b/make/photon/core/Dockerfile.base index 28a55fa1ce2..99360863996 100644 --- a/make/photon/core/Dockerfile.base +++ b/make/photon/core/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo tzdata -y >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/db/Dockerfile.base b/make/photon/db/Dockerfile.base index 6a6711b60b2..bbb11e20a79 100644 --- a/make/photon/db/Dockerfile.base +++ b/make/photon/db/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 ENV PGDATA /var/lib/postgresql/data diff --git a/make/photon/jobservice/Dockerfile.base b/make/photon/jobservice/Dockerfile.base index 5721772ea98..54e48d4c8db 100644 --- a/make/photon/jobservice/Dockerfile.base +++ b/make/photon/jobservice/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo tzdata -y >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/log/Dockerfile.base b/make/photon/log/Dockerfile.base index 47e7f67fa31..9ccedb16022 100644 --- a/make/photon/log/Dockerfile.base +++ b/make/photon/log/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\ && mkdir /var/spool/rsyslog \ diff --git a/make/photon/nginx/Dockerfile.base b/make/photon/nginx/Dockerfile.base index d6a18e543fc..0c6ddeb1ad1 100644 --- a/make/photon/nginx/Dockerfile.base +++ b/make/photon/nginx/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/notary-server/Dockerfile.base b/make/photon/notary-server/Dockerfile.base index a2f5a02a894..f64810f7a11 100644 --- a/make/photon/notary-server/Dockerfile.base +++ b/make/photon/notary-server/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y shadow sudo \ && tdnf clean all \ diff --git a/make/photon/notary-signer/Dockerfile.base b/make/photon/notary-signer/Dockerfile.base index a2f5a02a894..f64810f7a11 100644 --- a/make/photon/notary-signer/Dockerfile.base +++ b/make/photon/notary-signer/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y shadow sudo \ && tdnf clean all \ diff --git a/make/photon/portal/Dockerfile.base b/make/photon/portal/Dockerfile.base index 7d078696a6d..cf9d5af892a 100644 --- a/make/photon/portal/Dockerfile.base +++ b/make/photon/portal/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/prepare/Dockerfile.base b/make/photon/prepare/Dockerfile.base index 284f6ef3294..46e24a2e5dc 100644 --- a/make/photon/prepare/Dockerfile.base +++ b/make/photon/prepare/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y python3 \ && tdnf install -y python3-pip python3-PyYAML python3-jinja2 diff --git a/make/photon/redis/Dockerfile.base b/make/photon/redis/Dockerfile.base index 172f2db9917..8b9e2210b91 100644 --- a/make/photon/redis/Dockerfile.base +++ b/make/photon/redis/Dockerfile.base @@ -1,3 +1,3 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y redis sudo diff --git a/make/photon/registry/Dockerfile.base b/make/photon/registry/Dockerfile.base index 853618578f2..d946d648c12 100644 --- a/make/photon/registry/Dockerfile.base +++ b/make/photon/registry/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo -y >> /dev/null\ && tdnf clean all \ diff --git a/make/photon/registry/Dockerfile.binary b/make/photon/registry/Dockerfile.binary index 3964adcaaeb..44997d0b08d 100644 --- a/make/photon/registry/Dockerfile.binary +++ b/make/photon/registry/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM goharbor/golang:1.22.5 +FROM goharbor/golang:1.21.12 ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution ENV BUILDTAGS include_oss include_gcs diff --git a/make/photon/registryctl/Dockerfile.base b/make/photon/registryctl/Dockerfile.base index af79187f1be..74110ce7850 100644 --- a/make/photon/registryctl/Dockerfile.base +++ b/make/photon/registryctl/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo -y >> /dev/null \ && tdnf clean all \ diff --git a/src/go.mod b/src/go.mod index 295ca22be75..b17794ec2a4 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,6 +1,6 @@ module github.com/goharbor/harbor/src -go 1.22 +go 1.21 replace github.com/goharbor/harbor => ../ diff --git a/tests/ci/api_common_install.sh b/tests/ci/api_common_install.sh index 83404b7ab5b..ed8d7f0fb6a 100755 --- a/tests/ci/api_common_install.sh +++ b/tests/ci/api_common_install.sh @@ -57,5 +57,5 @@ pip -V #sudo apt-get update && sudo apt-get install -y --no-install-recommends libssl-dev && sudo apt-get autoremove -y && sudo rm -rf /var/lib/apt/lists/* sudo wget https://bootstrap.pypa.io/get-pip.py && sudo python ./get-pip.py && sudo pip install --ignore-installed urllib3 chardet requests --upgrade sudo make build_base_images -e BASEIMAGETAG=dev -sudo make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true BUILDBIN=true PULL_BASE_FROM_DOCKERHUB=false +sudo make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true BUILDBIN=true PULL_BASE_FROM_DOCKERHUB=false sleep 10 diff --git a/tests/ci/distro_installer.sh b/tests/ci/distro_installer.sh index 365b5f040ba..867fad8945f 100755 --- a/tests/ci/distro_installer.sh +++ b/tests/ci/distro_installer.sh @@ -2,5 +2,5 @@ set -e -sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= -sudo make package_offline VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= +sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= +sudo make package_offline VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY=