download: fix when compiling with tag opa_no_oci

The Makefile adjustments were needed to have the test compile actually work in CI.
Previously, it was just believed to work...

Fixes #8070.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
This commit is contained in:
Stephan Renatus
2025-12-05 11:11:15 +01:00
committed by Stephan Renatus
parent c71db71cec
commit ba6824774e
4 changed files with 16 additions and 72 deletions
+1 -1
View File
@@ -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
+5 -2
View File
@@ -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) \
-59
View File
@@ -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")
}
+10 -10
View File
@@ -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")
}