mirror of https://github.com/goharbor/harbor.git
bump golang to 1.21.3 on release-2.9.0 (#19503)
bump golang to 1.21.3 update 1.21 CI update ut mock anything Signed-off-by: yminer <yminer@vmware.com>
This commit is contained in:
parent
921aa2a27c
commit
2103a15ca3
|
@ -41,10 +41,10 @@ jobs:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -102,10 +102,10 @@ jobs:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -157,10 +157,10 @@ jobs:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -212,10 +212,10 @@ jobs:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -265,10 +265,10 @@ jobs:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -23,10 +23,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: '430.0.0'
|
version: '430.0.0'
|
||||||
- run: gcloud info
|
- run: gcloud info
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- name: Setup Docker
|
- name: Setup Docker
|
||||||
uses: docker-practice/actions-setup-docker@master
|
uses: docker-practice/actions-setup-docker@master
|
||||||
|
|
|
@ -25,10 +25,10 @@ jobs:
|
||||||
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
|
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
|
||||||
- uses: google-github-actions/setup-gcloud@v1
|
- uses: google-github-actions/setup-gcloud@v1
|
||||||
- run: gcloud info
|
- run: gcloud info
|
||||||
- name: Set up Go 1.20
|
- name: Set up Go 1.21
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.10
|
go-version: 1.21.3
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -166,7 +166,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo
|
||||||
| 2.6 | 1.18.6 |
|
| 2.6 | 1.18.6 |
|
||||||
| 2.7 | 1.19.4 |
|
| 2.7 | 1.19.4 |
|
||||||
| 2.8 | 1.20.6 |
|
| 2.8 | 1.20.6 |
|
||||||
| 2.9 | 1.20.10 |
|
| 2.9 | 1.21.3 |
|
||||||
|
|
||||||
Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.
|
Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -140,7 +140,7 @@ GOINSTALL=$(GOCMD) install
|
||||||
GOTEST=$(GOCMD) test
|
GOTEST=$(GOCMD) test
|
||||||
GODEP=$(GOTEST) -i
|
GODEP=$(GOTEST) -i
|
||||||
GOFMT=gofmt -w
|
GOFMT=gofmt -w
|
||||||
GOBUILDIMAGE=golang:1.20.10
|
GOBUILDIMAGE=golang:1.21.3
|
||||||
GOBUILDPATHINCONTAINER=/harbor
|
GOBUILDPATHINCONTAINER=/harbor
|
||||||
|
|
||||||
# go build
|
# go build
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.20.10
|
FROM golang:1.21.3
|
||||||
|
|
||||||
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
|
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
|
||||||
ENV BUILDTAGS include_oss include_gcs
|
ENV BUILDTAGS include_oss include_gcs
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.20.10
|
FROM golang:1.21.3
|
||||||
|
|
||||||
ADD . /go/src/github.com/aquasecurity/harbor-scanner-trivy/
|
ADD . /go/src/github.com/aquasecurity/harbor-scanner-trivy/
|
||||||
WORKDIR /go/src/github.com/aquasecurity/harbor-scanner-trivy/
|
WORKDIR /go/src/github.com/aquasecurity/harbor-scanner-trivy/
|
||||||
|
|
|
@ -19,7 +19,7 @@ TEMP=$(mktemp -d ${TMPDIR-/tmp}/trivy-adapter.XXXXXX)
|
||||||
git clone https://github.com/aquasecurity/harbor-scanner-trivy.git $TEMP
|
git clone https://github.com/aquasecurity/harbor-scanner-trivy.git $TEMP
|
||||||
cd $TEMP; git checkout $VERSION; cd -
|
cd $TEMP; git checkout $VERSION; cd -
|
||||||
|
|
||||||
echo "Building Trivy adapter binary based on golang:1.20.10..."
|
echo "Building Trivy adapter binary based on golang:1.21.3..."
|
||||||
cp Dockerfile.binary $TEMP
|
cp Dockerfile.binary $TEMP
|
||||||
docker build -f $TEMP/Dockerfile.binary -t trivy-adapter-golang $TEMP
|
docker build -f $TEMP/Dockerfile.binary -t trivy-adapter-golang $TEMP
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/goharbor/harbor/src
|
module github.com/goharbor/harbor/src
|
||||||
|
|
||||||
go 1.20
|
go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/FZambia/sentinel v1.1.0
|
github.com/FZambia/sentinel v1.1.0
|
||||||
|
|
|
@ -29,8 +29,8 @@ import (
|
||||||
|
|
||||||
func Test_projectReferenceObject(t *testing.T) {
|
func Test_projectReferenceObject(t *testing.T) {
|
||||||
ctl := &project.Controller{}
|
ctl := &project.Controller{}
|
||||||
ctl.On("GetByName", mock.AnythingOfType(""), "library").Return(&proModels.Project{ProjectID: 1}, nil)
|
ctl.On("GetByName", mock.Anything, "library").Return(&proModels.Project{ProjectID: 1}, nil)
|
||||||
ctl.On("GetByName", mock.AnythingOfType(""), "demo").Return(nil, fmt.Errorf("not found"))
|
ctl.On("GetByName", mock.Anything, "demo").Return(nil, fmt.Errorf("not found"))
|
||||||
|
|
||||||
originalProjectController := projectController
|
originalProjectController := projectController
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|
|
@ -3,5 +3,5 @@ set -x
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
sudo make package_online GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=golang:1.20.10 COMPILETAG=compile_golangimage TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
|
sudo make package_online GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=golang:1.21.3 COMPILETAG=compile_golangimage TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
|
||||||
sudo make package_offline GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=golang:1.20.10 COMPILETAG=compile_golangimage TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
|
sudo make package_offline GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=golang:1.21.3 COMPILETAG=compile_golangimage TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
|
||||||
|
|
Loading…
Reference in New Issue