From e510df7c2272381c45f5409508e91c3328a45e7d Mon Sep 17 00:00:00 2001 From: Alexei Dodon Date: Tue, 15 Aug 2023 23:07:56 +0300 Subject: [PATCH] fix: swagger Makefile target broken on darwin (#1701) Signed-off-by: Alexei Dodon --- .github/workflows/ci-cd.yml | 4 ++-- Makefile | 12 +++++------- pkg/api/routes.go | 2 +- swagger/docs.go | 2 +- swagger/swagger.json | 2 +- swagger/swagger.yaml | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index db1d12028..7364d725f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -66,7 +66,7 @@ jobs: - name: Install other dependencies run: | cd $GITHUB_WORKSPACE - go install github.com/swaggo/swag/cmd/swag@v1.6.3 + go install github.com/swaggo/swag/cmd/swag@v1.8.12 sudo apt-get update sudo apt-get install rpm sudo apt-get install snapd @@ -77,7 +77,7 @@ jobs: sudo cp bin/skopeo /usr/bin && \ rm -rf $GITHUB_WORKSPACE/src/github.com/containers/skopeo cd $GITHUB_WORKSPACE - curl -Lo notation.tar.gz https://github.com/notaryproject/notation/releases/download/v0.7.1-alpha.1/notation_0.7.1-alpha.1_linux_amd64.tar.gz + curl -Lo notation.tar.gz https://github.com/notaryproject/notation/releases/download/v1.0.0-rc.4/notation_1.0.0-rc.4_linux_amd64.tar.gz sudo tar xvzf notation.tar.gz -C /usr/bin notation rm -f notation.tar.gz go install github.com/wadey/gocovmerge@latest diff --git a/Makefile b/Makefile index 8f3d2fc28..387cb4c08 100644 --- a/Makefile +++ b/Makefile @@ -216,13 +216,11 @@ check: ./golangcilint.yaml $(GOLINTER) $(GOLINTER) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags stress,$(BUILD_LABELS),containers_image_openpgp ./... rm pkg/extensions/build/.empty -swagger/docs.go: +.PHONY: swagger +swagger: swag -v || go install github.com/swaggo/swag/cmd/swag@$(SWAGGER_VERSION) swag init --parseDependency -o swagger -g pkg/api/routes.go -q -.PHONY: swagger -swagger: swagger/docs.go pkg/api/routes.go - .PHONY: update-licenses update-licenses: @echo "Detecting and updating licenses ... please be patient!" @@ -274,7 +272,7 @@ verify-config: _verify-config verify-config-warnings verify-config-commited .PHONY: _verify-config _verify-config: binary - rm -f output.txt + rm -f output.txt $(foreach file, $(wildcard examples/config-*), ./bin/zot-$(OS)-$(ARCH) verify $(file) 2>&1 | tee -a output.txt || exit 1;) .PHONY: verify-config-warnings @@ -318,7 +316,7 @@ binary-container: .PHONY: run-container run-container: ${CONTAINER_RUNTIME} run --rm --security-opt label=disable -v $$(pwd):/go/src/github.com/project-zot/zot \ - zot-build:latest + zot-build:latest .PHONY: binary-stacker binary-stacker: $(STACKER) @@ -396,7 +394,7 @@ test-bats-sync: binary binary-minimal bench check-skopeo $(BATS) $(NOTATION) $(C $(BATS) --trace --print-output-on-failure test/blackbox/sync.bats $(BATS) --trace --print-output-on-failure test/blackbox/sync_docker.bats $(BATS) --trace --print-output-on-failure test/blackbox/sync_replica_cluster.bats - + .PHONY: test-bats-sync-verbose test-bats-sync-verbose: BUILD_LABELS=sync test-bats-sync-verbose: binary binary-minimal bench check-skopeo $(BATS) $(NOTATION) $(COSIGN) diff --git a/pkg/api/routes.go b/pkg/api/routes.go index fe7ed7a59..4f9558567 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -401,7 +401,7 @@ func (rh *RouteHandler) ListTags(response http.ResponseWriter, request *http.Req // @Param name path string true "repository name" // @Param reference path string true "image reference or digest" // @Success 200 {string} string "ok" -// @Header 200 {object} cosntants.DistContentDigestKey +// @Header 200 {object} constants.DistContentDigestKey // @Failure 404 {string} string "not found" // @Failure 500 {string} string "internal server error". func (rh *RouteHandler) CheckManifest(response http.ResponseWriter, request *http.Request) { diff --git a/swagger/docs.go b/swagger/docs.go index ff8e29493..cb96d84f6 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -1005,7 +1005,7 @@ const docTemplate = `{ "type": "string" }, "headers": { - "cosntants.DistContentDigestKey": { + "constants.DistContentDigestKey": { "type": "object" } } diff --git a/swagger/swagger.json b/swagger/swagger.json index 489936359..a15a74436 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -996,7 +996,7 @@ "type": "string" }, "headers": { - "cosntants.DistContentDigestKey": { + "constants.DistContentDigestKey": { "type": "object" } } diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index cb0f2dfa8..2affb4db7 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -858,7 +858,7 @@ paths: "200": description: ok headers: - cosntants.DistContentDigestKey: + constants.DistContentDigestKey: type: object schema: type: string