Merge pull request #7722 from cblecker/fix-docker

Fix containerized generation
This commit is contained in:
Kubernetes Prow Robot 2024-02-18 21:17:09 -08:00 committed by GitHub
commit 6de4559a39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
IMAGE_NAME=golang:1.18
export GOPROXY?=https://proxy.golang.org
CONTAINER_ENGINE?=$(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)
default: \
generate \
@ -10,19 +10,19 @@ reset-docs:
generate:
go run ./generator/app.go
generate-dockerized:
docker run --rm -e WHAT -e GOPROXY -v $(shell pwd):/go/src/app:Z $(IMAGE_NAME) make -C /go/src/app generate
generate-containerized:
$(CONTAINER_ENGINE) run --rm -e WHAT -v $(shell pwd):/go/src/app $(IMAGE_NAME) make -C /go/src/app generate
verify:
@hack/verify.sh
verify-dockerized:
docker run --rm -v $(shell pwd):/go/src/app:Z $(IMAGE_NAME) make -C /go/src/app verify
verify-containerized:
$(CONTAINER_ENGINE) run --rm -v $(shell pwd):/go/src/app $(IMAGE_NAME) make -C /go/src/app verify
test:
go test -v ./generator/...
test-dockerized:
docker run --rm -v $(shell pwd):/go/src/app:Z $(IMAGE_NAME) make -C /go/src/app test
test-containerized:
$(CONTAINER_ENGINE) run --rm -v $(shell pwd):/go/src/app $(IMAGE_NAME) make -C /go/src/app test
.PHONY: default reset-docs generate generate-dockerized verify test test-dockerized
.PHONY: default reset-docs generate generate-containerized verify verify-containerized test test-containerized

View File

@ -49,9 +49,9 @@ To (re)build documentation for all the SIGs in a go environment, run:
```bash
make generate
```
or to run this inside a docker container:
or to run this inside a container:
```bash
make generate-dockerized
make generate-containerized
```
To build docs for one SIG, run one of these commands:

View File

@ -32,7 +32,7 @@ fi
# Excluded check patterns are always skipped.
EXCLUDED_PATTERNS=(
"verify-all.sh" # this script calls the make rule and would cause a loop
"verify-*-dockerized.sh" # Don't run any scripts that intended to be run dockerized
"verify-*-containerized.sh" # Don't run any scripts that intended to be run containerized
)
EXCLUDED_CHECKS=$(ls ${EXCLUDED_PATTERNS[@]/#/${KUBE_ROOT}\/hack\/} 2>/dev/null || true)