Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump up version to 1.10.19 #20698

Merged
merged 13 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.7
go-version: 1.21.12
id: go
- name: setup Docker
uses: docker-practice/actions-setup-docker@master
Expand Down Expand Up @@ -95,10 +95,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.7
go-version: 1.21.12
id: go
- name: setup Docker
uses: docker-practice/actions-setup-docker@master
Expand Down Expand Up @@ -155,10 +155,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.7
go-version: 1.21.12
id: go
- name: setup Docker
uses: docker-practice/actions-setup-docker@master
Expand Down Expand Up @@ -213,10 +213,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.7
go-version: 1.21.12
id: go
- name: setup Docker
uses: docker-practice/actions-setup-docker@master
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
with:
version: '285.0.0'
- run: gcloud info
- name: Set up Go 1.17
uses: actions/setup-go@v1
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.20.7
go-version: 1.21.12
id: go
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.20.7 |
| 1.10 | 1.21.12 |

Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# compile_golangimage:
# compile from golang image
# for example: make compile_golangimage -e GOBUILDIMAGE= \
# golang:1.20.7
# goharbor/golang:1.21.12
# compile_core, compile_jobservice: compile specific binary
#
# build: build Harbor docker images from photon baseimage
Expand Down Expand Up @@ -137,7 +137,7 @@ GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GODEP=$(GOTEST) -i
GOFMT=gofmt -w
GOVERSION=1.20.7
GOVERSION=1.21.12
GOBUILDIMAGE=goharbor/golang:$(GOVERSION)
PUSHGOIMAGE=false
GOBUILDPATH=/harbor
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.10.18
v1.10.19
8 changes: 4 additions & 4 deletions docs/compile_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.20.7
$ docker pull goharbor/golang:1.21.12
```

- Build, install and bring up Harbor without Notary:

```sh
$ make install GOBUILDIMAGE=goharbor/golang:1.20.7 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.17.9 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.17.9 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
Expand Down
4 changes: 2 additions & 2 deletions docs/use_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ version | set harbor version
#### EXAMPLE:

#### Build and run harbor from source code.
make install GOBUILDIMAGE=goharbor/golang:1.20.7 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.20.7 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
Expand Down
2 changes: 1 addition & 1 deletion make/photon/clair-adapter/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM photon:5.0

RUN tdnf install -y sudo >>/dev/null\
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/clair-adapter/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.9
FROM goharbor/golang:1.21.12

ADD . /go/src/github.com/goharbor/harbor-scanner-clair/
WORKDIR /go/src/github.com/goharbor/harbor-scanner-clair/
Expand Down
2 changes: 1 addition & 1 deletion make/photon/clair-adapter/builder
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TEMP=`mktemp -d ${TMPDIR-/tmp}/clair-adapter.XXXXXX`
git clone https://github.com/goharbor/harbor-scanner-clair.git $TEMP
cd $TEMP; git checkout $VERSION; cd -

echo 'build the clair adapter binary bases on the golang:1.17.9'
echo 'build the clair adapter binary bases on the golang:1.21.12'
cp Dockerfile.binary $TEMP
docker build -f $TEMP/Dockerfile.binary -t clair-adapter-golang $TEMP

Expand Down
2 changes: 1 addition & 1 deletion make/photon/clair/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM photon:5.0

RUN tdnf install -y git shadow sudo rpm xz python3-xml >>/dev/null\
&& tdnf clean all \
Expand Down
3 changes: 2 additions & 1 deletion make/photon/clair/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM golang:1.15.6
FROM goharbor/golang:1.21.12

ADD . /go/src/github.com/quay/clair/
WORKDIR /go/src/github.com/quay/clair/

RUN export CLAIR_VERSION=$(git describe --tag --always --dirty) GO111MODULE=on && \
go get github.com/PuerkitoBio/goquery && \
go build -ldflags "-X github.com/quay/clair/pkg/version.Version=$CLAIR_VERSION" ./cmd/clair
2 changes: 1 addition & 1 deletion make/photon/clair/builder
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cur=$PWD
TEMP=`mktemp -d /$TMPDIR/clair.XXXXXX`
git clone -b $VERSION --single-branch https://github.com/quay/clair.git $TEMP

echo 'build the clair binary bases on the golang:1.15.6'
echo 'build the clair binary bases on the golang:1.21.12'
cp Dockerfile.binary $TEMP
docker build -f $TEMP/Dockerfile.binary -t clair-golang $TEMP

Expand Down
2 changes: 2 additions & 0 deletions make/photon/db/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ COPY ./make/photon/db/postgresql96-9.6.21-1.ph4.x86_64.rpm /pg96/
RUN tdnf install -y /pg96/postgresql96-libs-9.6.21-1.ph4.x86_64.rpm /pg96/postgresql96-9.6.21-1.ph4.x86_64.rpm >> /dev/null \
&& rm -rf /pg96 \
&& tdnf install -y shadow gzip postgresql13 findutils bc >> /dev/null \
&& userdel postgres \
&& groupdel postgres \
&& groupadd -r postgres --gid=999 \
&& useradd -m -r -g postgres --uid=999 postgres \
&& mkdir -p /docker-entrypoint-initdb.d \
Expand Down
35 changes: 35 additions & 0 deletions make/photon/golang/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM photon:4.0

ARG GOVERSION

# install cgo-related dependencies && git
# official golang build from standard Debian, while photon os do not install git as default
RUN tdnf install build-essential git gpg -y

ENV PATH /usr/local/go/bin:$PATH

ENV GOLANG_VERSION ${GOVERSION}

RUN set eux; \
url="https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \
sha256="904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0"; \
wget -O go.tgz.asc "$url.asc"; \
wget -O go.tgz "$url"; \
echo "$sha256 *go.tgz" | sha256sum -c -; \
# https://github.com/golang/go/issues/14739#issuecomment-324767697
GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \
# https://www.google.com/linuxrepositories/
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \
# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \
gpg --batch --verify go.tgz.asc go.tgz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" go.tgz.asc; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
go version

ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
WORKDIR $GOPATH
2 changes: 1 addition & 1 deletion make/photon/registry/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM goharbor/golang:1.20.7
FROM goharbor/golang:1.21.12

ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
ENV BUILDTAGS include_oss include_gcs
Expand Down
2 changes: 1 addition & 1 deletion src/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/goharbor/harbor/src

go 1.17
go 1.21

replace github.com/goharbor/harbor => ../

Expand Down
2 changes: 0 additions & 2 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwt
github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY=
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
Expand Down Expand Up @@ -532,7 +531,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA=
Expand Down
4 changes: 2 additions & 2 deletions tests/apitests/python/test_list_helm_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def testListHelmCharts(self):

user_chart_password = "Aa123456"
TestProjects.CHART_NAME = 'mariadb'
TestProjects.VERSION = '4.3.1'
base.run_command( ["curl", r"-o", "./tests/apitests/python/mariadb-4.3.1.tgz", "https://storage.googleapis.com/harbor-builds/bin/charts/mariadb-4.3.1.tgz"])
TestProjects.VERSION = '18.2.6'
base.run_command( ["curl", r"-o", "./tests/apitests/python/mariadb-18.2.6.tgz", "https://storage.googleapis.com/harbor-ci-pipeline-store/bin/mariadb-18.2.6.tgz"])

#1. Create a new user(UA);
TestProjects.user_chart_id, user_chart_name = self.user.create_user(user_password = user_chart_password, **ADMIN_CLIENT)
Expand Down
40 changes: 20 additions & 20 deletions tests/ci/api_common_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ sudo ./tests/hostcfg.sh
# Note: In LDAP pipeline, this setting must be done before #
# LDAP prepare phase, since LDAP service is a docker service. #

ip addr
dns_ip=$(netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}')
dns_ip_list=$(echo $dns_ip | tr " " "\n")
dns_cfg=""
for ip in $dns_ip_list
do
dns_cfg="$dns_cfg,\"$ip\""
done

cat /etc/docker/daemon.json

if [ $(cat /etc/docker/daemon.json |grep \"dns\" |wc -l) -eq 0 ];then
sudo sed "s/}/,\n \"dns\": [${dns_cfg:1}]\n}/" -i /etc/docker/daemon.json
fi

cat /etc/docker/daemon.json
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl status docker
# ip addr
# dns_ip=$(sudo netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}')
# dns_ip_list=$(echo $dns_ip | tr " " "\n")
# dns_cfg=""
# for ip in $dns_ip_list
# do
# dns_cfg="$dns_cfg,\"$ip\""
# done
#
# cat /etc/docker/daemon.json
#
# if [ $(cat /etc/docker/daemon.json |grep \"dns\" |wc -l) -eq 0 ];then
# sudo sed "s/}/,\n \"dns\": [${dns_cfg:1}]\n}/" -i /etc/docker/daemon.json
# fi
#
# cat /etc/docker/daemon.json
# sudo systemctl daemon-reload
# sudo systemctl restart docker
# sudo systemctl status docker
# #
#---------------------------------------------------------------#

Expand All @@ -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.20.7 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
4 changes: 2 additions & 2 deletions tests/ci/distro_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

set -e

sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.20.7 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.20.7 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=
22 changes: 12 additions & 10 deletions tests/ci/ut_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ set -ex

sudo apt-get update && sudo apt-get install -y libldap2-dev
sudo go env -w GO111MODULE=auto
go get -d github.com/docker/distribution
go get -d github.com/docker/libtrust
go get -d github.com/lib/pq
go get golang.org/x/lint/golint
go get github.com/GeertJohan/fgt
go get github.com/dghubble/sling
set +e
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go get -u github.com/client9/misspell/cmd/misspell
pwd
go version
#go get -d github.com/docker/distribution
#go get -d github.com/docker/libtrust
#go get -d github.com/lib/pq
go install golang.org/x/lint/golint@latest
#go get github.com/GeertJohan/fgt
#go get github.com/dghubble/sling
#set +e
go install golang.org/x/tools/cmd/cover@latest
go install github.com/mattn/goveralls@latest
go install github.com/client9/misspell/cmd/misspell@latest
set -e
sudo service postgresql stop || echo no postgresql need to be stopped
sleep 2
Expand Down
12 changes: 6 additions & 6 deletions tests/resources/Harbor-Pages/Project-Helmcharts_Elements.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ ${chart_prov_browse} //*[@id='prov']
${upload_action_button} //*[@id='upload-chart']

${harbor_chart_name} harbor
${harbor_chart_filename} harbor-0.2.0.tgz
${harbor_chart_version} 0.2.0
${harbor_chart_prov_filename} harbor-0.2.0.tgz.prov
${harbor_chart_file_url} https://storage.googleapis.com/harbor-builds/helm-chart-test-files/harbor-0.2.0.tgz
${harbor_chart_prov_file_url} https://storage.googleapis.com/harbor-builds/helm-chart-test-files/harbor-0.2.0.tgz.prov
${harbor_chart_filename} harbor-1.14.2.tgz
${harbor_chart_version} 1.14.2
${harbor_chart_prov_filename} harbor-1.14.2.tgz.prov
${harbor_chart_file_url} https://storage.googleapis.com/harbor-ci-pipeline-store/bin/harbor-1.14.2.tgz
${harbor_chart_prov_file_url} https://storage.googleapis.com/harbor-ci-pipeline-store/bin/harbor-1.14.2.tgz.prov

${prometheus_chart_name} prometheus
${prometheus_chart_filename} prometheus-7.0.2.tgz
${prometheus_chart_version} 7.0.2
${prometheus_chart_file_url} https://storage.googleapis.com/harbor-builds/helm-chart-test-files/prometheus-7.0.2.tgz
${prometheus_chart_file_url} https://storage.googleapis.com/harbor-ci-pipeline-store/bin/prometheus-7.0.2.tgz
${prometheus_version} //hbr-helm-chart//a[contains(.,'prometheus')]

${chart_detail} //hbr-chart-detail
Expand Down
Loading