mirror of https://github.com/goharbor/harbor.git
Compare commits
28 Commits
main
...
v2.13.2-rc
Author | SHA1 | Date |
---|---|---|
|
436918f8f0 | |
|
14d9343cfb | |
|
dc6b05243d | |
|
b00575fbf1 | |
|
8596b0956e | |
|
4bc7f6796b | |
|
688a7d2e93 | |
|
9384ed0e47 | |
|
af4843729c | |
|
647842f419 | |
|
b8ee76373f | |
|
9a932a0f9a | |
|
abc5e55ea9 | |
|
785b60bcbe | |
|
6d3bf31364 | |
|
4170738322 | |
|
028b393112 | |
|
c130e3d539 | |
|
a37118f518 | |
|
40e78d5545 | |
|
05d5b64ff9 | |
|
f019430872 | |
|
b7e00b2e53 | |
|
db1569ae20 | |
|
69c62ef41a | |
|
d569ba20d6 | |
|
f5f912a780 | |
|
15f3aabc0d |
|
@ -8,6 +8,21 @@
|
|||
* Add date here... Add signature here...
|
||||
- Add your reason here...
|
||||
|
||||
* Jul 18 2025 <yan-yw.wang@broadcom.com>
|
||||
- Refresh base image
|
||||
|
||||
* May 20 2025 <yan-yw.wang@broadcom.com>
|
||||
- Refresh base image
|
||||
|
||||
* May 08 2025 <yan-yw.wang@broadcom.com>
|
||||
- Refresh base image
|
||||
|
||||
* Apr 08 2025 <yan-yw.wang@broadcom.com>
|
||||
- Refresh base image
|
||||
|
||||
* Apr 03 2025 <yan-yw.wang@broadcom.com>
|
||||
- Refresh base image
|
||||
|
||||
* Oct 24 2024 <yan-yw.wang@broadcom.com>
|
||||
- Refresh base image
|
||||
|
||||
|
@ -30,4 +45,4 @@
|
|||
- Refresh base image
|
||||
|
||||
* Jul 15 2021 <danfengl@vmware.com>
|
||||
- Create this file to trigger build base action in buld-package workflow
|
||||
- Create this file to trigger build base action in buld-package workflow
|
||||
|
|
|
@ -41,10 +41,10 @@ jobs:
|
|||
- ubuntu-latest
|
||||
timeout-minutes: 100
|
||||
steps:
|
||||
- name: Set up Go 1.23
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -102,10 +102,10 @@ jobs:
|
|||
- ubuntu-latest
|
||||
timeout-minutes: 100
|
||||
steps:
|
||||
- name: Set up Go 1.23
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -157,10 +157,10 @@ jobs:
|
|||
- ubuntu-latest
|
||||
timeout-minutes: 100
|
||||
steps:
|
||||
- name: Set up Go 1.23
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -212,10 +212,10 @@ jobs:
|
|||
- ubuntu-latest
|
||||
timeout-minutes: 100
|
||||
steps:
|
||||
- name: Set up Go 1.23
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -265,10 +265,10 @@ jobs:
|
|||
- ubuntu-latest
|
||||
timeout-minutes: 100
|
||||
steps:
|
||||
- name: Set up Go 1.23
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
|
|
@ -13,20 +13,18 @@ jobs:
|
|||
env:
|
||||
BUILD_PACKAGE: true
|
||||
runs-on:
|
||||
- ubuntu-20.04
|
||||
- ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: 'google-github-actions/auth@v2'
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4.1.0
|
||||
with:
|
||||
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
|
||||
- uses: google-github-actions/setup-gcloud@v2
|
||||
with:
|
||||
version: '430.0.0'
|
||||
- run: gcloud info
|
||||
- name: Set up Go 1.22
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- name: Setup Docker
|
||||
uses: docker-practice/actions-setup-docker@master
|
||||
|
|
|
@ -17,18 +17,16 @@ jobs:
|
|||
#- self-hosted
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- id: 'auth'
|
||||
name: 'Authenticate to Google Cloud'
|
||||
uses: google-github-actions/auth@v2
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4.1.0
|
||||
with:
|
||||
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
|
||||
- uses: google-github-actions/setup-gcloud@v2
|
||||
- run: gcloud info
|
||||
- name: Set up Go 1.21
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Set up Go 1.24
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.2
|
||||
go-version: 1.24.5
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -65,6 +63,5 @@ jobs:
|
|||
- name: upload test result to gs
|
||||
run: |
|
||||
cd src/github.com/goharbor/harbor
|
||||
gsutil cp ./distribution-spec/conformance/report.html gs://harbor-conformance-test/report.html
|
||||
gsutil acl ch -u AllUsers:R gs://harbor-conformance-test/report.html
|
||||
aws s3 cp ./distribution-spec/conformance/report.html s3://harbor-conformance-test/report.html
|
||||
if: always()
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
matrix:
|
||||
# maintain the versions of harbor that need to be actively
|
||||
# security scanned
|
||||
versions: [dev, v2.12.0-dev]
|
||||
versions: [dev, v2.13.0-dev]
|
||||
# list of images that need to be scanned
|
||||
images: [harbor-core, harbor-db, harbor-exporter, harbor-jobservice, harbor-log, harbor-portal, harbor-registryctl, prepare]
|
||||
permissions:
|
||||
|
|
|
@ -7,7 +7,7 @@ on:
|
|||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup env
|
||||
|
@ -19,12 +19,12 @@ jobs:
|
|||
echo "PRE_TAG=$(echo $release | jq -r '.body' | jq -r '.preTag')" >> $GITHUB_ENV
|
||||
echo "BRANCH=$(echo $release | jq -r '.target_commitish')" >> $GITHUB_ENV
|
||||
echo "PRERELEASE=$(echo $release | jq -r '.prerelease')" >> $GITHUB_ENV
|
||||
- uses: 'google-github-actions/auth@v2'
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4.1.0
|
||||
with:
|
||||
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
|
||||
- uses: google-github-actions/setup-gcloud@v2
|
||||
with:
|
||||
version: '430.0.0'
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Prepare Assets
|
||||
run: |
|
||||
if [ ! ${{ env.BUILD_NO }} -o ${{ env.BUILD_NO }} = "null" ]
|
||||
|
@ -39,8 +39,8 @@ jobs:
|
|||
src_online_package=harbor-online-installer-${{ env.BASE_TAG }}-${{ env.BUILD_NO }}.tgz
|
||||
dst_offline_package=harbor-offline-installer-${{ env.CUR_TAG }}.tgz
|
||||
dst_online_package=harbor-online-installer-${{ env.CUR_TAG }}.tgz
|
||||
gsutil cp gs://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${src_offline_package} gs://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${dst_offline_package}
|
||||
gsutil cp gs://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${src_online_package} gs://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${dst_online_package}
|
||||
aws s3 cp s3://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${src_offline_package} s3://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${dst_offline_package}
|
||||
aws s3 cp s3://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${src_online_package} s3://${{ secrets.HARBOR_RELEASE_BUILD }}/${{ env.BRANCH }}/${dst_online_package}
|
||||
|
||||
assets_path=$(pwd)/assets
|
||||
source tools/release/release_utils.sh && getAssets ${{ secrets.HARBOR_RELEASE_BUILD }} ${{ env.BRANCH }} $dst_offline_package $dst_online_package ${{ env.PRERELEASE }} $assets_path
|
||||
|
|
|
@ -167,7 +167,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo
|
|||
| 2.10 | 1.21.8 |
|
||||
| 2.11 | 1.22.3 |
|
||||
| 2.12 | 1.23.2 |
|
||||
| 2.13 | 1.23.8 |
|
||||
| 2.13 | 1.24.5 |
|
||||
|
||||
|
||||
Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.
|
||||
|
|
16
Makefile
16
Makefile
|
@ -105,8 +105,8 @@ PREPARE_VERSION_NAME=versions
|
|||
|
||||
#versions
|
||||
REGISTRYVERSION=v2.8.3-patch-redis
|
||||
TRIVYVERSION=v0.61.0
|
||||
TRIVYADAPTERVERSION=v0.33.0-rc.2
|
||||
TRIVYVERSION=v0.64.1
|
||||
TRIVYADAPTERVERSION=v0.33.2
|
||||
NODEBUILDIMAGE=node:16.18.0
|
||||
|
||||
# version of registry for pulling the source code
|
||||
|
@ -144,7 +144,7 @@ GOINSTALL=$(GOCMD) install
|
|||
GOTEST=$(GOCMD) test
|
||||
GODEP=$(GOTEST) -i
|
||||
GOFMT=gofmt -w
|
||||
GOBUILDIMAGE=golang:1.23.8
|
||||
GOBUILDIMAGE=golang:1.24.5
|
||||
GOBUILDPATHINCONTAINER=/harbor
|
||||
|
||||
# go build
|
||||
|
@ -308,13 +308,13 @@ define swagger_generate_server
|
|||
@$(SWAGGER_GENERATE_SERVER) -f $(1) -A $(3) --target $(2)
|
||||
endef
|
||||
|
||||
gen_apis: lint_apis
|
||||
gen_apis:
|
||||
$(call prepare_docker_image,${SWAGGER_IMAGENAME},${SWAGGER_VERSION},${SWAGGER_IMAGE_BUILD_CMD})
|
||||
$(call swagger_generate_server,api/v2.0/swagger.yaml,src/server/v2.0,harbor)
|
||||
|
||||
|
||||
MOCKERY_IMAGENAME=$(IMAGENAMESPACE)/mockery
|
||||
MOCKERY_VERSION=v2.51.0
|
||||
MOCKERY_VERSION=v2.53.3
|
||||
MOCKERY=$(RUNCONTAINER)/src ${MOCKERY_IMAGENAME}:${MOCKERY_VERSION}
|
||||
MOCKERY_IMAGE_BUILD_CMD=${DOCKERBUILD} -f ${TOOLSPATH}/mockery/Dockerfile --build-arg GOLANG=${GOBUILDIMAGE} --build-arg MOCKERY_VERSION=${MOCKERY_VERSION} -t ${MOCKERY_IMAGENAME}:$(MOCKERY_VERSION) .
|
||||
|
||||
|
@ -338,7 +338,7 @@ versions_prepare:
|
|||
check_environment:
|
||||
@$(MAKEPATH)/$(CHECKENVCMD)
|
||||
|
||||
compile_core: gen_apis
|
||||
compile_core: lint_apis gen_apis
|
||||
@echo "compiling binary for core (golang image)..."
|
||||
@echo $(GOBUILDPATHINCONTAINER)
|
||||
@$(DOCKERCMD) run --rm -v $(BUILDPATH):$(GOBUILDPATHINCONTAINER) -w $(GOBUILDPATH_CORE) $(GOBUILDIMAGE) $(GOIMAGEBUILD_CORE) -o $(GOBUILDPATHINCONTAINER)/$(GOBUILDMAKEPATH_CORE)/$(CORE_BINARYNAME)
|
||||
|
@ -399,7 +399,7 @@ build:
|
|||
-e TRIVY_DOWNLOAD_URL=$(TRIVY_DOWNLOAD_URL) -e TRIVY_ADAPTER_DOWNLOAD_URL=$(TRIVY_ADAPTER_DOWNLOAD_URL) \
|
||||
-e PULL_BASE_FROM_DOCKERHUB=$(PULL_BASE_FROM_DOCKERHUB) -e BUILD_BASE=$(BUILD_BASE) \
|
||||
-e REGISTRYUSER=$(REGISTRYUSER) -e REGISTRYPASSWORD=$(REGISTRYPASSWORD) \
|
||||
-e PUSHBASEIMAGE=$(PUSHBASEIMAGE)
|
||||
-e PUSHBASEIMAGE=$(PUSHBASEIMAGE) -e GOBUILDIMAGE=$(GOBUILDIMAGE)
|
||||
|
||||
build_standalone_db_migrator: compile_standalone_db_migrator
|
||||
make -f $(MAKEFILEPATH_PHOTON)/Makefile _build_standalone_db_migrator -e BASEIMAGETAG=$(BASEIMAGETAG) -e VERSIONTAG=$(VERSIONTAG)
|
||||
|
@ -471,7 +471,7 @@ misspell:
|
|||
@find . -type d \( -path ./tests \) -prune -o -name '*.go' -print | xargs misspell -error
|
||||
|
||||
# golangci-lint binary installation or refer to https://golangci-lint.run/usage/install/#local-installation
|
||||
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
|
||||
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.2
|
||||
GOLANGCI_LINT := $(shell go env GOPATH)/bin/golangci-lint
|
||||
lint:
|
||||
@echo checking lint
|
||||
|
|
|
@ -154,7 +154,7 @@ _build_trivy_adapter:
|
|||
$(call _extract_archive, $(TRIVY_ADAPTER_DOWNLOAD_URL), $(DOCKERFILEPATH_TRIVY_ADAPTER)/binary/) ; \
|
||||
else \
|
||||
echo "Building Trivy adapter $(TRIVYADAPTERVERSION) from sources..." ; \
|
||||
cd $(DOCKERFILEPATH_TRIVY_ADAPTER) && $(DOCKERFILEPATH_TRIVY_ADAPTER)/builder.sh $(TRIVYADAPTERVERSION) && cd - ; \
|
||||
cd $(DOCKERFILEPATH_TRIVY_ADAPTER) && $(DOCKERFILEPATH_TRIVY_ADAPTER)/builder.sh $(TRIVYADAPTERVERSION) $(GOBUILDIMAGE) && cd - ; \
|
||||
fi ; \
|
||||
echo "Building Trivy adapter container for photon..." ; \
|
||||
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) \
|
||||
|
@ -178,7 +178,7 @@ _build_registry:
|
|||
rm -rf $(DOCKERFILEPATH_REG)/binary && mkdir -p $(DOCKERFILEPATH_REG)/binary && \
|
||||
$(call _get_binary, $(REGISTRYURL), $(DOCKERFILEPATH_REG)/binary/registry); \
|
||||
else \
|
||||
cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) $(DISTRIBUTION_SRC) && cd - ; \
|
||||
cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) $(DISTRIBUTION_SRC) $(GOBUILDIMAGE) && cd - ; \
|
||||
fi
|
||||
@echo "building registry container for photon..."
|
||||
@chmod 655 $(DOCKERFILEPATH_REG)/binary/registry && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REG)/$(DOCKERFILENAME_REG) -t $(DOCKERIMAGENAME_REG):$(VERSIONTAG) .
|
||||
|
|
|
@ -6,6 +6,8 @@ REGISTRY_CONTROLLER_URL={{registry_controller_url}}
|
|||
JOBSERVICE_WEBHOOK_JOB_MAX_RETRY={{notification_webhook_job_max_retry}}
|
||||
JOBSERVICE_WEBHOOK_JOB_HTTP_CLIENT_TIMEOUT={{notification_webhook_job_http_client_timeout}}
|
||||
|
||||
LOG_LEVEL={{log_level}}
|
||||
|
||||
{%if internal_tls.enabled %}
|
||||
INTERNAL_TLS_ENABLED=true
|
||||
INTERNAL_TLS_TRUST_CA_PATH=/harbor_cust_cert/harbor_internal_ca.crt
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
FROM golang:1.23.8
|
||||
ARG golang_image
|
||||
FROM ${golang_image}
|
||||
|
||||
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
|
||||
ENV BUILDTAGS include_oss include_gcs
|
||||
|
|
|
@ -14,6 +14,7 @@ fi
|
|||
|
||||
VERSION="$1"
|
||||
DISTRIBUTION_SRC="$2"
|
||||
GOBUILDIMAGE="$3"
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -32,7 +33,7 @@ cd $cur
|
|||
|
||||
echo 'build the registry binary ...'
|
||||
cp Dockerfile.binary $TEMP
|
||||
docker build -f $TEMP/Dockerfile.binary -t registry-golang $TEMP
|
||||
docker build --build-arg golang_image=$GOBUILDIMAGE -f $TEMP/Dockerfile.binary -t registry-golang $TEMP
|
||||
|
||||
echo 'copy the registry binary to local...'
|
||||
ID=$(docker create registry-golang)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
FROM golang:1.23.8
|
||||
ARG golang_image
|
||||
FROM ${golang_image}
|
||||
|
||||
ADD . /go/src/github.com/goharbor/harbor-scanner-trivy/
|
||||
WORKDIR /go/src/github.com/goharbor/harbor-scanner-trivy/
|
||||
|
|
|
@ -8,6 +8,7 @@ if [ -z $1 ]; then
|
|||
fi
|
||||
|
||||
VERSION="$1"
|
||||
GOBUILDIMAGE="$2"
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -19,9 +20,9 @@ TEMP=$(mktemp -d ${TMPDIR-/tmp}/trivy-adapter.XXXXXX)
|
|||
git clone https://github.com/goharbor/harbor-scanner-trivy.git $TEMP
|
||||
cd $TEMP; git checkout $VERSION; cd -
|
||||
|
||||
echo "Building Trivy adapter binary based on golang:1.23.8..."
|
||||
echo "Building Trivy adapter binary ..."
|
||||
cp Dockerfile.binary $TEMP
|
||||
docker build -f $TEMP/Dockerfile.binary -t trivy-adapter-golang $TEMP
|
||||
docker build --build-arg golang_image=$GOBUILDIMAGE -f $TEMP/Dockerfile.binary -t trivy-adapter-golang $TEMP
|
||||
|
||||
echo "Copying Trivy adapter binary from the container to the local directory..."
|
||||
ID=$(docker create trivy-adapter-golang)
|
||||
|
|
|
@ -1,76 +1,56 @@
|
|||
linters-settings:
|
||||
gofmt:
|
||||
# Simplify code: gofmt with `-s` option.
|
||||
# Default: true
|
||||
simplify: false
|
||||
misspell:
|
||||
locale: US,UK
|
||||
goimports:
|
||||
local-prefixes: github.com/goharbor/harbor
|
||||
stylecheck:
|
||||
checks: [
|
||||
"ST1019", # Importing the same package multiple times.
|
||||
]
|
||||
goheader:
|
||||
template-path: copyright.tmpl
|
||||
|
||||
version: "2"
|
||||
linters:
|
||||
disable-all: true
|
||||
default: none
|
||||
enable:
|
||||
- gofmt
|
||||
- goheader
|
||||
- misspell
|
||||
- typecheck
|
||||
# - dogsled
|
||||
# - dupl
|
||||
# - depguard
|
||||
# - funlen
|
||||
# - goconst
|
||||
# - gocritic
|
||||
# - gocyclo
|
||||
# - goimports
|
||||
# - goprintffuncname
|
||||
- ineffassign
|
||||
# - nakedret
|
||||
# - nolintlint
|
||||
- revive
|
||||
- whitespace
|
||||
- bodyclose
|
||||
- errcheck
|
||||
# - gosec
|
||||
- gosimple
|
||||
- goimports
|
||||
- goheader
|
||||
- govet
|
||||
# - noctx
|
||||
# - rowserrcheck
|
||||
- ineffassign
|
||||
- misspell
|
||||
- revive
|
||||
- staticcheck
|
||||
- stylecheck
|
||||
# - unconvert
|
||||
# - unparam
|
||||
# - unused // disabled due to too many false positive check and limited support golang 1.19 https://github.com/dominikh/go-tools/issues/1282
|
||||
|
||||
run:
|
||||
skip-files:
|
||||
- ".*_test.go"
|
||||
- ".*test.go"
|
||||
skip-dirs:
|
||||
- "testing"
|
||||
timeout: 20m
|
||||
|
||||
issue:
|
||||
max-same-issues: 0
|
||||
max-per-linter: 0
|
||||
|
||||
issues:
|
||||
# Excluding configuration per-path, per-linter, per-text and per-source
|
||||
exclude-rules:
|
||||
# Exclude some linters from running on tests files.
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- goimports
|
||||
- path: src/testing/*.go
|
||||
linters:
|
||||
- goimports
|
||||
- path: src/jobservice/mgt/mock_manager.go
|
||||
linters:
|
||||
- goimports
|
||||
- whitespace
|
||||
settings:
|
||||
goheader:
|
||||
template-path: copyright.tmpl
|
||||
misspell:
|
||||
locale: US,UK
|
||||
staticcheck:
|
||||
checks:
|
||||
- ST1019
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
- _test\.go
|
||||
- .*test\.go
|
||||
- testing
|
||||
- src/jobservice/mgt/mock_manager.go
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- goimports
|
||||
settings:
|
||||
gofmt:
|
||||
simplify: false
|
||||
goimports:
|
||||
local-prefixes:
|
||||
- github.com/goharbor/harbor
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
- _test\.go
|
||||
- .*test\.go
|
||||
- testing
|
||||
- src/jobservice/mgt/mock_manager.go
|
||||
|
|
|
@ -237,14 +237,14 @@ func GetStrValueOfAnyType(value interface{}) string {
|
|||
}
|
||||
|
||||
// IsIllegalLength ...
|
||||
func IsIllegalLength(s string, min int, max int) bool {
|
||||
if min == -1 {
|
||||
return (len(s) > max)
|
||||
func IsIllegalLength(s string, minVal int, maxVal int) bool {
|
||||
if minVal == -1 {
|
||||
return (len(s) > maxVal)
|
||||
}
|
||||
if max == -1 {
|
||||
return (len(s) <= min)
|
||||
if maxVal == -1 {
|
||||
return (len(s) <= minVal)
|
||||
}
|
||||
return (len(s) < min || len(s) > max)
|
||||
return (len(s) < minVal || len(s) > maxVal)
|
||||
}
|
||||
|
||||
// ParseJSONInt ...
|
||||
|
|
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/goharbor/harbor/src/controller/scan"
|
||||
"github.com/goharbor/harbor/src/core/service/token"
|
||||
"github.com/goharbor/harbor/src/jobservice/job"
|
||||
"github.com/goharbor/harbor/src/lib"
|
||||
"github.com/goharbor/harbor/src/lib/config"
|
||||
"github.com/goharbor/harbor/src/lib/errors"
|
||||
"github.com/goharbor/harbor/src/lib/log"
|
||||
|
@ -341,13 +342,18 @@ func (de *defaultEnforcer) PreheatArtifact(ctx context.Context, art *artifact.Ar
|
|||
|
||||
// getCandidates get the initial candidates by evaluating the policy
|
||||
func (de *defaultEnforcer) getCandidates(ctx context.Context, ps *pol.Schema, p *proModels.Project) ([]*selector.Candidate, error) {
|
||||
// Filter the candidates by supported types.
|
||||
var supportedTypes []any
|
||||
for _, t := range lib.SliceToUpper(pr.SupportedTypes) {
|
||||
supportedTypes = append(supportedTypes, t)
|
||||
}
|
||||
// Get the initial candidates
|
||||
// Here we have a hidden filter, the artifact type filter.
|
||||
// Only get the image type at this moment.
|
||||
arts, err := de.artCtl.List(ctx, &q.Query{
|
||||
Keywords: map[string]interface{}{
|
||||
"ProjectID": ps.ProjectID,
|
||||
"Type": strings.ToUpper(pr.SupportedType),
|
||||
"Type": q.NewOrList(supportedTypes),
|
||||
},
|
||||
}, &artifact.Option{
|
||||
WithLabel: true,
|
||||
|
@ -433,7 +439,7 @@ func (de *defaultEnforcer) startTask(ctx context.Context, executionID int64, can
|
|||
}
|
||||
|
||||
pi := &pr.PreheatImage{
|
||||
Type: pr.SupportedType,
|
||||
Type: candidate.Kind,
|
||||
URL: u,
|
||||
Headers: map[string]interface{}{
|
||||
accessCredHeaderKey: cred,
|
||||
|
@ -517,7 +523,7 @@ func (de *defaultEnforcer) toCandidates(ctx context.Context, p *proModels.Projec
|
|||
NamespaceID: p.ProjectID,
|
||||
Namespace: p.Name,
|
||||
Repository: pureRepository(p.Name, a.RepositoryName),
|
||||
Kind: pr.SupportedType,
|
||||
Kind: strings.ToLower(a.Type),
|
||||
Digest: a.Digest,
|
||||
Tags: []string{t.Name},
|
||||
Labels: getLabels(a.Labels),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package flow
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package flow
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package replication
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/goharbor/harbor/src
|
||||
|
||||
go 1.23.8
|
||||
go 1.24.5
|
||||
|
||||
require (
|
||||
github.com/CloudNativeAI/model-spec v0.0.3
|
||||
|
@ -67,14 +67,14 @@ require (
|
|||
go.pinniped.dev v0.37.0
|
||||
go.uber.org/ratelimit v0.3.1
|
||||
golang.org/x/crypto v0.36.0
|
||||
golang.org/x/net v0.37.0
|
||||
golang.org/x/net v0.38.0
|
||||
golang.org/x/oauth2 v0.27.0
|
||||
golang.org/x/sync v0.12.0
|
||||
golang.org/x/text v0.23.0
|
||||
golang.org/x/time v0.11.0
|
||||
gopkg.in/h2non/gock.v1 v1.1.2
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
helm.sh/helm/v3 v3.17.2
|
||||
helm.sh/helm/v3 v3.17.4
|
||||
k8s.io/api v0.32.2
|
||||
k8s.io/apimachinery v0.32.2
|
||||
k8s.io/client-go v0.32.2
|
||||
|
|
|
@ -693,8 +693,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
|||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
||||
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
|
||||
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
|
||||
|
@ -874,8 +874,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
|||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
|
||||
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
|
||||
helm.sh/helm/v3 v3.17.2 h1:agYQ5ew2jq5vdx2K7q5W44KyKQrnSubUMCQsjkiv3/o=
|
||||
helm.sh/helm/v3 v3.17.2/go.mod h1:+uJKMH/UiMzZQOALR3XUf3BLIoczI2RKKD6bMhPh4G8=
|
||||
helm.sh/helm/v3 v3.17.4 h1:GK+vgn9gKCyoH44+f3B5zpA78iH3AK4ywIInDEmmn/g=
|
||||
helm.sh/helm/v3 v3.17.4/go.mod h1:+uJKMH/UiMzZQOALR3XUf3BLIoczI2RKKD6bMhPh4G8=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
|
|
|
@ -226,8 +226,8 @@ func (bm *basicManager) GetPeriodicExecution(pID string, q *query.Parameter) (re
|
|||
return results, total, nil
|
||||
}
|
||||
|
||||
min, max := (pageNumber-1)*pageSize, pageNumber*pageSize-1
|
||||
args := []interface{}{key, min, max}
|
||||
minVal, maxVal := (pageNumber-1)*pageSize, pageNumber*pageSize-1
|
||||
args := []interface{}{key, minVal, maxVal}
|
||||
list, err := redis.Values(conn.Do("ZREVRANGE", args...))
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mgt
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package period
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package cache
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ func TestIsNotFoundError(t *testing.T) {
|
|||
|
||||
// pass
|
||||
message := "message"
|
||||
err = AsNotFoundError(orm.ErrNoRows, message)
|
||||
err = AsNotFoundError(orm.ErrNoRows, "%s", "message")
|
||||
require.NotNil(t, err)
|
||||
assert.Equal(t, errors.NotFoundCode, err.Code)
|
||||
assert.Equal(t, message, err.Message)
|
||||
|
@ -55,7 +55,7 @@ func TestIsConflictError(t *testing.T) {
|
|||
message := "message"
|
||||
err = AsConflictError(&pgconn.PgError{
|
||||
Code: "23505",
|
||||
}, message)
|
||||
}, "%s", message)
|
||||
require.NotNil(t, err)
|
||||
assert.Equal(t, errors.ConflictCode, err.Code)
|
||||
assert.Equal(t, message, err.Message)
|
||||
|
@ -74,7 +74,7 @@ func TestIsForeignKeyError(t *testing.T) {
|
|||
message := "message"
|
||||
err = AsForeignKeyError(&pgconn.PgError{
|
||||
Code: "23503",
|
||||
}, message)
|
||||
}, "%s", message)
|
||||
require.NotNil(t, err)
|
||||
assert.Equal(t, errors.ViolateForeignKeyConstraintCode, err.Code)
|
||||
assert.Equal(t, message, err.Message)
|
||||
|
|
|
@ -22,6 +22,7 @@ import (
|
|||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
|
||||
"github.com/goharbor/harbor/src/lib/log"
|
||||
"github.com/goharbor/harbor/src/lib/q"
|
||||
)
|
||||
|
||||
|
@ -155,17 +156,41 @@ func setFilters(ctx context.Context, qs orm.QuerySeter, query *q.Query, meta *me
|
|||
// The "strings.SplitN()" here is a workaround for the incorrect usage of query which should be avoided
|
||||
// e.g. use the query with the knowledge of underlying ORM implementation, the "OrList" should be used instead:
|
||||
// https://github.com/goharbor/harbor/blob/v2.2.0/src/controller/project/controller.go#L348
|
||||
k := strings.SplitN(key, orm.ExprSep, 2)[0]
|
||||
mk, filterable := meta.Filterable(k)
|
||||
keyPieces := strings.Split(key, orm.ExprSep)
|
||||
if len(keyPieces) > 2 {
|
||||
log.Warningf("The separator '%s' is not valid in the query parameter '%s__%s'. Please use the correct field name.", orm.ExprSep, keyPieces[0], keyPieces[1])
|
||||
continue
|
||||
}
|
||||
fieldKey := keyPieces[0]
|
||||
mk, filterable := meta.Filterable(fieldKey)
|
||||
if !filterable {
|
||||
// This is a workaround for the unsuitable usage of query, the keyword format for field and method should be consistent
|
||||
// e.g. "ArtifactDigest" or the snake case format "artifact_digest" should be used instead:
|
||||
// https://github.com/goharbor/harbor/blob/v2.2.0/src/controller/blob/controller.go#L233
|
||||
mk, filterable = meta.Filterable(snakeCase(k))
|
||||
mk, filterable = meta.Filterable(snakeCase(fieldKey))
|
||||
if mk == nil || !filterable {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// only accept the below operators
|
||||
if len(keyPieces) == 2 {
|
||||
operator := orm.ExprSep + keyPieces[1]
|
||||
allowedOperators := map[string]struct{}{
|
||||
"__icontains": {},
|
||||
"__in": {},
|
||||
"__gte": {},
|
||||
"__lte": {},
|
||||
"__gt": {},
|
||||
"__lt": {},
|
||||
"__exact": {},
|
||||
}
|
||||
if _, ok := allowedOperators[operator]; !ok {
|
||||
log.Warningf("the operator '%s' in query parameter '%s' is not supported, the query will be skipped.", operator, key)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// filter function defined, use it directly
|
||||
if mk.FilterFunc != nil {
|
||||
qs = mk.FilterFunc(ctx, qs, key, value)
|
||||
|
|
|
@ -132,17 +132,17 @@ func parseRange(value string) (*Range, error) {
|
|||
return nil, fmt.Errorf(`range must start with "[", end with "]" and contains only one "~"`)
|
||||
}
|
||||
strs := strings.SplitN(value[1:length-1], "~", 2)
|
||||
min := strings.TrimSpace(strs[0])
|
||||
max := strings.TrimSpace(strs[1])
|
||||
if len(min) == 0 && len(max) == 0 {
|
||||
minVal := strings.TrimSpace(strs[0])
|
||||
maxVal := strings.TrimSpace(strs[1])
|
||||
if len(minVal) == 0 && len(maxVal) == 0 {
|
||||
return nil, fmt.Errorf(`min and max at least one should be set in range'`)
|
||||
}
|
||||
r := &Range{}
|
||||
if len(min) > 0 {
|
||||
r.Min = parseValue(min)
|
||||
if len(minVal) > 0 {
|
||||
r.Min = parseValue(minVal)
|
||||
}
|
||||
if len(max) > 0 {
|
||||
r.Max = parseValue(max)
|
||||
if len(maxVal) > 0 {
|
||||
r.Max = parseValue(maxVal)
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
|
|
@ -105,10 +105,10 @@ func NewSort(key string, desc bool) *Sort {
|
|||
}
|
||||
|
||||
// NewRange creates a new range
|
||||
func NewRange(min, max interface{}) *Range {
|
||||
func NewRange(minVal, maxVal interface{}) *Range {
|
||||
return &Range{
|
||||
Min: min,
|
||||
Max: max,
|
||||
Min: minVal,
|
||||
Max: maxVal,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@ func InitialInterval(initial time.Duration) Option {
|
|||
}
|
||||
|
||||
// MaxInterval set max interval
|
||||
func MaxInterval(max time.Duration) Option {
|
||||
func MaxInterval(maxInterval time.Duration) Option {
|
||||
return func(opts *Options) {
|
||||
opts.MaxInterval = max
|
||||
opts.MaxInterval = maxInterval
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,3 +33,13 @@ func Title(s string) string {
|
|||
title := cases.Title(language.Und)
|
||||
return title.String(strings.ToLower(s))
|
||||
}
|
||||
|
||||
// SliceToUpper converts a slice of strings to uppercase.
|
||||
func SliceToUpper(s []string) []string {
|
||||
result := make([]string, len(s))
|
||||
for i, str := range s {
|
||||
result[i] = strings.ToUpper(str)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package lib
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -52,3 +53,56 @@ func TestTitle(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSliceToUpper(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input []string
|
||||
expected []string
|
||||
}{
|
||||
{
|
||||
name: "Empty slice",
|
||||
input: []string{},
|
||||
expected: []string{},
|
||||
},
|
||||
{
|
||||
name: "Single element",
|
||||
input: []string{"hello"},
|
||||
expected: []string{"HELLO"},
|
||||
},
|
||||
{
|
||||
name: "Multiple elements",
|
||||
input: []string{"hello", "world", "go"},
|
||||
expected: []string{"HELLO", "WORLD", "GO"},
|
||||
},
|
||||
{
|
||||
name: "Already uppercase",
|
||||
input: []string{"HELLO", "WORLD"},
|
||||
expected: []string{"HELLO", "WORLD"},
|
||||
},
|
||||
{
|
||||
name: "Mixed case",
|
||||
input: []string{"Hello", "World", "Go"},
|
||||
expected: []string{"HELLO", "WORLD", "GO"},
|
||||
},
|
||||
{
|
||||
name: "With special characters",
|
||||
input: []string{"hello!", "world?", "go#"},
|
||||
expected: []string{"HELLO!", "WORLD?", "GO#"},
|
||||
},
|
||||
{
|
||||
name: "With numbers",
|
||||
input: []string{"hello123", "world456"},
|
||||
expected: []string{"HELLO123", "WORLD456"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := SliceToUpper(tt.input)
|
||||
if !reflect.DeepEqual(result, tt.expected) {
|
||||
t.Errorf("SliceToUpper() = %v, want %v", result, tt.expected)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,17 @@ const (
|
|||
|
||||
// dragonflyJobPath is the job path for dragonfly openapi.
|
||||
dragonflyJobPath = "/oapi/v1/jobs"
|
||||
)
|
||||
|
||||
const (
|
||||
// preheatTypeImage represents the image to the dragonfly cluster.
|
||||
preheatTypeImage = "image"
|
||||
|
||||
// preheatTypeFile represents the file to the dragonfly cluster.
|
||||
preheatTypeFile = "file"
|
||||
)
|
||||
|
||||
const (
|
||||
// scopeTypeSingleSeedPeer represents preheat image to single seed peer in p2p cluster.
|
||||
scopeTypeSingleSeedPeer = "single_seed_peer"
|
||||
|
||||
|
@ -233,9 +243,9 @@ func (dd *DragonflyDriver) Preheat(preheatingImage *PreheatImage) (*PreheatingSt
|
|||
// Construct the preheat job request by the given parameters of the preheating image .
|
||||
req := &dragonflyCreateJobRequest{
|
||||
Type: "preheat",
|
||||
// TODO: Support set SchedulerClusterIDs, FilteredQueryParam, ConcurrentCount and Timeout.
|
||||
// TODO: Support set FilteredQueryParam, ConcurrentCount and Timeout.
|
||||
Args: dragonflyCreateJobRequestArgs{
|
||||
Type: preheatingImage.Type,
|
||||
Type: preheatTypeImage,
|
||||
URL: preheatingImage.URL,
|
||||
Headers: headerToMapString(preheatingImage.Headers),
|
||||
},
|
||||
|
|
|
@ -17,13 +17,17 @@ package provider
|
|||
import (
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"slices"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
// SupportedType indicates the supported preheating type 'image'.
|
||||
SupportedType = "image"
|
||||
var (
|
||||
// SupportedTypes indicates the supported preheating types.
|
||||
SupportedTypes = []string{
|
||||
"image",
|
||||
"cnai",
|
||||
}
|
||||
)
|
||||
|
||||
// PreheatImage contains related information which can help providers to get/pull the images.
|
||||
|
@ -75,7 +79,7 @@ func (img *PreheatImage) ToJSON() (string, error) {
|
|||
|
||||
// Validate PreheatImage
|
||||
func (img *PreheatImage) Validate() error {
|
||||
if img.Type != SupportedType {
|
||||
if !slices.Contains(SupportedTypes, img.Type) {
|
||||
return errors.Errorf("unsupported type '%s'", img.Type)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package scheduler
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,7 +9,7 @@
|
|||
"dependencies": {
|
||||
"css-loader": "^6.11.0",
|
||||
"style-loader": "^3.3.4",
|
||||
"swagger-ui": "5.17.14"
|
||||
"swagger-ui": "5.20.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
|
|
|
@ -786,11 +786,12 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
"version": "7.24.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
|
||||
"integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==",
|
||||
"version": "7.26.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
|
||||
"integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.24.7",
|
||||
"@babel/helper-validator-identifier": "^7.25.9",
|
||||
"js-tokens": "^4.0.0",
|
||||
"picocolors": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -1159,17 +1160,17 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.24.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",
|
||||
"integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz",
|
||||
"integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.24.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
|
||||
"integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
|
||||
"integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
|
@ -1211,50 +1212,36 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@babel/helpers": {
|
||||
"version": "7.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz",
|
||||
"integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz",
|
||||
"integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.25.0",
|
||||
"@babel/types": "^7.25.6"
|
||||
"@babel/template": "^7.26.9",
|
||||
"@babel/types": "^7.26.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helpers/node_modules/@babel/template": {
|
||||
"version": "7.25.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz",
|
||||
"integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==",
|
||||
"version": "7.26.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz",
|
||||
"integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.24.7",
|
||||
"@babel/parser": "^7.25.0",
|
||||
"@babel/types": "^7.25.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/highlight": {
|
||||
"version": "7.24.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
|
||||
"integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.24.7",
|
||||
"chalk": "^2.4.2",
|
||||
"js-tokens": "^4.0.0",
|
||||
"picocolors": "^1.0.0"
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@babel/parser": "^7.26.9",
|
||||
"@babel/types": "^7.26.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz",
|
||||
"integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz",
|
||||
"integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.25.6"
|
||||
"@babel/types": "^7.26.10"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
|
@ -2609,13 +2596,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
|
||||
"integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz",
|
||||
"integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.24.8",
|
||||
"@babel/helper-validator-identifier": "^7.24.7",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
"@babel/helper-string-parser": "^7.25.9",
|
||||
"@babel/helper-validator-identifier": "^7.25.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
@ -5276,6 +5262,7 @@
|
|||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
|
@ -5501,9 +5488,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.7.7",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
|
||||
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
|
||||
"version": "1.8.4",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
|
||||
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
|
@ -6078,19 +6065,6 @@
|
|||
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/chardet": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
|
||||
|
@ -6299,6 +6273,7 @@
|
|||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
|
@ -6306,7 +6281,8 @@
|
|||
"node_modules/color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/color-support": {
|
||||
"version": "1.1.3",
|
||||
|
@ -8443,6 +8419,7 @@
|
|||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
|
@ -9898,14 +9875,6 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/has-property-descriptors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
|
||||
|
@ -17128,17 +17097,6 @@
|
|||
"integrity": "sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dependencies": {
|
||||
"has-flag": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-hyperlinks": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz",
|
||||
|
@ -17546,14 +17504,6 @@
|
|||
"node": ">=8.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/to-fast-properties": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||
"integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*ngIf="isImage(artifact)"
|
||||
[title]="getPullCommandForRuntimeByDigest(artifact)"
|
||||
[iconMode]="true"
|
||||
id="pullCommandForDigest"
|
||||
(onCopySuccess)="
|
||||
onCpSuccess(getPullCommandForRuntimeByDigest(artifact))
|
||||
"
|
||||
|
@ -12,6 +13,7 @@
|
|||
<div
|
||||
*ngIf="isCNAB(artifact)"
|
||||
class="flex"
|
||||
id="pullCommandForCNAB"
|
||||
aria-label="Dropdown header Action">
|
||||
<hbr-copy-input
|
||||
[title]="getPullCommandForCNAB(artifact)"
|
||||
|
@ -20,8 +22,9 @@
|
|||
[defaultValue]="getPullCommandForCNAB(artifact)"></hbr-copy-input>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="isChart(artifact)"
|
||||
*ngIf="isChart(artifact) && artifact.tagNumber > 0"
|
||||
class="flex"
|
||||
id="pullCommandForChart"
|
||||
aria-label="Dropdown header Action">
|
||||
<hbr-copy-input
|
||||
[title]="getPullCommandForChart(artifact)"
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
import { PullCommandComponent } from './pull-command.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SharedTestingModule } from '../../../../../../../../shared/shared.module';
|
||||
import { ArtifactType } from '../../../../artifact'; // Import the necessary type
|
||||
import { ArtifactType, Clients } from '../../../../artifact'; // Import the necessary type
|
||||
import { ArtifactFront } from '../../../../artifact';
|
||||
|
||||
describe('PullCommandComponent', () => {
|
||||
let component: PullCommandComponent;
|
||||
|
@ -29,11 +30,11 @@ describe('PullCommandComponent', () => {
|
|||
fixture = TestBed.createComponent(PullCommandComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
// Mock the artifact input with a valid value
|
||||
component.artifact = {
|
||||
type: ArtifactType.IMAGE,
|
||||
digest: 'sampleDigest',
|
||||
tags: [{ name: 'latest' }],
|
||||
type: ArtifactType.CHART,
|
||||
tagNumber: 1,
|
||||
digest: 'sha256@digest',
|
||||
tags: [{ name: '1.0.0' }],
|
||||
};
|
||||
|
||||
fixture.detectChanges();
|
||||
|
@ -42,4 +43,69 @@ describe('PullCommandComponent', () => {
|
|||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should not display pull command for chart', async () => {
|
||||
// Mock the artifact input with a valid value
|
||||
component.artifact = {
|
||||
type: ArtifactType.CHART,
|
||||
tagNumber: 0,
|
||||
digest: 'sha256@digest',
|
||||
tags: [],
|
||||
};
|
||||
component.getPullCommandForChart(component.artifact);
|
||||
expect(
|
||||
component.getPullCommandForChart(component.artifact).length
|
||||
).toBe(0);
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const modal =
|
||||
fixture.nativeElement.querySelector(`#pullCommandForChart`);
|
||||
expect(modal).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should display when pull command for chart is available', async () => {
|
||||
// Mock the artifact input with a valid value
|
||||
component.artifact = {
|
||||
type: ArtifactType.CHART,
|
||||
tagNumber: 1,
|
||||
digest: 'sha256@digest',
|
||||
tags: [{ name: '1.0.0' }],
|
||||
};
|
||||
component.getPullCommandForChart(component.artifact);
|
||||
expect(
|
||||
component.getPullCommandForChart(component.artifact).length
|
||||
).toBeGreaterThan(0);
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const modal =
|
||||
fixture.nativeElement.querySelector(`#pullCommandForChart`);
|
||||
expect(modal).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should display when pull command for digest is available', async () => {
|
||||
// Mock the artifact input with a valid value
|
||||
component.artifact = {
|
||||
type: ArtifactType.IMAGE,
|
||||
};
|
||||
component.getPullCommandForRuntimeByDigest(component.artifact);
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const modal = fixture.nativeElement.querySelector(
|
||||
`#pullCommandForDigest`
|
||||
);
|
||||
expect(modal).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should display when pull command for CNAB is available', async () => {
|
||||
// Mock the artifact input with a valid value
|
||||
component.artifact = {
|
||||
type: ArtifactType.CNAB,
|
||||
};
|
||||
component.getPullCommandForCNAB(component.artifact);
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const modal =
|
||||
fixture.nativeElement.querySelector(`#pullCommandForCNAB`);
|
||||
expect(modal).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -100,14 +100,18 @@ export class PullCommandComponent {
|
|||
}
|
||||
|
||||
getPullCommandForChart(artifact: Artifact): string {
|
||||
return getPullCommandByTag(
|
||||
artifact.type,
|
||||
`${this.registryUrl ? this.registryUrl : location.hostname}/${
|
||||
this.projectName
|
||||
}/${this.repoName}`,
|
||||
artifact.tags[0].name,
|
||||
Clients.CHART
|
||||
);
|
||||
if (artifact.tagNumber > 0) {
|
||||
return getPullCommandByTag(
|
||||
artifact.type,
|
||||
`${this.registryUrl ? this.registryUrl : location.hostname}/${
|
||||
this.projectName
|
||||
}/${this.repoName}`,
|
||||
artifact.tags[0].name,
|
||||
Clients.CHART
|
||||
);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// For tagMode
|
||||
|
|
|
@ -17,6 +17,7 @@ package handler
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"html/template"
|
||||
|
||||
"github.com/go-openapi/runtime/middleware"
|
||||
|
||||
|
@ -235,7 +236,7 @@ func (r *repositoryAPI) UpdateRepository(ctx context.Context, params operation.U
|
|||
if err := r.repoCtl.Update(ctx, &repomodel.RepoRecord{
|
||||
RepositoryID: repository.RepositoryID,
|
||||
Name: repository.Name,
|
||||
Description: params.Repository.Description,
|
||||
Description: template.HTMLEscapeString(params.Repository.Description),
|
||||
}, "Description"); err != nil {
|
||||
return r.SendError(ctx, err)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package security
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package artifact
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package blob
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package config
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package jobservice
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package proxy
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package purge
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package quota
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package replication
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package retention
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package robot
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package scan
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package scan
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package scandataexport
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package scanner
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package securityhub
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package systemartifact
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package user
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package webhook
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package cache
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package cache
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package config
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package orm
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package dao
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package accessory
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package dao
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package allowlist
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package artifact
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package artifactrash
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package dao
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package audit
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package dao
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package auditext
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package blob
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package redis
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package chart
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package distribution
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package dao
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package immutable
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package dao
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package joblog
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package jobmonitor
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package jobmonitor
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package jobmonitor
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package jobmonitor
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.51.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package jobmonitor
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue