diff --git a/.github/workflows/build-and-push-component.yaml b/.github/workflows/build-and-push-component.yaml index e583bf635a..098c66136a 100644 --- a/.github/workflows/build-and-push-component.yaml +++ b/.github/workflows/build-and-push-component.yaml @@ -96,6 +96,7 @@ jobs: VERSION: ${{ inputs.image_tag }} BUILD_TIMESTAMP: ${{ inputs.timestamp }} COMMIT_HASH: ${{ github.sha }} + BUILD_OPTS: -tags=exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper - name: Export digest if: inputs.push diff --git a/.golangci.yml b/.golangci.yml index 9aaa583714..3fbfb60853 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,8 @@ run: timeout: 20m + build-tags: + - exclude_graphdriver_btrfs + - exclude_graphdriver_devicemapper linters-settings: golint: diff --git a/Makefile b/Makefile index 9f19c68598..6b2eb21f21 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ DOCKER_TAG ?= $(VERSION) VMCLARITY_TOOLS_BASE ?= GO_VERSION ?= $(shell cat $(ROOT_DIR)/.go-version) GO_BUILD_TAGS ?= +GO_BUILD_TAGS += exclude_graphdriver_btrfs exclude_graphdriver_devicemapper #### ## Runtime variables @@ -59,9 +60,7 @@ build: ui build-all-go ## Build all components build-all-go: bin/vmclarity-apiserver bin/vmclarity-cli bin/vmclarity-orchestrator bin/vmclarity-ui-backend bin/vmclarity-cr-discovery-server ## Build all go components BUILD_OPTS = -race -ifneq ($(GO_BUILD_TAGS),) -BUILD_OPTS += -tags $(GO_BUILD_TAGS) -endif +BUILD_OPTS += -tags="$(GO_BUILD_TAGS)" LDFLAGS = -s -w LDFLAGS += -X 'github.com/openclarity/vmclarity/core/version.Version=$(VERSION)' @@ -207,6 +206,7 @@ lint-helm: ## Lint Helm charts docker run --rm --workdir /workdir --volume "$(ROOT_DIR):/workdir" quay.io/helmpack/chart-testing:v3.8.0 ct lint --all GOTEST_OPTS := -failfast -timeout 30m -short +GOTEST_OPTS += -tags="$(GO_BUILD_TAGS)" ifeq ($(CI),true) GOTEST_OPTS += -v endif @@ -219,10 +219,11 @@ $(TESTGOMODULES): .PHONY: test test: $(TESTGOMODULES) ## Run Go unit tests +GOVET_OPTS := -tags="$(GO_BUILD_TAGS)" VETGOMODULES = $(addprefix vet-, $(GOMODULES)) $(VETGOMODULES): - go -C $(@:vet-%=%) vet ./... + go -C $(@:vet-%=%) vet $(GOVET_OPTS) ./... .PHONY: vet vet: $(VETGOMODULES) ## Run go vet for modules