refact: Changes required for gorm v2 (#1528)

This commit is contained in:
Jim authored and GitHub committed 2021-09-30 08:47:34 -04:00
1 parent 0d74f8dbc9
commit 136ac00b49
118 files changed
+1127 -580

No files matched your search

@@ -32,7 +32,6 @@ import (
scopepb "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/scopes"
capoidc "github.com/hashicorp/cap/oidc"
wrapping "github.com/hashicorp/go-kms-wrapping"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/genproto/protobuf/field_mask"
@@ -42,6 +41,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
"gorm.io/gorm"
)
type setup struct {
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"sort"
"strings"
"testing"
@@ -827,6 +828,17 @@ func TestUpdate(t *testing.T) {
if tc.res != nil {
tc.res.Item.Version = version + 1
}
if tc.res != nil {
sort.Slice(tc.res.GetItem().HostIds, func(i, j int) bool {
return tc.res.GetItem().HostIds[i] < tc.res.GetItem().HostIds[j]
})
}
if got != nil && got.Item != nil {
sort.Slice(got.GetItem().HostIds, func(i, j int) bool {
return got.GetItem().HostIds[i] < got.GetItem().HostIds[j]
})
}
assert.Empty(cmp.Diff(got, tc.res, protocmp.Transform()), "UpdateHostSet(%q) got response %q, wanted %q", req, got, tc.res)
})
}
@@ -37,7 +37,6 @@ import (
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/scopes"
pb "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/targets"
wrapping "github.com/hashicorp/go-kms-wrapping"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/genproto/protobuf/field_mask"
@@ -48,6 +47,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
"gorm.io/gorm"
)
var testAuthorizedActions = []string{
+1 -1
View File
@@ -26,7 +26,7 @@ import (
wrapping "github.com/hashicorp/go-kms-wrapping"
"github.com/hashicorp/go-secure-stdlib/base62"
"github.com/hashicorp/go-secure-stdlib/strutil"
"github.com/jinzhu/gorm"
"gorm.io/gorm"
)
const (