catalog,mesh,auth: Bump versions to v2beta1 (#18930)

This commit is contained in:
Iryna Shustava 2023-09-22 10:51:15 -06:00 committed by GitHub
parent de231bbbdd
commit d88888ee8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
362 changed files with 18649 additions and 12875 deletions

View File

@ -83,7 +83,7 @@ import (
"github.com/hashicorp/consul/lib/routine"
"github.com/hashicorp/consul/lib/stringslice"
"github.com/hashicorp/consul/logging"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/pbsubscribe"
"github.com/hashicorp/consul/tlsutil"

View File

@ -17,8 +17,8 @@ import (
"github.com/hashicorp/consul/internal/catalog"
"github.com/hashicorp/consul/internal/mesh"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/acl"

View File

@ -20,8 +20,8 @@ import (
"github.com/hashicorp/consul/internal/mesh"
"github.com/hashicorp/consul/internal/resource"
"github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"

View File

@ -11,7 +11,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/lib"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
)
const (

View File

@ -10,7 +10,7 @@ import (
envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
envoy_fileaccesslog_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3"
envoy_streamaccesslog_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/structpb"

View File

@ -23,7 +23,7 @@ import (
"github.com/hashicorp/consul/agent/xds/naming"
"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"github.com/hashicorp/consul/proto/private/pbpeering"
)

View File

@ -12,8 +12,8 @@ import (
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/agent/xds/configfetcher"
proxytracker "github.com/hashicorp/consul/internal/mesh/proxy-tracker"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
)
// Converter converts a single snapshot into a ProxyState.

View File

@ -12,7 +12,7 @@ import (
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"github.com/hashicorp/go-bexpr"
"google.golang.org/protobuf/types/known/wrapperspb"

View File

@ -10,7 +10,7 @@ import (
"github.com/hashicorp/consul/agent/proxycfg"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
)
type discoChainTargets struct {

View File

@ -27,7 +27,7 @@ import (
"github.com/hashicorp/consul/agent/xds/naming"
"github.com/hashicorp/consul/agent/xds/platform"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"github.com/hashicorp/consul/sdk/iptables"
"github.com/hashicorp/consul/types"
)

View File

@ -6,7 +6,7 @@ package proxystateconverter
import (
"errors"
"fmt"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"sort"
"strings"
"time"

View File

@ -20,7 +20,7 @@ import (
"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/agent/xdsv2"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"github.com/hashicorp/consul/proto/private/pbpeering"
)

View File

@ -16,7 +16,7 @@ import (
"google.golang.org/protobuf/types/known/anypb"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
)
func (pr *ProxyResources) doesEnvoyClusterAlreadyExist(name string) bool {

View File

@ -8,7 +8,7 @@ import (
envoy_endpoint_v3 "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3"
"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
"google.golang.org/protobuf/proto"
)

View File

@ -30,7 +30,7 @@ import (
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/lib"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
)
const (

View File

@ -13,7 +13,7 @@ import (
envoy_matcher_v3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
)
const (

View File

@ -15,7 +15,7 @@ import (
"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
proxytracker "github.com/hashicorp/consul/internal/mesh/proxy-tracker"
meshv1alpha1 "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
meshv2beta1 "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"github.com/hashicorp/consul/sdk/testutil"
"github.com/stretchr/testify/require"
@ -89,10 +89,10 @@ func protoToJSON(t *testing.T, pb proto.Message) string {
return string(gotJSON)
}
func jsonToProxyTemplate(t *testing.T, json []byte) *meshv1alpha1.ProxyStateTemplate {
func jsonToProxyTemplate(t *testing.T, json []byte) *meshv2beta1.ProxyStateTemplate {
t.Helper()
um := protojson.UnmarshalOptions{}
proxyTemplate := &meshv1alpha1.ProxyStateTemplate{}
proxyTemplate := &meshv2beta1.ProxyStateTemplate{}
err := um.Unmarshal(json, proxyTemplate)
require.NoError(t, err)
return proxyTemplate

View File

@ -13,7 +13,7 @@ import (
"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
"github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1/pbproxystate"
"github.com/hashicorp/consul/proto-public/pbmesh/v2beta1/pbproxystate"
envoy_route_v3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
"google.golang.org/protobuf/proto"

View File

@ -7,10 +7,11 @@ import (
"errors"
"testing"
"github.com/hashicorp/consul/agent"
"github.com/hashicorp/consul/testrpc"
"github.com/mitchellh/cli"
"github.com/stretchr/testify/require"
"github.com/hashicorp/consul/agent"
"github.com/hashicorp/consul/testrpc"
)
func TestResourceApplyCommand(t *testing.T) {
@ -36,7 +37,7 @@ func TestResourceApplyCommand(t *testing.T) {
{
name: "nested data format",
args: []string{"-f=../testdata/nested_data.hcl"},
output: "mesh.v1alpha1.Upstreams 'api' created.",
output: "mesh.v2beta1.Upstreams 'api' created.",
},
}

View File

@ -147,12 +147,12 @@ But you could only use one of the approaches.
Example:
$ consul resource delete catalog.v1alpha1.Service card-processor -partition=billing -namespace=payments -peer=eu
$ consul resource delete catalog.v2beta1.Service card-processor -partition=billing -namespace=payments -peer=eu
$ consul resource delete -f resource.hcl
In resource.hcl, it could be:
ID {
Type = gvk("catalog.v1alpha1.Service")
Type = gvk("catalog.v2beta1.Service")
Name = "card-processor"
Tenancy {
Namespace = "payments"

View File

@ -175,7 +175,7 @@ and outputs in JSON format.
Example:
$ consul resource list catalog.v1alpha1.Service card-processor -partition=billing -namespace=payments -peer=eu
$ consul resource list catalog.v2beta1.Service card-processor -partition=billing -namespace=payments -peer=eu
$ consul resource list -f=demo.hcl

View File

@ -157,12 +157,12 @@ But you could only use one of the approaches.
Example:
$ consul resource read catalog.v1alpha1.Service card-processor -partition=billing -namespace=payments -peer=eu
$ consul resource read catalog.v2beta1.Service card-processor -partition=billing -namespace=payments -peer=eu
$ consul resource read -f resource.hcl
In resource.hcl, it could be:
ID {
Type = gvk("catalog.v1alpha1.Service")
Type = gvk("catalog.v2beta1.Service")
Name = "card-processor"
Tenancy {
Namespace = "payments"

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: BUSL-1.1
ID {
Type = gvk("mesh.v1alpha1.Upstreams")
Type = gvk("mesh.v2beta1.Upstreams")
Name = "api"
}
@ -14,7 +14,7 @@ Data {
Upstreams = [
{
DestinationRef = {
Type = gvk("catalog.v1alpha1.Service")
Type = gvk("catalog.v2beta1.Service")
Name = "db"
}

View File

@ -11,9 +11,9 @@ import (
var (
// API Group Information
APIGroup = types.GroupName
VersionV1Alpha1 = types.VersionV1Alpha1
CurrentVersion = types.CurrentVersion
APIGroup = types.GroupName
VersionV2Beta1 = types.VersionV2Beta1
CurrentVersion = types.CurrentVersion
// Resource Kind Names.
@ -21,11 +21,11 @@ var (
TrafficPermissions = types.TrafficPermissionsKind
ComputedTrafficPermissions = types.ComputedTrafficPermissionsKind
// Resource Types for the v1alpha1 version.
// Resource Types for the v2beta1 version.
WorkloadIdentityV1Alpha1Type = types.WorkloadIdentityV1Alpha1Type
TrafficPermissionsV1Alpha1Type = types.TrafficPermissionsV1Alpha1Type
ComputedTrafficPermissionsV1Alpha1Type = types.ComputedTrafficPermissionsV1Alpha1Type
WorkloadIdentityV2Beta1Type = types.WorkloadIdentityV2Beta1Type
TrafficPermissionsV2Beta1Type = types.TrafficPermissionsV2Beta1Type
ComputedTrafficPermissionsV2Beta1Type = types.ComputedTrafficPermissionsV2Beta1Type
// Resource Types for the latest version.

View File

@ -5,7 +5,7 @@ package types
import (
"github.com/hashicorp/consul/internal/resource"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v1alpha1"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)
@ -14,18 +14,18 @@ const (
)
var (
ComputedTrafficPermissionsV1Alpha1Type = &pbresource.Type{
ComputedTrafficPermissionsV2Beta1Type = &pbresource.Type{
Group: GroupName,
GroupVersion: VersionV1Alpha1,
GroupVersion: VersionV2Beta1,
Kind: ComputedTrafficPermissionsKind,
}
ComputedTrafficPermissionsType = ComputedTrafficPermissionsV1Alpha1Type
ComputedTrafficPermissionsType = ComputedTrafficPermissionsV2Beta1Type
)
func RegisterComputedTrafficPermission(r resource.Registry) {
r.Register(resource.Registration{
Type: ComputedTrafficPermissionsV1Alpha1Type,
Type: ComputedTrafficPermissionsV2Beta1Type,
Proto: &pbauth.ComputedTrafficPermissions{},
Scope: resource.ScopeNamespace,
Validate: nil,

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/consul/internal/resource"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v1alpha1"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)
@ -16,18 +16,18 @@ const (
)
var (
TrafficPermissionsV1Alpha1Type = &pbresource.Type{
TrafficPermissionsV2Beta1Type = &pbresource.Type{
Group: GroupName,
GroupVersion: VersionV1Alpha1,
GroupVersion: VersionV2Beta1,
Kind: TrafficPermissionsKind,
}
TrafficPermissionsType = TrafficPermissionsV1Alpha1Type
TrafficPermissionsType = TrafficPermissionsV2Beta1Type
)
func RegisterTrafficPermissions(r resource.Registry) {
r.Register(resource.Registration{
Type: TrafficPermissionsV1Alpha1Type,
Type: TrafficPermissionsV2Beta1Type,
Proto: &pbauth.TrafficPermissions{},
Scope: resource.ScopeNamespace,
Validate: ValidateTrafficPermissions,

View File

@ -11,7 +11,7 @@ import (
"google.golang.org/protobuf/types/known/anypb"
"github.com/hashicorp/consul/internal/resource"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v1alpha1"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

View File

@ -8,9 +8,9 @@ import (
)
const (
GroupName = "auth"
VersionV1Alpha1 = "v1alpha1"
CurrentVersion = VersionV1Alpha1
GroupName = "auth"
VersionV2Beta1 = "v2beta1"
CurrentVersion = VersionV2Beta1
)
func Register(r resource.Registry) {

View File

@ -5,7 +5,7 @@ package types
import (
"github.com/hashicorp/consul/internal/resource"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v1alpha1"
pbauth "github.com/hashicorp/consul/proto-public/pbauth/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)
@ -14,18 +14,18 @@ const (
)
var (
WorkloadIdentityV1Alpha1Type = &pbresource.Type{
WorkloadIdentityV2Beta1Type = &pbresource.Type{
Group: GroupName,
GroupVersion: VersionV1Alpha1,
GroupVersion: VersionV2Beta1,
Kind: WorkloadIdentityKind,
}
WorkloadIdentityType = WorkloadIdentityV1Alpha1Type
WorkloadIdentityType = WorkloadIdentityV2Beta1Type
)
func RegisterWorkloadIdentity(r resource.Registry) {
r.Register(resource.Registration{
Type: WorkloadIdentityV1Alpha1Type,
Type: WorkloadIdentityV2Beta1Type,
Proto: &pbauth.WorkloadIdentity{},
Scope: resource.ScopeNamespace,
Validate: nil,

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Service"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Service",
"@type": "hashicorp.consul.catalog.v2beta1.Service",
"workloads": {
"prefixes": [
"api-"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-1"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-1"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.1"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-10"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-10"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.10"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-11"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-11"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.11"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-12"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-12"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.12"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-13"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-13"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.13"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-14"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-14"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.14"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-15"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-15"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.15"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-16"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-16"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.16"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-17"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-17"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.17"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-18"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-18"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.18"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-19"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-19"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.19"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-2"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-2"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.2"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-20"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-20"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.20"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-3"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-3"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.3"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-4"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-4"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.4"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-5"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-5"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.5"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-6"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-6"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.6"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-7"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-7"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.7"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-8"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-8"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.8"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "api-9"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Workload"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "api-9"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"@type": "hashicorp.consul.catalog.v2beta1.Workload",
"addresses": [
{
"host": "172.16.1.9"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "ServiceEndpoints"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Service"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "foo"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.ServiceEndpoints",
"@type": "hashicorp.consul.catalog.v2beta1.ServiceEndpoints",
"endpoints": [
{
"addresses": [

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Service"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "foo"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Service",
"@type": "hashicorp.consul.catalog.v2beta1.Service",
"ports": [
{
"target_port": "external-service-port",

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Service"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "grpc-api"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Service",
"@type": "hashicorp.consul.catalog.v2beta1.Service",
"workloads": {
"names": [
"api-1",

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Service"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "http-api"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Service",
"@type": "hashicorp.consul.catalog.v2beta1.Service",
"workloads": {
"prefixes": [
"api-1"

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "node-1"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "node-1"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Node",
"@type": "hashicorp.consul.catalog.v2beta1.Node",
"addresses": [
{
"host": "198.18.1.1",

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "node-2"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "node-2"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Node",
"@type": "hashicorp.consul.catalog.v2beta1.Node",
"addresses": [
{
"host": "198.18.1.2",

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "node-3"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "node-3"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Node",
"@type": "hashicorp.consul.catalog.v2beta1.Node",
"addresses": [
{
"host": "198.18.1.3",

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "HealthStatus"
},
"tenancy": {
@ -15,7 +15,7 @@
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -26,7 +26,7 @@
"name": "node-4"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"@type": "hashicorp.consul.catalog.v2beta1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}

View File

@ -2,7 +2,7 @@
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"group_version": "v2beta1",
"kind": "Node"
},
"tenancy": {
@ -13,7 +13,7 @@
"name": "node-4"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Node",
"@type": "hashicorp.consul.catalog.v2beta1.Node",
"addresses": [
{
"host": "198.18.1.4",

View File

@ -43,5 +43,5 @@ func TestControllers_Integration(t *testing.T) {
func TestControllers_Lifecycle(t *testing.T) {
client := runInMemResourceServiceAndControllers(t, catalog.DefaultControllerDependencies())
RunCatalogV1Alpha1LifecycleIntegrationTest(t, client)
RunCatalogV2Beta1LifecycleIntegrationTest(t, client)
}

View File

@ -17,7 +17,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/resource"
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"
"github.com/hashicorp/consul/sdk/testutil"
@ -43,91 +43,91 @@ var (
func RunCatalogV1Alpha1IntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
t.Helper()
PublishCatalogV1Alpha1IntegrationTestData(t, client)
VerifyCatalogV1Alpha1IntegrationTestResults(t, client)
PublishCatalogV2Beta1IntegrationTestData(t, client)
VerifyCatalogV2Beta1IntegrationTestResults(t, client)
}
// PublishCatalogV1Alpha1IntegrationTestData will perform a whole bunch of resource writes
// PublishCatalogV2Beta1IntegrationTestData will perform a whole bunch of resource writes
// for Service, ServiceEndpoints, Workload, Node and HealthStatus objects
func PublishCatalogV1Alpha1IntegrationTestData(t *testing.T, client pbresource.ResourceServiceClient) {
func PublishCatalogV2Beta1IntegrationTestData(t *testing.T, client pbresource.ResourceServiceClient) {
t.Helper()
c := rtest.NewClient(client)
resources := rtest.ParseResourcesFromFilesystem(t, testData, "integration_test_data/v1alpha1")
resources := rtest.ParseResourcesFromFilesystem(t, testData, "integration_test_data/v2beta1")
c.PublishResources(t, resources)
}
func VerifyCatalogV1Alpha1IntegrationTestResults(t *testing.T, client pbresource.ResourceServiceClient) {
func VerifyCatalogV2Beta1IntegrationTestResults(t *testing.T, client pbresource.ResourceServiceClient) {
t.Helper()
c := rtest.NewClient(client)
testutil.RunStep(t, "resources-exist", func(t *testing.T) {
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "api").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "http-api").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "grpc-api").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "foo").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV2Beta1Type, "api").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV2Beta1Type, "http-api").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV2Beta1Type, "grpc-api").ID())
c.RequireResourceExists(t, rtest.Resource(catalog.ServiceV2Beta1Type, "foo").ID())
for i := 1; i < 5; i++ {
nodeId := rtest.Resource(catalog.NodeV1Alpha1Type, fmt.Sprintf("node-%d", i)).WithTenancy(resource.DefaultNamespacedTenancy()).ID()
nodeId := rtest.Resource(catalog.NodeV2Beta1Type, fmt.Sprintf("node-%d", i)).WithTenancy(resource.DefaultNamespacedTenancy()).ID()
c.RequireResourceExists(t, nodeId)
res := c.RequireResourceExists(t, rtest.Resource(catalog.HealthStatusV1Alpha1Type, fmt.Sprintf("node-%d-health", i)).ID())
res := c.RequireResourceExists(t, rtest.Resource(catalog.HealthStatusV2Beta1Type, fmt.Sprintf("node-%d-health", i)).ID())
rtest.RequireOwner(t, res, nodeId, true)
}
for i := 1; i < 21; i++ {
workloadId := rtest.Resource(catalog.WorkloadV1Alpha1Type, fmt.Sprintf("api-%d", i)).WithTenancy(resource.DefaultNamespacedTenancy()).ID()
workloadId := rtest.Resource(catalog.WorkloadV2Beta1Type, fmt.Sprintf("api-%d", i)).WithTenancy(resource.DefaultNamespacedTenancy()).ID()
c.RequireResourceExists(t, workloadId)
res := c.RequireResourceExists(t, rtest.Resource(catalog.HealthStatusV1Alpha1Type, fmt.Sprintf("api-%d-health", i)).ID())
res := c.RequireResourceExists(t, rtest.Resource(catalog.HealthStatusV2Beta1Type, fmt.Sprintf("api-%d-health", i)).ID())
rtest.RequireOwner(t, res, workloadId, true)
}
})
testutil.RunStep(t, "node-health-reconciliation", func(t *testing.T) {
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV1Alpha1Type, "node-1").ID(), nodehealth.StatusKey, nodehealth.ConditionPassing)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV1Alpha1Type, "node-2").ID(), nodehealth.StatusKey, nodehealth.ConditionWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV1Alpha1Type, "node-3").ID(), nodehealth.StatusKey, nodehealth.ConditionCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV1Alpha1Type, "node-4").ID(), nodehealth.StatusKey, nodehealth.ConditionMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV2Beta1Type, "node-1").ID(), nodehealth.StatusKey, nodehealth.ConditionPassing)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV2Beta1Type, "node-2").ID(), nodehealth.StatusKey, nodehealth.ConditionWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV2Beta1Type, "node-3").ID(), nodehealth.StatusKey, nodehealth.ConditionCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.NodeV2Beta1Type, "node-4").ID(), nodehealth.StatusKey, nodehealth.ConditionMaintenance)
})
testutil.RunStep(t, "workload-health-reconciliation", func(t *testing.T) {
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-1").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadPassing)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-2").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-3").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-4").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-5").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-6").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-7").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-8").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-9").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-10").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-11").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-12").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-13").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-14").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-15").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-16").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-17").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadPassing)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-18").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-19").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-20").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-1").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadPassing)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-2").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-3").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-4").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-5").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-6").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-7").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-8").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-9").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-10").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-11").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-12").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-13").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-14").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-15").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-16").ID(), workloadhealth.StatusKey, workloadhealth.ConditionNodeAndWorkloadMaintenance)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-17").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadPassing)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-18").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadWarning)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-19").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadCritical)
c.WaitForStatusCondition(t, rtest.Resource(catalog.WorkloadV2Beta1Type, "api-20").ID(), workloadhealth.StatusKey, workloadhealth.ConditionWorkloadMaintenance)
})
testutil.RunStep(t, "service-reconciliation", func(t *testing.T) {
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "foo").ID(), endpoints.StatusKey, endpoints.ConditionUnmanaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "api").ID(), endpoints.StatusKey, endpoints.ConditionManaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "http-api").ID(), endpoints.StatusKey, endpoints.ConditionManaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV1Alpha1Type, "grpc-api").ID(), endpoints.StatusKey, endpoints.ConditionManaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV2Beta1Type, "foo").ID(), endpoints.StatusKey, endpoints.ConditionUnmanaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV2Beta1Type, "api").ID(), endpoints.StatusKey, endpoints.ConditionManaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV2Beta1Type, "http-api").ID(), endpoints.StatusKey, endpoints.ConditionManaged)
c.WaitForStatusCondition(t, rtest.Resource(catalog.ServiceV2Beta1Type, "grpc-api").ID(), endpoints.StatusKey, endpoints.ConditionManaged)
})
testutil.RunStep(t, "service-endpoints-generation", func(t *testing.T) {
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV1Alpha1Type, "foo").ID(), expectedFooServiceEndpoints())
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV1Alpha1Type, "api").ID(), expectedApiServiceEndpoints(t, c))
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV1Alpha1Type, "http-api").ID(), expectedHTTPApiServiceEndpoints(t, c))
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV1Alpha1Type, "grpc-api").ID(), expectedGRPCApiServiceEndpoints(t, c))
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV2Beta1Type, "foo").ID(), expectedFooServiceEndpoints())
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV2Beta1Type, "api").ID(), expectedApiServiceEndpoints(t, c))
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV2Beta1Type, "http-api").ID(), expectedHTTPApiServiceEndpoints(t, c))
verifyServiceEndpoints(t, c, rtest.Resource(catalog.ServiceEndpointsV2Beta1Type, "grpc-api").ID(), expectedGRPCApiServiceEndpoints(t, c))
})
}
@ -155,7 +155,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
Endpoints: []*pbcatalog.Endpoint{
// api-1
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-1").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-1").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.1", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.1", External: true, Ports: []string{"mesh"}},
@ -170,7 +170,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-2
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-2").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-2").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.2", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.2", External: true, Ports: []string{"mesh"}},
@ -185,7 +185,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-3
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-3").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-3").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.3", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.3", External: true, Ports: []string{"mesh"}},
@ -200,7 +200,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-4
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-4").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-4").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.4", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.4", External: true, Ports: []string{"mesh"}},
@ -215,7 +215,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-5
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-5").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-5").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.5", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.5", External: true, Ports: []string{"mesh"}},
@ -230,7 +230,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-6
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-6").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-6").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.6", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.6", External: true, Ports: []string{"mesh"}},
@ -245,7 +245,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-7
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-7").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-7").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.7", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.7", External: true, Ports: []string{"mesh"}},
@ -260,7 +260,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-8
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-8").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-8").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.8", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.8", External: true, Ports: []string{"mesh"}},
@ -275,7 +275,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-9
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-9").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-9").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.9", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.9", External: true, Ports: []string{"mesh"}},
@ -290,7 +290,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-10
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-10").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-10").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.10", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.10", External: true, Ports: []string{"mesh"}},
@ -305,7 +305,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-11
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-11").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-11").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.11", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.11", External: true, Ports: []string{"mesh"}},
@ -320,7 +320,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-12
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-12").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-12").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.12", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.12", External: true, Ports: []string{"mesh"}},
@ -335,7 +335,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-13
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-13").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-13").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.13", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.13", External: true, Ports: []string{"mesh"}},
@ -350,7 +350,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-14
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-14").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-14").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.14", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.14", External: true, Ports: []string{"mesh"}},
@ -365,7 +365,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-15
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-15").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-15").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.15", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.15", External: true, Ports: []string{"mesh"}},
@ -380,7 +380,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-16
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-16").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-16").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.16", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.16", External: true, Ports: []string{"mesh"}},
@ -395,7 +395,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-17
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-17").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-17").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.17", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.17", External: true, Ports: []string{"mesh"}},
@ -410,7 +410,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-18
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-18").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-18").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.18", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.18", External: true, Ports: []string{"mesh"}},
@ -425,7 +425,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-19
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-19").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-19").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.19", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.19", External: true, Ports: []string{"mesh"}},
@ -440,7 +440,7 @@ func expectedApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.Servi
},
// api-20
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-20").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-20").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.20", Ports: []string{"grpc", "http", "mesh"}},
{Host: "198.18.2.20", External: true, Ports: []string{"mesh"}},
@ -462,7 +462,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
Endpoints: []*pbcatalog.Endpoint{
// api-1
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-1").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-1").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.1", Ports: []string{"http"}},
},
@ -474,7 +474,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-10
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-10").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-10").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.10", Ports: []string{"http"}},
},
@ -486,7 +486,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-11
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-11").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-11").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.11", Ports: []string{"http"}},
},
@ -498,7 +498,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-12
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-12").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-12").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.12", Ports: []string{"http"}},
},
@ -510,7 +510,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-13
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-13").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-13").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.13", Ports: []string{"http"}},
},
@ -522,7 +522,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-14
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-14").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-14").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.14", Ports: []string{"http"}},
},
@ -534,7 +534,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-15
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-15").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-15").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.15", Ports: []string{"http"}},
},
@ -546,7 +546,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-16
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-16").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-16").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.16", Ports: []string{"http"}},
},
@ -558,7 +558,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-17
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-17").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-17").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.17", Ports: []string{"http"}},
},
@ -570,7 +570,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-18
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-18").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-18").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.18", Ports: []string{"http"}},
},
@ -582,7 +582,7 @@ func expectedHTTPApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-19
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-19").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-19").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.19", Ports: []string{"http"}},
},
@ -601,7 +601,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
Endpoints: []*pbcatalog.Endpoint{
// api-1
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-1").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-1").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.1", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.1", External: true, Ports: []string{"mesh"}},
@ -615,7 +615,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-2
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-2").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-2").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.2", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.2", External: true, Ports: []string{"mesh"}},
@ -629,7 +629,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-3
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-3").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-3").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.3", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.3", External: true, Ports: []string{"mesh"}},
@ -643,7 +643,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-4
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-4").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-4").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.4", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.4", External: true, Ports: []string{"mesh"}},
@ -657,7 +657,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-5
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-5").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-5").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.5", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.5", External: true, Ports: []string{"mesh"}},
@ -671,7 +671,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-6
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-6").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-6").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.6", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.6", External: true, Ports: []string{"mesh"}},
@ -685,7 +685,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-7
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-7").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-7").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.7", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.7", External: true, Ports: []string{"mesh"}},
@ -699,7 +699,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-8
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-8").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-8").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.8", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.8", External: true, Ports: []string{"mesh"}},
@ -713,7 +713,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-9
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-9").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-9").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.9", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.9", External: true, Ports: []string{"mesh"}},
@ -727,7 +727,7 @@ func expectedGRPCApiServiceEndpoints(t *testing.T, c *rtest.Client) *pbcatalog.S
},
// api-20
{
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV1Alpha1Type, "api-20").ID()),
TargetRef: c.ResolveResourceID(t, rtest.Resource(types.WorkloadV2Beta1Type, "api-20").ID()),
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "172.16.1.20", Ports: []string{"grpc", "mesh"}},
{Host: "198.18.2.20", External: true, Ports: []string{"mesh"}},

View File

@ -8,31 +8,31 @@ import (
"github.com/hashicorp/consul/internal/catalog"
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/sdk/testutil"
)
// RunCatalogV1Alpha1LifecycleIntegrationTest intends to excercise functionality of
// RunCatalogV2Beta1LifecycleIntegrationTest intends to excercise functionality of
// managing catalog resources over their normal lifecycle where they will be modified
// several times, change state etc.
func RunCatalogV1Alpha1LifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
func RunCatalogV2Beta1LifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
t.Helper()
testutil.RunStep(t, "node-lifecycle", func(t *testing.T) {
RunCatalogV1Alpha1NodeLifecycleIntegrationTest(t, client)
RunCatalogV2Beta1NodeLifecycleIntegrationTest(t, client)
})
testutil.RunStep(t, "workload-lifecycle", func(t *testing.T) {
RunCatalogV1Alpha1WorkloadLifecycleIntegrationTest(t, client)
RunCatalogV2Beta1WorkloadLifecycleIntegrationTest(t, client)
})
testutil.RunStep(t, "endpoints-lifecycle", func(t *testing.T) {
RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t, client)
RunCatalogV2Beta1EndpointsLifecycleIntegrationTest(t, client)
})
}
// RunCatalogV1Alpha1NodeLifecycleIntegrationTest verifies correct functionality of
// RunCatalogV2Beta1NodeLifecycleIntegrationTest verifies correct functionality of
// the node-health controller. This test will exercise the following behaviors:
//
// * Creating a Node without associated HealthStatuses will mark the node as passing
@ -41,14 +41,14 @@ func RunCatalogV1Alpha1LifecycleIntegrationTest(t *testing.T, client pbresource.
// * Changing HealthStatus to a better health will cause recomputation of the Health
// * Deletion of associated HealthStatuses will recompute the Health (back to passing)
// * Deletion of the node will cause deletion of associated health statuses
func RunCatalogV1Alpha1NodeLifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
func RunCatalogV2Beta1NodeLifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
c := rtest.NewClient(client)
nodeName := "test-lifecycle"
nodeHealthName := "test-lifecycle-node-status"
// initial node creation
node := rtest.Resource(catalog.NodeV1Alpha1Type, nodeName).
node := rtest.Resource(catalog.NodeV2Beta1Type, nodeName).
WithData(t, &pbcatalog.Node{
Addresses: []*pbcatalog.NodeAddress{
{Host: "172.16.2.3"},
@ -113,7 +113,7 @@ func RunCatalogV1Alpha1NodeLifecycleIntegrationTest(t *testing.T, client pbresou
c.WaitForDeletion(t, healthStatus.Id)
}
// RunCatalogV1Alpha1WorkloadLifecycleIntegrationTest verifies correct functionality of
// RunCatalogV2Beta1WorkloadLifecycleIntegrationTest verifies correct functionality of
// the workload-health controller. This test will exercise the following behaviors:
//
// - Associating a workload with a node causes recomputation of the health and takes
@ -131,18 +131,18 @@ func RunCatalogV1Alpha1NodeLifecycleIntegrationTest(t *testing.T, client pbresou
// - Overall health is computed as the worst health amongst the nodes health and all
// of the workloads associated HealthStatuses
// - Deletion of the workload will cause deletion of all associated health statuses.
func RunCatalogV1Alpha1WorkloadLifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
func RunCatalogV2Beta1WorkloadLifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
c := rtest.NewClient(client)
testutil.RunStep(t, "nodeless-workload", func(t *testing.T) {
runV1Alpha1NodelessWorkloadLifecycleIntegrationTest(t, c)
runV2Beta1NodelessWorkloadLifecycleIntegrationTest(t, c)
})
testutil.RunStep(t, "node-associated-workload", func(t *testing.T) {
runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest(t, c)
runV2Beta1NodeAssociatedWorkloadLifecycleIntegrationTest(t, c)
})
}
// runV1Alpha1NodelessWorkloadLifecycleIntegrationTest verifies correct functionality of
// runV2Beta1NodelessWorkloadLifecycleIntegrationTest verifies correct functionality of
// the workload-health controller for workloads without node associations. In particular
// the following behaviors are being tested
//
@ -152,12 +152,12 @@ func RunCatalogV1Alpha1WorkloadLifecycleIntegrationTest(t *testing.T, client pbr
// - Changing HealthStatus to a better health will cause recompuation of the Health
// - Deletion of associated HealthStatus for a nodeless workload will be set back to passing
// - Deletion of the workload will cause deletion of all associated health statuses.
func runV1Alpha1NodelessWorkloadLifecycleIntegrationTest(t *testing.T, c *rtest.Client) {
func runV2Beta1NodelessWorkloadLifecycleIntegrationTest(t *testing.T, c *rtest.Client) {
workloadName := "test-lifecycle-workload"
workloadHealthName := "test-lifecycle-workload-status"
// create a workload without a node association or health statuses yet
workload := rtest.Resource(catalog.WorkloadV1Alpha1Type, workloadName).
workload := rtest.Resource(catalog.WorkloadV2Beta1Type, workloadName).
WithData(t, &pbcatalog.Workload{
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "198.18.9.8"},
@ -223,7 +223,7 @@ func runV1Alpha1NodelessWorkloadLifecycleIntegrationTest(t *testing.T, c *rtest.
c.WaitForDeletion(t, workloadHealth.Id)
}
// runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest verifies correct functionality of
// runV2Beta1NodeAssociatedWorkloadLifecycleIntegrationTest verifies correct functionality of
// the workload-health controller. This test will exercise the following behaviors:
//
// - Associating a workload with a node causes recomputation of the health and takes
@ -236,7 +236,7 @@ func runV1Alpha1NodelessWorkloadLifecycleIntegrationTest(t *testing.T, c *rtest.
// inherit its health from the node.
// - Overall health is computed as the worst health amongst the nodes health and all
// of the workloads associated HealthStatuses
func runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest(t *testing.T, c *rtest.Client) {
func runV2Beta1NodeAssociatedWorkloadLifecycleIntegrationTest(t *testing.T, c *rtest.Client) {
workloadName := "test-lifecycle"
workloadHealthName := "test-lifecycle"
nodeName1 := "test-lifecycle-1"
@ -245,12 +245,12 @@ func runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest(t *testing.T, c *
nodeHealthName2 := "test-lifecycle-node-2"
// Insert a some nodes to link the workloads to at various points throughout the test
node1 := rtest.Resource(catalog.NodeV1Alpha1Type, nodeName1).
node1 := rtest.Resource(catalog.NodeV2Beta1Type, nodeName1).
WithData(t, &pbcatalog.Node{
Addresses: []*pbcatalog.NodeAddress{{Host: "172.17.9.10"}},
}).
Write(t, c)
node2 := rtest.Resource(catalog.NodeV1Alpha1Type, nodeName2).
node2 := rtest.Resource(catalog.NodeV2Beta1Type, nodeName2).
WithData(t, &pbcatalog.Node{
Addresses: []*pbcatalog.NodeAddress{{Host: "172.17.9.11"}},
}).
@ -263,7 +263,7 @@ func runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest(t *testing.T, c *
setHealthStatus(t, c, node2.Id, nodeHealthName2, pbcatalog.Health_HEALTH_WARNING)
// Add the workload but don't immediately associate with any node.
workload := rtest.Resource(catalog.WorkloadV1Alpha1Type, workloadName).
workload := rtest.Resource(catalog.WorkloadV2Beta1Type, workloadName).
WithData(t, &pbcatalog.Workload{
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "198.18.9.8"},
@ -367,7 +367,7 @@ func runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest(t *testing.T, c *
catalog.WorkloadHealthConditions[pbcatalog.Health_HEALTH_PASSING])
}
// RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest verifies the correct functionality of
// RunCatalogV2Beta1EndpointsLifecycleIntegrationTest verifies the correct functionality of
// the endpoints controller. This test will exercise the following behaviors:
//
// * Services without a selector get marked with status indicating their endpoints are unmanaged
@ -379,13 +379,13 @@ func runV1Alpha1NodeAssociatedWorkloadLifecycleIntegrationTest(t *testing.T, c *
// * Adding ports to a service will recalculate the endpoints
// * Removing ports from a service will recalculate the endpoints
// * Changing the workload will recalculate the endpoints (ports, addresses, or health)
func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
func RunCatalogV2Beta1EndpointsLifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient) {
c := rtest.NewClient(client)
serviceName := "test-lifecycle"
// Create the service without a selector. We should not see endpoints generated but we should see the
// status updated to note endpoints are not being managed.
service := rtest.Resource(catalog.ServiceV1Alpha1Type, serviceName).
service := rtest.Resource(catalog.ServiceV2Beta1Type, serviceName).
WithData(t, &pbcatalog.Service{
Ports: []*pbcatalog.ServicePort{{TargetPort: "http", Protocol: pbcatalog.Protocol_PROTOCOL_HTTP}},
}).
@ -395,7 +395,7 @@ func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pb
c.WaitForStatusCondition(t, service.Id, catalog.EndpointsStatusKey, catalog.EndpointsStatusConditionUnmanaged)
// Verify that no endpoints were created.
endpointsID := rtest.Resource(catalog.ServiceEndpointsV1Alpha1Type, serviceName).ID()
endpointsID := rtest.Resource(catalog.ServiceEndpointsV2Beta1Type, serviceName).ID()
c.RequireResourceNotFound(t, endpointsID)
// Add some empty endpoints (type validations enforce that they are owned by the service)
@ -412,7 +412,7 @@ func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pb
// api-1 has all ports (http, grpc and mesh). It also has a mixture of Addresses
// that select individual ports and one that selects all ports implicitly
api1 := rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-1").
api1 := rtest.Resource(catalog.WorkloadV2Beta1Type, "api-1").
WithData(t, &pbcatalog.Workload{
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "127.0.0.1"},
@ -431,7 +431,7 @@ func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pb
// api-2 has only grpc and mesh ports. It also has a mixture of Addresses that
// select individual ports and one that selects all ports implicitly
api2 := rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-2").
api2 := rtest.Resource(catalog.WorkloadV2Beta1Type, "api-2").
WithData(t, &pbcatalog.Workload{
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "127.0.0.1"},
@ -448,7 +448,7 @@ func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pb
// api-3 has the mesh and HTTP ports. It also has a mixture of Addresses that
// select individual ports and one that selects all ports.
api3 := rtest.Resource(catalog.WorkloadV1Alpha1Type, "api-3").
api3 := rtest.Resource(catalog.WorkloadV2Beta1Type, "api-3").
WithData(t, &pbcatalog.Workload{
Addresses: []*pbcatalog.WorkloadAddress{
{Host: "127.0.0.1"},
@ -463,7 +463,7 @@ func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pb
Write(t, c)
// Now create a service with unmanaged endpoints again
service = rtest.Resource(catalog.ServiceV1Alpha1Type, serviceName).
service = rtest.Resource(catalog.ServiceV2Beta1Type, serviceName).
WithData(t, &pbcatalog.Service{
Ports: []*pbcatalog.ServicePort{{TargetPort: "http", Protocol: pbcatalog.Protocol_PROTOCOL_HTTP}},
}).
@ -706,7 +706,7 @@ func RunCatalogV1Alpha1EndpointsLifecycleIntegrationTest(t *testing.T, client pb
}
func setHealthStatus(t *testing.T, client *rtest.Client, owner *pbresource.ID, name string, health pbcatalog.Health) *pbresource.Resource {
return rtest.Resource(catalog.HealthStatusV1Alpha1Type, name).
return rtest.Resource(catalog.HealthStatusV2Beta1Type, name).
WithData(t, &pbcatalog.HealthStatus{
Type: "synthetic",
Status: health,

View File

@ -15,7 +15,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)
@ -23,7 +23,7 @@ var (
// API Group Information
APIGroup = types.GroupName
VersionV1Alpha1 = types.VersionV1Alpha1
VersionV1Alpha1 = types.VersionV2Beta1
CurrentVersion = types.CurrentVersion
// Resource Kind Names.
@ -38,17 +38,17 @@ var (
DNSPolicyKind = types.DNSPolicyKind
FailoverPolicyKind = types.FailoverPolicyKind
// Resource Types for the v1alpha1 version.
// Resource Types for the v2beta1 version.
WorkloadV1Alpha1Type = types.WorkloadV1Alpha1Type
ServiceV1Alpha1Type = types.ServiceV1Alpha1Type
ServiceEndpointsV1Alpha1Type = types.ServiceEndpointsV1Alpha1Type
VirtualIPsV1Alpha1Type = types.VirtualIPsV1Alpha1Type
NodeV1Alpha1Type = types.NodeV1Alpha1Type
HealthStatusV1Alpha1Type = types.HealthStatusV1Alpha1Type
HealthChecksV1Alpha1Type = types.HealthChecksV1Alpha1Type
DNSPolicyV1Alpha1Type = types.DNSPolicyV1Alpha1Type
FailoverPolicyV1Alpha1Type = types.FailoverPolicyV1Alpha1Type
WorkloadV2Beta1Type = types.WorkloadV2Beta1Type
ServiceV2Beta1Type = types.ServiceV2Beta1Type
ServiceEndpointsV2Beta1Type = types.ServiceEndpointsV2Beta1Type
VirtualIPsV2Beta1Type = types.VirtualIPsV2Beta1Type
NodeV2Beta1Type = types.NodeV2Beta1Type
HealthStatusV2Beta1Type = types.HealthStatusV2Beta1Type
HealthChecksV2Beta1Type = types.HealthChecksV2Beta1Type
DNSPolicyV2Beta1Type = types.DNSPolicyV2Beta1Type
FailoverPolicyV2Beta1Type = types.FailoverPolicyV2Beta1Type
// Resource Types for the latest version.

View File

@ -14,7 +14,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

View File

@ -16,7 +16,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"
"github.com/hashicorp/consul/sdk/testutil"

View File

@ -10,7 +10,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

View File

@ -12,7 +12,7 @@ import (
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"
"github.com/hashicorp/consul/sdk/testutil"

View File

@ -9,7 +9,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

View File

@ -15,7 +15,7 @@ import (
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/sdk/testutil"
)

View File

@ -10,7 +10,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

View File

@ -12,7 +12,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"
"github.com/hashicorp/consul/sdk/testutil"

View File

@ -4,7 +4,7 @@
package nodehealth
import (
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

View File

@ -12,7 +12,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

View File

@ -14,7 +14,7 @@ import (
"github.com/hashicorp/consul/internal/catalog/internal/types"
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"
"github.com/hashicorp/consul/sdk/testutil"

View File

@ -5,7 +5,7 @@ package workloadhealth
import (
"github.com/hashicorp/consul/internal/catalog/internal/controllers/nodehealth"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

View File

@ -10,7 +10,7 @@ import (
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
"github.com/hashicorp/consul/internal/resource/mappers/bimapper"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

View File

@ -13,7 +13,7 @@ import (
"github.com/hashicorp/consul/internal/controller"
"github.com/hashicorp/consul/internal/resource"
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v1alpha1"
pbcatalog "github.com/hashicorp/consul/proto-public/pbcatalog/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"github.com/hashicorp/consul/proto/private/prototest"
)

Some files were not shown because too many files have changed in this diff Show More