Skip to content

Commit

Permalink
Change opa imports to use v1 module
Browse files Browse the repository at this point in the history
OPA v1.0 has for backwards compatility to help people migrate. So
all the deps except for cmd and internal are now under the v1
package.
  • Loading branch information
simonbaird committed Jan 17, 2025
1 parent d1b4fae commit fe5cd20
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cmd/inspect/inspect_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"

hd "github.com/MakeNowJust/heredoc"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/exp/slices"
Expand Down
2 changes: 1 addition & 1 deletion internal/documentation/asciidoc/rego/rego.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"text/template"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"

_ "github.com/enterprise-contract/ec-cli/internal/rego"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/evaluator/conftest_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"github.com/open-policy-agent/conftest/output"
conftest "github.com/open-policy-agent/conftest/policy"
"github.com/open-policy-agent/conftest/runner"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/storage"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/storage"
log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"k8s.io/apimachinery/pkg/util/sets"
Expand Down
2 changes: 1 addition & 1 deletion internal/evaluator/conftest_evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/MakeNowJust/heredoc"
ecc "github.com/enterprise-contract/enterprise-contract-controller/api/v1alpha1"
"github.com/gkampitakis/go-snaps/snaps"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions internal/opa/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"regexp"
"strings"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/ast/json"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/ast/json"
log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/opa/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"io"
"strings"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
"golang.org/x/exp/slices"

"github.com/enterprise-contract/ec-cli/internal/opa/rule"
Expand Down
2 changes: 1 addition & 1 deletion internal/opa/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"

hd "github.com/MakeNowJust/heredoc"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/opa/rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
"time"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
)

func title(a *ast.AnnotationsRef) string {
Expand Down
2 changes: 1 addition & 1 deletion internal/opa/rule/rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"testing"

"github.com/MakeNowJust/heredoc"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/stretchr/testify/assert"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/rego/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (

"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/topdown/builtins"
"github.com/open-policy-agent/opa/types"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/rego"
"github.com/open-policy-agent/opa/v1/topdown/builtins"
"github.com/open-policy-agent/opa/v1/types"
log "github.com/sirupsen/logrus"

"github.com/enterprise-contract/ec-cli/internal/fetchers/oci/files"
Expand Down
4 changes: 2 additions & 2 deletions internal/rego/oci/oci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
v1fake "github.com/google/go-containerregistry/pkg/v1/fake"
"github.com/google/go-containerregistry/pkg/v1/static"
"github.com/google/go-containerregistry/pkg/v1/types"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/rego"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

Expand Down
6 changes: 3 additions & 3 deletions internal/rego/purl/purl.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
package rego

import (
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/types"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/rego"
"github.com/open-policy-agent/opa/v1/types"
"github.com/package-url/packageurl-go"
log "github.com/sirupsen/logrus"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/rego/purl/purl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"context"
"testing"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/rego"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/rego/sigstore/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package sigstore

import (
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/types"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/types"

"github.com/enterprise-contract/ec-cli/internal/signature"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/rego/sigstore/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package sigstore
import (
"testing"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/stretchr/testify/require"

"github.com/enterprise-contract/ec-cli/internal/signature"
Expand Down
8 changes: 4 additions & 4 deletions internal/rego/sigstore/sigstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"fmt"

"github.com/google/go-containerregistry/pkg/name"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/topdown/builtins"
"github.com/open-policy-agent/opa/types"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/rego"
"github.com/open-policy-agent/opa/v1/topdown/builtins"
"github.com/open-policy-agent/opa/v1/types"
"github.com/sigstore/cosign/v2/pkg/cosign"
"github.com/sigstore/cosign/v2/pkg/oci"

Expand Down
4 changes: 2 additions & 2 deletions internal/rego/sigstore/sigstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/types"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/v1/ast"
"github.com/open-policy-agent/opa/v1/rego"
"github.com/sigstore/cosign/v2/pkg/cosign"
"github.com/sigstore/cosign/v2/pkg/oci"
"github.com/sigstore/cosign/v2/pkg/oci/static"
Expand Down

0 comments on commit fe5cd20

Please sign in to comment.