mirror of https://github.com/hashicorp/consul
Update peering mocks
parent
19fbdb7a0b
commit
0653bb57ac
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
${[0].map(
|
||||||
|
() => {
|
||||||
|
let prevKind;
|
||||||
|
let name;
|
||||||
|
const gateways = ['mesh-gateway', 'ingress-gateway', 'terminating-gateway'];
|
||||||
|
return `
|
||||||
|
[
|
||||||
|
${
|
||||||
|
range(
|
||||||
|
env(
|
||||||
|
'CONSUL_SERVICE_COUNT',
|
||||||
|
Math.floor(
|
||||||
|
(
|
||||||
|
Math.random() * env('CONSUL_SERVICE_MAX', 10)
|
||||||
|
) + parseInt(env('CONSUL_SERVICE_MIN', 1))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).map(
|
||||||
|
function(item, i)
|
||||||
|
{
|
||||||
|
return `
|
||||||
|
{
|
||||||
|
"Name": "service-${i}"
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
`})}
|
|
@ -1,7 +1,5 @@
|
||||||
{
|
{
|
||||||
"ID": "${fake.random.uuid()}",
|
"ID": "${fake.random.uuid()}",
|
||||||
"ImportedServiceCount": ${fake.random.number({min: 0, max: 4000})},
|
|
||||||
"ExportedServiceCount": ${fake.random.number({min: 0, max: 4000})},
|
|
||||||
"Name": "${location.pathname.get(2)}",
|
"Name": "${location.pathname.get(2)}",
|
||||||
"State": "${fake.helpers.randomize([
|
"State": "${fake.helpers.randomize([
|
||||||
'ACTIVE',
|
'ACTIVE',
|
||||||
|
@ -12,6 +10,13 @@
|
||||||
'TERMINATED',
|
'TERMINATED',
|
||||||
'UNDEFINED'
|
'UNDEFINED'
|
||||||
])}",
|
])}",
|
||||||
|
"StreamStatus": {
|
||||||
|
"LastHeartbeat": "${fake.date.past(10).toISOString()}",
|
||||||
|
"LastReceive": "${fake.date.past(10).toISOString()}",
|
||||||
|
"LastSend": "${fake.date.past(10).toISOString()}",
|
||||||
|
"ExportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"exported-service-${i}"`)}],
|
||||||
|
"ImportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"imported-service-${i}"`)}]
|
||||||
|
},
|
||||||
"PeerID": "${fake.random.uuid()}",
|
"PeerID": "${fake.random.uuid()}",
|
||||||
"PeerServerName": "${fake.internet.domainName()}",
|
"PeerServerName": "${fake.internet.domainName()}",
|
||||||
"PeerServerAddresses": [
|
"PeerServerAddresses": [
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
"LastHeartbeat": "${fake.date.past(10).toISOString()}",
|
"LastHeartbeat": "${fake.date.past(10).toISOString()}",
|
||||||
"LastReceive": "${fake.date.past(10).toISOString()}",
|
"LastReceive": "${fake.date.past(10).toISOString()}",
|
||||||
"LastSend": "${fake.date.past(10).toISOString()}",
|
"LastSend": "${fake.date.past(10).toISOString()}",
|
||||||
"ExportedServices": ["${`export-service-${i}`}"],
|
"ExportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"exported-service-${i}"`)}],
|
||||||
"ImportedServices": ["${`import-service-${i}`}"]
|
"ImportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"imported-service-${i}"`)}]
|
||||||
},
|
},
|
||||||
"PeerID": "${id}",
|
"PeerID": "${id}",
|
||||||
"PeerServerName": "${fake.internet.domainName()}",
|
"PeerServerName": "${fake.internet.domainName()}",
|
||||||
|
|
Loading…
Reference in New Issue