|
|
@ -9,27 +9,26 @@ import (
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/internal/resource"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"google.golang.org/grpc/codes"
|
|
|
|
"google.golang.org/grpc/codes"
|
|
|
|
"google.golang.org/grpc/status"
|
|
|
|
"google.golang.org/grpc/status"
|
|
|
|
"google.golang.org/protobuf/testing/protocmp"
|
|
|
|
"google.golang.org/protobuf/testing/protocmp"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
svc "github.com/hashicorp/consul/agent/grpc-external/services/resource"
|
|
|
|
svc "github.com/hashicorp/consul/agent/grpc-external/services/resource"
|
|
|
|
svctest "github.com/hashicorp/consul/agent/grpc-external/services/resource/testing"
|
|
|
|
svctest "github.com/hashicorp/consul/agent/grpc-external/services/resource/testing"
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/internal/catalog/internal/controllers/nodehealth"
|
|
|
|
"github.com/hashicorp/consul/internal/catalog/internal/controllers/nodehealth"
|
|
|
|
"github.com/hashicorp/consul/internal/catalog/internal/mappers/nodemapper"
|
|
|
|
"github.com/hashicorp/consul/internal/catalog/internal/mappers/nodemapper"
|
|
|
|
"github.com/hashicorp/consul/internal/catalog/internal/types"
|
|
|
|
"github.com/hashicorp/consul/internal/catalog/internal/types"
|
|
|
|
"github.com/hashicorp/consul/internal/controller"
|
|
|
|
"github.com/hashicorp/consul/internal/controller"
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/internal/resource"
|
|
|
|
"github.com/hashicorp/consul/internal/resource/resourcetest"
|
|
|
|
"github.com/hashicorp/consul/internal/resource/resourcetest"
|
|
|
|
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
|
|
|
|
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
|
|
|
|
"github.com/hashicorp/consul/proto-public/pbresource"
|
|
|
|
"github.com/hashicorp/consul/proto-public/pbresource"
|
|
|
|
"github.com/hashicorp/consul/proto/private/prototest"
|
|
|
|
"github.com/hashicorp/consul/proto/private/prototest"
|
|
|
|
"github.com/hashicorp/consul/sdk/testutil"
|
|
|
|
"github.com/hashicorp/consul/sdk/testutil"
|
|
|
|
"github.com/hashicorp/consul/sdk/testutil/retry"
|
|
|
|
"github.com/hashicorp/consul/sdk/testutil/retry"
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/version/versiontest"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
@ -104,7 +103,7 @@ func (suite *controllerSuite) SetupTest() {
|
|
|
|
|
|
|
|
|
|
|
|
suite.client = svctest.RunResourceServiceWithConfig(suite.T(), svc.Config{TenancyBridge: mockTenancyBridge}, types.Register)
|
|
|
|
suite.client = svctest.RunResourceServiceWithConfig(suite.T(), svc.Config{TenancyBridge: mockTenancyBridge}, types.Register)
|
|
|
|
suite.runtime = controller.Runtime{Client: suite.client, Logger: testutil.Logger(suite.T())}
|
|
|
|
suite.runtime = controller.Runtime{Client: suite.client, Logger: testutil.Logger(suite.T())}
|
|
|
|
suite.isEnterprise = (structs.NodeEnterpriseMetaInDefaultPartition().PartitionOrEmpty() == "default")
|
|
|
|
suite.isEnterprise = versiontest.IsEnterprise()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// injectNodeWithStatus is a helper method to write a Node resource and synthesize its status
|
|
|
|
// injectNodeWithStatus is a helper method to write a Node resource and synthesize its status
|
|
|
|