mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Fixed Meta name for JSON + Added unit tests for HCL/JSON
This commit is contained in:
parent
c152cb7bdf
commit
eccc223480
@ -319,7 +319,7 @@ type ServiceDefinition struct {
|
|||||||
Name *string `json:"name,omitempty" hcl:"name" mapstructure:"name"`
|
Name *string `json:"name,omitempty" hcl:"name" mapstructure:"name"`
|
||||||
Tags []string `json:"tags,omitempty" hcl:"tags" mapstructure:"tags"`
|
Tags []string `json:"tags,omitempty" hcl:"tags" mapstructure:"tags"`
|
||||||
Address *string `json:"address,omitempty" hcl:"address" mapstructure:"address"`
|
Address *string `json:"address,omitempty" hcl:"address" mapstructure:"address"`
|
||||||
Meta map[string]string `json:"node_meta,omitempty" hcl:"meta" mapstructure:"meta"`
|
Meta map[string]string `json:"meta,omitempty" hcl:"meta" mapstructure:"meta"`
|
||||||
Port *int `json:"port,omitempty" hcl:"port" mapstructure:"port"`
|
Port *int `json:"port,omitempty" hcl:"port" mapstructure:"port"`
|
||||||
Check *CheckDefinition `json:"check,omitempty" hcl:"check" mapstructure:"check"`
|
Check *CheckDefinition `json:"check,omitempty" hcl:"check" mapstructure:"check"`
|
||||||
Checks []CheckDefinition `json:"checks,omitempty" hcl:"checks" mapstructure:"checks"`
|
Checks []CheckDefinition `json:"checks,omitempty" hcl:"checks" mapstructure:"checks"`
|
||||||
|
@ -2438,6 +2438,9 @@ func TestFullConfig(t *testing.T) {
|
|||||||
"service": {
|
"service": {
|
||||||
"id": "dLOXpSCI",
|
"id": "dLOXpSCI",
|
||||||
"name": "o1ynPkp0",
|
"name": "o1ynPkp0",
|
||||||
|
"meta": {
|
||||||
|
"mymeta": "data"
|
||||||
|
},
|
||||||
"tags": ["nkwshvM5", "NTDWn3ek"],
|
"tags": ["nkwshvM5", "NTDWn3ek"],
|
||||||
"address": "cOlSOhbp",
|
"address": "cOlSOhbp",
|
||||||
"token": "msy7iWER",
|
"token": "msy7iWER",
|
||||||
@ -2875,6 +2878,9 @@ func TestFullConfig(t *testing.T) {
|
|||||||
service = {
|
service = {
|
||||||
id = "dLOXpSCI"
|
id = "dLOXpSCI"
|
||||||
name = "o1ynPkp0"
|
name = "o1ynPkp0"
|
||||||
|
meta = {
|
||||||
|
mymeta = "data"
|
||||||
|
}
|
||||||
tags = ["nkwshvM5", "NTDWn3ek"]
|
tags = ["nkwshvM5", "NTDWn3ek"]
|
||||||
address = "cOlSOhbp"
|
address = "cOlSOhbp"
|
||||||
token = "msy7iWER"
|
token = "msy7iWER"
|
||||||
@ -3528,6 +3534,7 @@ func TestFullConfig(t *testing.T) {
|
|||||||
Tags: []string{"nkwshvM5", "NTDWn3ek"},
|
Tags: []string{"nkwshvM5", "NTDWn3ek"},
|
||||||
Address: "cOlSOhbp",
|
Address: "cOlSOhbp",
|
||||||
Token: "msy7iWER",
|
Token: "msy7iWER",
|
||||||
|
Meta: map[string]string{"mymeta": "data"},
|
||||||
Port: 24237,
|
Port: 24237,
|
||||||
EnableTagOverride: true,
|
EnableTagOverride: true,
|
||||||
Checks: structs.CheckTypes{
|
Checks: structs.CheckTypes{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user