diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8da1bc6..227708a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,8 @@ jobs: - uses: actions/checkout@v2 - name: Run test container run: make test-container "CEPH_VERSION=${{ matrix.ceph_version }}" "RESULTS_DIR=$PWD/_results" + - name: Run ptrguard test container + run: make test-container "USE_PTRGUARD=true" "CEPH_VERSION=${{ matrix.ceph_version }}" "RESULTS_DIR=$PWD/_results" - name: Archive coverage results uses: actions/upload-artifact@v2 with: diff --git a/Makefile b/Makefile index 9f0affa..6932633 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ CEPH_VERSION := nautilus RESULTS_DIR := CHECK_GOFMT_FLAGS := -e -s -l IMPLEMENTS_OPTS := +BUILD_TAGS := $(CEPH_VERSION) ifeq ($(CONTAINER_CMD),) CONTAINER_CMD:=$(shell docker version >/dev/null 2>&1 && echo docker) @@ -21,6 +22,11 @@ BUILDFILE=.build.$(CEPH_VERSION) # the name of the image plus ceph version as tag CI_IMAGE_TAG=$(CI_IMAGE_NAME):$(CEPH_VERSION) +ifneq ($(USE_PTRGUARD),) + CONTAINER_OPTS += -e USE_PTRGUARD=true + BUILD_TAGS := $(BUILD_TAGS),ptrguard +endif + SELINUX := $(shell getenforce 2>/dev/null) ifeq ($(SELINUX),Enforcing) VOLUME_FLAGS = :z @@ -31,11 +37,11 @@ ifdef RESULTS_DIR endif build: - go build -v -tags $(CEPH_VERSION) $(shell go list ./... | grep -v /contrib) + go build -v -tags $(BUILD_TAGS) $(shell go list ./... | grep -v /contrib) fmt: go fmt ./... test: - go test -v -tags $(CEPH_VERSION) ./... + go test -v -tags $(BUILD_TAGS) ./... .PHONY: test-docker test-container test-docker: test-container @@ -78,7 +84,7 @@ test-binaries: \ test-bins: test-binaries %.test: % force_go_build - go test -c -tags $(CEPH_VERSION) ./$< + go test -c -tags $(BUILD_TAGS) ./$< implements: go build -o implements ./contrib/implements diff --git a/entrypoint.sh b/entrypoint.sh index b9b42c1..82b5e4a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -94,7 +94,15 @@ while true ; do done if [ -n "${CEPH_VERSION}" ]; then - BUILD_TAGS="-tags ${CEPH_VERSION}" + BUILD_TAGS="${CEPH_VERSION}" +fi + +if [ -n "${USE_PTRGUARD}" ]; then + BUILD_TAGS+=",ptrguard" +fi + +if [ -n "${BUILD_TAGS}" ]; then + BUILD_TAGS="-tags ${BUILD_TAGS}" fi show() {