mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
cmd/build: don't package policy.wasm twice (#3011)
We had still been using the deprecated field, _and_ added a WasmModule to the bundle, leading to two bundle file entries. Fixes #3007. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
This commit is contained in:
+4
-6
@@ -18,15 +18,13 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/open-policy-agent/opa/format"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||
"github.com/open-policy-agent/opa/internal/merge"
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/format"
|
||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||
"github.com/open-policy-agent/opa/internal/merge"
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
)
|
||||
|
||||
|
||||
+2
-3
@@ -12,11 +12,10 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
"github.com/open-policy-agent/opa/compile"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
)
|
||||
|
||||
@@ -454,8 +454,6 @@ func (c *Compiler) compileWasm(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
c.bundle.Wasm = buf.Bytes()
|
||||
|
||||
modulePath := bundle.WasmFile
|
||||
|
||||
c.bundle.WasmModules = []bundle.WasmModuleFile{{
|
||||
|
||||
@@ -447,6 +447,10 @@ func TestCompilerWasmTarget(t *testing.T) {
|
||||
t.Fatal("expected to find compiled wasm module")
|
||||
}
|
||||
|
||||
if len(compiler.bundle.Wasm) != 0 {
|
||||
t.Error("expected NOT to find deprecated bundle `Wasm` value")
|
||||
}
|
||||
|
||||
ensureEntrypointRemoved(t, compiler.bundle, "test/p")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user