mirror of https://github.com/status-im/consul.git
fix(api): OSS<->ENT exported service incompatibility
This commit is contained in:
parent
ecc43db774
commit
08f7e52d82
|
@ -363,7 +363,7 @@ func TestAPI_AgentServicesWithFilterOpts(t *testing.T) {
|
||||||
}
|
}
|
||||||
require.NoError(t, agent.ServiceRegister(reg))
|
require.NoError(t, agent.ServiceRegister(reg))
|
||||||
|
|
||||||
opts := &QueryOptions{Namespace: splitDefaultNamespace}
|
opts := &QueryOptions{Namespace: defaultNamespace}
|
||||||
services, err := agent.ServicesWithFilterOpts("foo in Tags", opts)
|
services, err := agent.ServicesWithFilterOpts("foo in Tags", opts)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, services, 1)
|
require.Len(t, services, 1)
|
||||||
|
@ -791,8 +791,8 @@ func TestAPI_AgentService(t *testing.T) {
|
||||||
Warning: 1,
|
Warning: 1,
|
||||||
},
|
},
|
||||||
Meta: map[string]string{},
|
Meta: map[string]string{},
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
}
|
}
|
||||||
require.Equal(t, expect, got)
|
require.Equal(t, expect, got)
|
||||||
|
@ -932,7 +932,7 @@ func TestAPI_AgentUpdateTTLOpts(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := &QueryOptions{Namespace: splitDefaultNamespace}
|
opts := &QueryOptions{Namespace: defaultNamespace}
|
||||||
|
|
||||||
if err := agent.UpdateTTLOpts("service:foo", "foo", HealthWarning, opts); err != nil {
|
if err := agent.UpdateTTLOpts("service:foo", "foo", HealthWarning, opts); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -1007,7 +1007,7 @@ func TestAPI_AgentChecksWithFilterOpts(t *testing.T) {
|
||||||
reg.TTL = "15s"
|
reg.TTL = "15s"
|
||||||
require.NoError(t, agent.CheckRegister(reg))
|
require.NoError(t, agent.CheckRegister(reg))
|
||||||
|
|
||||||
opts := &QueryOptions{Namespace: splitDefaultNamespace}
|
opts := &QueryOptions{Namespace: defaultNamespace}
|
||||||
checks, err := agent.ChecksWithFilterOpts("Name == foo", opts)
|
checks, err := agent.ChecksWithFilterOpts("Name == foo", opts)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, checks, 1)
|
require.Len(t, checks, 1)
|
||||||
|
@ -1382,7 +1382,7 @@ func TestAPI_ServiceMaintenanceOpts(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specify namespace in query option
|
// Specify namespace in query option
|
||||||
opts := &QueryOptions{Namespace: splitDefaultNamespace}
|
opts := &QueryOptions{Namespace: defaultNamespace}
|
||||||
|
|
||||||
// Enable maintenance mode
|
// Enable maintenance mode
|
||||||
if err := agent.EnableServiceMaintenanceOpts("redis", "broken", opts); err != nil {
|
if err := agent.EnableServiceMaintenanceOpts("redis", "broken", opts); err != nil {
|
||||||
|
@ -1701,7 +1701,7 @@ func TestAPI_AgentHealthServiceOpts(t *testing.T) {
|
||||||
requireServiceHealthID := func(t *testing.T, serviceID, expected string, shouldExist bool) {
|
requireServiceHealthID := func(t *testing.T, serviceID, expected string, shouldExist bool) {
|
||||||
msg := fmt.Sprintf("service id:%s, shouldExist:%v, expectedStatus:%s : bad %%s", serviceID, shouldExist, expected)
|
msg := fmt.Sprintf("service id:%s, shouldExist:%v, expectedStatus:%s : bad %%s", serviceID, shouldExist, expected)
|
||||||
|
|
||||||
opts := &QueryOptions{Namespace: splitDefaultNamespace}
|
opts := &QueryOptions{Namespace: defaultNamespace}
|
||||||
state, out, err := agent.AgentHealthServiceByIDOpts(serviceID, opts)
|
state, out, err := agent.AgentHealthServiceByIDOpts(serviceID, opts)
|
||||||
require.Nil(t, err, msg, "err")
|
require.Nil(t, err, msg, "err")
|
||||||
require.Equal(t, expected, state, msg, "state")
|
require.Equal(t, expected, state, msg, "state")
|
||||||
|
@ -1715,7 +1715,7 @@ func TestAPI_AgentHealthServiceOpts(t *testing.T) {
|
||||||
requireServiceHealthName := func(t *testing.T, serviceName, expected string, shouldExist bool) {
|
requireServiceHealthName := func(t *testing.T, serviceName, expected string, shouldExist bool) {
|
||||||
msg := fmt.Sprintf("service name:%s, shouldExist:%v, expectedStatus:%s : bad %%s", serviceName, shouldExist, expected)
|
msg := fmt.Sprintf("service name:%s, shouldExist:%v, expectedStatus:%s : bad %%s", serviceName, shouldExist, expected)
|
||||||
|
|
||||||
opts := &QueryOptions{Namespace: splitDefaultNamespace}
|
opts := &QueryOptions{Namespace: defaultNamespace}
|
||||||
state, outs, err := agent.AgentHealthServiceByNameOpts(serviceName, opts)
|
state, outs, err := agent.AgentHealthServiceByNameOpts(serviceName, opts)
|
||||||
require.Nil(t, err, msg, "err")
|
require.Nil(t, err, msg, "err")
|
||||||
require.Equal(t, expected, state, msg, "state")
|
require.Equal(t, expected, state, msg, "state")
|
||||||
|
|
|
@ -51,7 +51,7 @@ func TestAPI_CatalogNodes(t *testing.T) {
|
||||||
want := &Node{
|
want := &Node{
|
||||||
ID: s.Config.NodeID,
|
ID: s.Config.NodeID,
|
||||||
Node: s.Config.NodeName,
|
Node: s.Config.NodeName,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Address: "127.0.0.1",
|
Address: "127.0.0.1",
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
TaggedAddresses: map[string]string{
|
TaggedAddresses: map[string]string{
|
||||||
|
@ -1144,8 +1144,8 @@ func TestAPI_CatalogGatewayServices_Terminating(t *testing.T) {
|
||||||
|
|
||||||
expect := []*GatewayService{
|
expect := []*GatewayService{
|
||||||
{
|
{
|
||||||
Service: CompoundServiceName{Name: "api", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Service: CompoundServiceName{Name: "api", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
Gateway: CompoundServiceName{Name: "terminating", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Gateway: CompoundServiceName{Name: "terminating", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
GatewayKind: ServiceKindTerminatingGateway,
|
GatewayKind: ServiceKindTerminatingGateway,
|
||||||
CAFile: "api/ca.crt",
|
CAFile: "api/ca.crt",
|
||||||
CertFile: "api/client.crt",
|
CertFile: "api/client.crt",
|
||||||
|
@ -1153,8 +1153,8 @@ func TestAPI_CatalogGatewayServices_Terminating(t *testing.T) {
|
||||||
SNI: "my-domain",
|
SNI: "my-domain",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Service: CompoundServiceName{Name: "redis", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Service: CompoundServiceName{Name: "redis", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
Gateway: CompoundServiceName{Name: "terminating", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Gateway: CompoundServiceName{Name: "terminating", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
GatewayKind: ServiceKindTerminatingGateway,
|
GatewayKind: ServiceKindTerminatingGateway,
|
||||||
CAFile: "ca.crt",
|
CAFile: "ca.crt",
|
||||||
CertFile: "client.crt",
|
CertFile: "client.crt",
|
||||||
|
@ -1212,15 +1212,15 @@ func TestAPI_CatalogGatewayServices_Ingress(t *testing.T) {
|
||||||
|
|
||||||
expect := []*GatewayService{
|
expect := []*GatewayService{
|
||||||
{
|
{
|
||||||
Service: CompoundServiceName{Name: "api", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Service: CompoundServiceName{Name: "api", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
Gateway: CompoundServiceName{Name: "ingress", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Gateway: CompoundServiceName{Name: "ingress", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
GatewayKind: ServiceKindIngressGateway,
|
GatewayKind: ServiceKindIngressGateway,
|
||||||
Protocol: "tcp",
|
Protocol: "tcp",
|
||||||
Port: 8888,
|
Port: 8888,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Service: CompoundServiceName{Name: "redis", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Service: CompoundServiceName{Name: "redis", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
Gateway: CompoundServiceName{Name: "ingress", Namespace: splitDefaultNamespace, Partition: splitDefaultPartition},
|
Gateway: CompoundServiceName{Name: "ingress", Namespace: defaultNamespace, Partition: defaultPartition},
|
||||||
GatewayKind: ServiceKindIngressGateway,
|
GatewayKind: ServiceKindIngressGateway,
|
||||||
Protocol: "tcp",
|
Protocol: "tcp",
|
||||||
Port: 9999,
|
Port: 9999,
|
||||||
|
|
|
@ -139,8 +139,8 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
entry: &ServiceResolverConfigEntry{
|
entry: &ServiceResolverConfigEntry{
|
||||||
Kind: ServiceResolver,
|
Kind: ServiceResolver,
|
||||||
Name: "test-failover",
|
Name: "test-failover",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
DefaultSubset: "v1",
|
DefaultSubset: "v1",
|
||||||
Subsets: map[string]ServiceResolverSubset{
|
Subsets: map[string]ServiceResolverSubset{
|
||||||
"v1": {
|
"v1": {
|
||||||
|
@ -159,7 +159,7 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
},
|
},
|
||||||
"v1": {
|
"v1": {
|
||||||
Service: "alternate",
|
Service: "alternate",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
},
|
},
|
||||||
"v3": {
|
"v3": {
|
||||||
Targets: []ServiceResolverFailoverTarget{
|
Targets: []ServiceResolverFailoverTarget{
|
||||||
|
@ -182,12 +182,12 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
entry: &ServiceResolverConfigEntry{
|
entry: &ServiceResolverConfigEntry{
|
||||||
Kind: ServiceResolver,
|
Kind: ServiceResolver,
|
||||||
Name: "test-redirect",
|
Name: "test-redirect",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Redirect: &ServiceResolverRedirect{
|
Redirect: &ServiceResolverRedirect{
|
||||||
Service: "test-failover",
|
Service: "test-failover",
|
||||||
ServiceSubset: "v2",
|
ServiceSubset: "v2",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Datacenter: "d",
|
Datacenter: "d",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -198,8 +198,8 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
entry: &ServiceResolverConfigEntry{
|
entry: &ServiceResolverConfigEntry{
|
||||||
Kind: ServiceResolver,
|
Kind: ServiceResolver,
|
||||||
Name: "test-redirect",
|
Name: "test-redirect",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Redirect: &ServiceResolverRedirect{
|
Redirect: &ServiceResolverRedirect{
|
||||||
Service: "test-failover",
|
Service: "test-failover",
|
||||||
Peer: "cluster-01",
|
Peer: "cluster-01",
|
||||||
|
@ -212,14 +212,14 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
entry: &ServiceSplitterConfigEntry{
|
entry: &ServiceSplitterConfigEntry{
|
||||||
Kind: ServiceSplitter,
|
Kind: ServiceSplitter,
|
||||||
Name: "test-split",
|
Name: "test-split",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Splits: []ServiceSplit{
|
Splits: []ServiceSplit{
|
||||||
{
|
{
|
||||||
Weight: 90,
|
Weight: 90,
|
||||||
Service: "test-failover",
|
Service: "test-failover",
|
||||||
ServiceSubset: "v1",
|
ServiceSubset: "v1",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
RequestHeaders: &HTTPHeaderModifiers{
|
RequestHeaders: &HTTPHeaderModifiers{
|
||||||
Set: map[string]string{
|
Set: map[string]string{
|
||||||
"x-foo": "bar",
|
"x-foo": "bar",
|
||||||
|
@ -232,7 +232,7 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
{
|
{
|
||||||
Weight: 10,
|
Weight: 10,
|
||||||
Service: "test-redirect",
|
Service: "test-redirect",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Meta: map[string]string{
|
Meta: map[string]string{
|
||||||
|
@ -247,8 +247,8 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
entry: &ServiceRouterConfigEntry{
|
entry: &ServiceRouterConfigEntry{
|
||||||
Kind: ServiceRouter,
|
Kind: ServiceRouter,
|
||||||
Name: "test-route",
|
Name: "test-route",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Routes: []ServiceRoute{
|
Routes: []ServiceRoute{
|
||||||
{
|
{
|
||||||
Match: &ServiceRouteMatch{
|
Match: &ServiceRouteMatch{
|
||||||
|
@ -265,8 +265,8 @@ func TestAPI_ConfigEntry_DiscoveryChain(t *testing.T) {
|
||||||
Destination: &ServiceRouteDestination{
|
Destination: &ServiceRouteDestination{
|
||||||
Service: "test-failover",
|
Service: "test-failover",
|
||||||
ServiceSubset: "v2",
|
ServiceSubset: "v2",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
PrefixRewrite: "/",
|
PrefixRewrite: "/",
|
||||||
RequestTimeout: 5 * time.Second,
|
RequestTimeout: 5 * time.Second,
|
||||||
NumRetries: 5,
|
NumRetries: 5,
|
||||||
|
@ -358,8 +358,8 @@ func TestAPI_ConfigEntry_ServiceResolver_LoadBalancer(t *testing.T) {
|
||||||
entry: &ServiceResolverConfigEntry{
|
entry: &ServiceResolverConfigEntry{
|
||||||
Kind: ServiceResolver,
|
Kind: ServiceResolver,
|
||||||
Name: "test-least-req",
|
Name: "test-least-req",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
LoadBalancer: &LoadBalancer{
|
LoadBalancer: &LoadBalancer{
|
||||||
Policy: "least_request",
|
Policy: "least_request",
|
||||||
LeastRequestConfig: &LeastRequestConfig{ChoiceCount: 10},
|
LeastRequestConfig: &LeastRequestConfig{ChoiceCount: 10},
|
||||||
|
@ -372,8 +372,8 @@ func TestAPI_ConfigEntry_ServiceResolver_LoadBalancer(t *testing.T) {
|
||||||
entry: &ServiceResolverConfigEntry{
|
entry: &ServiceResolverConfigEntry{
|
||||||
Kind: ServiceResolver,
|
Kind: ServiceResolver,
|
||||||
Name: "test-ring-hash",
|
Name: "test-ring-hash",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
LoadBalancer: &LoadBalancer{
|
LoadBalancer: &LoadBalancer{
|
||||||
Policy: "ring_hash",
|
Policy: "ring_hash",
|
||||||
RingHashConfig: &RingHashConfig{
|
RingHashConfig: &RingHashConfig{
|
||||||
|
|
|
@ -57,7 +57,7 @@ type ServiceConsumer struct {
|
||||||
func (e *ExportedServicesConfigEntry) GetKind() string { return ExportedServices }
|
func (e *ExportedServicesConfigEntry) GetKind() string { return ExportedServices }
|
||||||
func (e *ExportedServicesConfigEntry) GetName() string { return e.Name }
|
func (e *ExportedServicesConfigEntry) GetName() string { return e.Name }
|
||||||
func (e *ExportedServicesConfigEntry) GetPartition() string { return e.Name }
|
func (e *ExportedServicesConfigEntry) GetPartition() string { return e.Name }
|
||||||
func (e *ExportedServicesConfigEntry) GetNamespace() string { return splitDefaultNamespace }
|
func (e *ExportedServicesConfigEntry) GetNamespace() string { return "" }
|
||||||
func (e *ExportedServicesConfigEntry) GetMeta() map[string]string { return e.Meta }
|
func (e *ExportedServicesConfigEntry) GetMeta() map[string]string { return e.Meta }
|
||||||
func (e *ExportedServicesConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex }
|
func (e *ExportedServicesConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex }
|
||||||
func (e *ExportedServicesConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex }
|
func (e *ExportedServicesConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex }
|
||||||
|
|
|
@ -17,7 +17,7 @@ func TestAPI_ConfigEntries_ExportedServices(t *testing.T) {
|
||||||
testutil.RunStep(t, "set and get", func(t *testing.T) {
|
testutil.RunStep(t, "set and get", func(t *testing.T) {
|
||||||
exports := &ExportedServicesConfigEntry{
|
exports := &ExportedServicesConfigEntry{
|
||||||
Name: PartitionDefaultName,
|
Name: PartitionDefaultName,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Meta: map[string]string{
|
Meta: map[string]string{
|
||||||
"gir": "zim",
|
"gir": "zim",
|
||||||
},
|
},
|
||||||
|
@ -48,7 +48,7 @@ func TestAPI_ConfigEntries_ExportedServices(t *testing.T) {
|
||||||
Services: []ExportedService{
|
Services: []ExportedService{
|
||||||
{
|
{
|
||||||
Name: "db",
|
Name: "db",
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
Consumers: []ServiceConsumer{
|
Consumers: []ServiceConsumer{
|
||||||
{
|
{
|
||||||
PeerName: "alpha",
|
PeerName: "alpha",
|
||||||
|
@ -60,7 +60,7 @@ func TestAPI_ConfigEntries_ExportedServices(t *testing.T) {
|
||||||
"foo": "bar",
|
"foo": "bar",
|
||||||
"gir": "zim",
|
"gir": "zim",
|
||||||
},
|
},
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, wm, err := entries.Set(updated, nil)
|
_, wm, err := entries.Set(updated, nil)
|
||||||
|
|
|
@ -215,8 +215,8 @@ func TestAPI_ConfigEntries(t *testing.T) {
|
||||||
"foo": "bar",
|
"foo": "bar",
|
||||||
"gir": "zim",
|
"gir": "zim",
|
||||||
},
|
},
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
}
|
}
|
||||||
ce := c.ConfigEntries()
|
ce := c.ConfigEntries()
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ func TestAPI_CoordinateUpdate(t *testing.T) {
|
||||||
newCoord.Height = 0.5
|
newCoord.Height = 0.5
|
||||||
entry := &CoordinateEntry{
|
entry := &CoordinateEntry{
|
||||||
Node: node,
|
Node: node,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Coord: newCoord,
|
Coord: newCoord,
|
||||||
}
|
}
|
||||||
_, err = coord.Update(entry, nil)
|
_, err = coord.Update(entry, nil)
|
||||||
|
|
|
@ -223,8 +223,8 @@ func TestAPI_HealthChecks(t *testing.T) {
|
||||||
ServiceName: "foo",
|
ServiceName: "foo",
|
||||||
ServiceTags: []string{"bar"},
|
ServiceTags: []string{"bar"},
|
||||||
Type: "ttl",
|
Type: "ttl",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,5 @@ package api
|
||||||
// The following defaults return "default" in enterprise and "" in OSS.
|
// The following defaults return "default" in enterprise and "" in OSS.
|
||||||
// This constant is useful when a default value is needed for an
|
// This constant is useful when a default value is needed for an
|
||||||
// operation that will reject non-empty values in OSS.
|
// operation that will reject non-empty values in OSS.
|
||||||
const splitDefaultNamespace = ""
|
const defaultNamespace = ""
|
||||||
const splitDefaultPartition = ""
|
const defaultPartition = ""
|
|
@ -187,7 +187,7 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
CreateIndex: ret.Results[0].KV.CreateIndex,
|
CreateIndex: ret.Results[0].KV.CreateIndex,
|
||||||
ModifyIndex: ret.Results[0].KV.ModifyIndex,
|
ModifyIndex: ret.Results[0].KV.ModifyIndex,
|
||||||
Namespace: ret.Results[0].KV.Namespace,
|
Namespace: ret.Results[0].KV.Namespace,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&TxnResult{
|
&TxnResult{
|
||||||
|
@ -199,14 +199,14 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
CreateIndex: ret.Results[1].KV.CreateIndex,
|
CreateIndex: ret.Results[1].KV.CreateIndex,
|
||||||
ModifyIndex: ret.Results[1].KV.ModifyIndex,
|
ModifyIndex: ret.Results[1].KV.ModifyIndex,
|
||||||
Namespace: ret.Results[0].KV.Namespace,
|
Namespace: ret.Results[0].KV.Namespace,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&TxnResult{
|
&TxnResult{
|
||||||
Node: &Node{
|
Node: &Node{
|
||||||
ID: nodeID,
|
ID: nodeID,
|
||||||
Node: "foo",
|
Node: "foo",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Address: "2.2.2.2",
|
Address: "2.2.2.2",
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
CreateIndex: ret.Results[2].Node.CreateIndex,
|
CreateIndex: ret.Results[2].Node.CreateIndex,
|
||||||
|
@ -218,8 +218,8 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
ID: "foo1",
|
ID: "foo1",
|
||||||
CreateIndex: ret.Results[3].Service.CreateIndex,
|
CreateIndex: ret.Results[3].Service.CreateIndex,
|
||||||
ModifyIndex: ret.Results[3].Service.CreateIndex,
|
ModifyIndex: ret.Results[3].Service.CreateIndex,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&TxnResult{
|
&TxnResult{
|
||||||
|
@ -237,8 +237,8 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
DeregisterCriticalServiceAfterDuration: 20 * time.Second,
|
DeregisterCriticalServiceAfterDuration: 20 * time.Second,
|
||||||
},
|
},
|
||||||
Type: "tcp",
|
Type: "tcp",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
CreateIndex: ret.Results[4].Check.CreateIndex,
|
CreateIndex: ret.Results[4].Check.CreateIndex,
|
||||||
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
||||||
},
|
},
|
||||||
|
@ -258,8 +258,8 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
DeregisterCriticalServiceAfterDuration: 160 * time.Second,
|
DeregisterCriticalServiceAfterDuration: 160 * time.Second,
|
||||||
},
|
},
|
||||||
Type: "tcp",
|
Type: "tcp",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
CreateIndex: ret.Results[4].Check.CreateIndex,
|
CreateIndex: ret.Results[4].Check.CreateIndex,
|
||||||
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
||||||
},
|
},
|
||||||
|
@ -279,8 +279,8 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
DeregisterCriticalServiceAfterDuration: 20 * time.Second,
|
DeregisterCriticalServiceAfterDuration: 20 * time.Second,
|
||||||
},
|
},
|
||||||
Type: "udp",
|
Type: "udp",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
CreateIndex: ret.Results[4].Check.CreateIndex,
|
CreateIndex: ret.Results[4].Check.CreateIndex,
|
||||||
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
||||||
},
|
},
|
||||||
|
@ -300,8 +300,8 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
DeregisterCriticalServiceAfterDuration: 20 * time.Second,
|
DeregisterCriticalServiceAfterDuration: 20 * time.Second,
|
||||||
},
|
},
|
||||||
Type: "udp",
|
Type: "udp",
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Namespace: splitDefaultNamespace,
|
Namespace: defaultNamespace,
|
||||||
CreateIndex: ret.Results[4].Check.CreateIndex,
|
CreateIndex: ret.Results[4].Check.CreateIndex,
|
||||||
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
ModifyIndex: ret.Results[4].Check.CreateIndex,
|
||||||
},
|
},
|
||||||
|
@ -342,14 +342,14 @@ func TestAPI_ClientTxn(t *testing.T) {
|
||||||
CreateIndex: ret.Results[0].KV.CreateIndex,
|
CreateIndex: ret.Results[0].KV.CreateIndex,
|
||||||
ModifyIndex: ret.Results[0].KV.ModifyIndex,
|
ModifyIndex: ret.Results[0].KV.ModifyIndex,
|
||||||
Namespace: ret.Results[0].KV.Namespace,
|
Namespace: ret.Results[0].KV.Namespace,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&TxnResult{
|
&TxnResult{
|
||||||
Node: &Node{
|
Node: &Node{
|
||||||
ID: s.Config.NodeID,
|
ID: s.Config.NodeID,
|
||||||
Node: s.Config.NodeName,
|
Node: s.Config.NodeName,
|
||||||
Partition: splitDefaultPartition,
|
Partition: defaultPartition,
|
||||||
Address: "127.0.0.1",
|
Address: "127.0.0.1",
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
TaggedAddresses: map[string]string{
|
TaggedAddresses: map[string]string{
|
||||||
|
|
Loading…
Reference in New Issue