diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 703cc8bb4c..13927228e2 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -145,7 +145,7 @@ jobs: run: ubuntu-24.04 targets: ci-go-ci-build-linux-static go_tags: GO_TAGS="-tags=opa_no_oci" - variant_name: opa_no_ci + variant_name: opa_no_oci arch: arm64 - os: windows run: ubuntu-24.04 diff --git a/Makefile b/Makefile index 993be5ece0..667b49c39c 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,12 @@ GOVERSION ?= $(shell cat ./.go-version) GOARCH := $(shell go env GOARCH) GOOS := $(shell go env GOOS) -GO_TAGS := -tags= +GO_TAGS ?= +CONDITIONAL_WASM_TAG := ifeq ($(WASM_ENABLED),1) -GO_TAGS = -tags=opa_wasm +CONDITIONAL_WASM_TAG := -tags=opa_wasm endif +override GO_TAGS := $(GO_TAGS) $(CONDITIONAL_WASM_TAG) GOLANGCI_LINT_VERSION := v2.6.2 YAML_LINT_VERSION := 0.29.0 @@ -261,6 +263,7 @@ CI_GOLANG_DOCKER_MAKE := $(DOCKER) run \ -w /src \ -e GOCACHE=/src/.go/cache \ -e GOARCH=$(GOARCH) \ + -e GO_TAGS="$(GO_TAGS)" \ -e CGO_ENABLED=$(CGO_ENABLED) \ -e WASM_ENABLED=$(WASM_ENABLED) \ -e FUZZ_TIME=$(FUZZ_TIME) \ diff --git a/download/oci_download_unavailable.go b/download/oci_download_unavailable.go deleted file mode 100644 index 5727804d28..0000000000 --- a/download/oci_download_unavailable.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build opa_no_oci - -package download - -import ( - "context" - - "github.com/open-policy-agent/opa/ast" - "github.com/open-policy-agent/opa/bundle" - "github.com/open-policy-agent/opa/plugins/rest" -) - -func NewOCI(Config, rest.Client, string, string) *OCIDownloader { - panic("built without OCI support") -} - -func (d *OCIDownloader) WithCallback(f func(context.Context, Update)) *OCIDownloader { - panic("built without OCI support") -} - -func (d *OCIDownloader) WithLogAttrs(map[string]any) *OCIDownloader { - panic("built without OCI support") -} - -func (d *OCIDownloader) WithBundleVerificationConfig(*bundle.VerificationConfig) *OCIDownloader { - panic("built without OCI support") -} - -func (d *OCIDownloader) WithSizeLimitBytes(int64) *OCIDownloader { - panic("built without OCI support") -} - -func (d *OCIDownloader) WithBundlePersistence(bool) *OCIDownloader { - panic("built without OCI support") -} - -func (d *OCIDownloader) ClearCache() { - panic("built without OCI support") -} - -func (d *OCIDownloader) SetCache(string) { - panic("built without OCI support") -} - -func (d *OCIDownloader) Trigger(context.Context) error { - panic("built without OCI support") -} - -func (d *OCIDownloader) Start(context.Context) { - panic("built without OCI support") -} - -func (d *OCIDownloader) Stop(context.Context) { - panic("built without OCI support") -} - -func (*OCIDownloader) WithBundleParserOpts(ast.ParserOptions) *OCIDownloader { - panic("built without OCI support") -} diff --git a/v1/download/oci_download_unavailable.go b/v1/download/oci_download_unavailable.go index f0bef46620..c33cfee83b 100644 --- a/v1/download/oci_download_unavailable.go +++ b/v1/download/oci_download_unavailable.go @@ -14,43 +14,43 @@ func NewOCI(Config, rest.Client, string, string) *OCIDownloader { panic("built without OCI support") } -func (d *OCIDownloader) WithCallback(f func(context.Context, Update)) *OCIDownloader { +func (*OCIDownloader) WithCallback(func(context.Context, Update) error) *OCIDownloader { panic("built without OCI support") } -func (d *OCIDownloader) WithLogAttrs(map[string]any) *OCIDownloader { +func (*OCIDownloader) WithLogAttrs(map[string]any) *OCIDownloader { panic("built without OCI support") } -func (d *OCIDownloader) WithBundleVerificationConfig(*bundle.VerificationConfig) *OCIDownloader { +func (*OCIDownloader) WithBundleVerificationConfig(*bundle.VerificationConfig) *OCIDownloader { panic("built without OCI support") } -func (d *OCIDownloader) WithSizeLimitBytes(int64) *OCIDownloader { +func (*OCIDownloader) WithSizeLimitBytes(int64) *OCIDownloader { panic("built without OCI support") } -func (d *OCIDownloader) WithBundlePersistence(bool) *OCIDownloader { +func (*OCIDownloader) WithBundlePersistence(bool) *OCIDownloader { panic("built without OCI support") } -func (d *OCIDownloader) ClearCache() { +func (*OCIDownloader) ClearCache() { panic("built without OCI support") } -func (d *OCIDownloader) SetCache(string) { +func (*OCIDownloader) SetCache(string) { panic("built without OCI support") } -func (d *OCIDownloader) Trigger(context.Context) error { +func (*OCIDownloader) Trigger(context.Context) error { panic("built without OCI support") } -func (d *OCIDownloader) Start(context.Context) { +func (*OCIDownloader) Start(context.Context) { panic("built without OCI support") } -func (d *OCIDownloader) Stop(context.Context) { +func (*OCIDownloader) Stop(context.Context) { panic("built without OCI support") }