ui: Update mock intention metadata to only include possible values (#14607)

This commit is contained in:
John Cowen 2022-09-15 09:37:40 +01:00 committed by GitHub
parent 939074a4e5
commit f3a508f55b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 14 deletions

View File

@ -97,16 +97,7 @@ ${fake.helpers.randomize([
"Precedence": ${i + 1}, "Precedence": ${i + 1},
${ fake.random.number({min: 1, max: 10}) > 2 ? ` ${ fake.random.number({min: 1, max: 10}) > 2 ? `
"Meta": { "Meta": {
"external-source": "${fake.helpers.randomize([ "external-source": "${fake.helpers.randomize(['kubernetes', ''])}"
'consul-api-gateway',
'vault',
'nomad',
'terraform',
'kubernetes',
'aws',
'lambda',
''
])}"
}, },
` : `` } ` : `` }
"CreatedAt": "2018-05-21T16:41:27.977155457Z", "CreatedAt": "2018-05-21T16:41:27.977155457Z",

View File

@ -81,7 +81,7 @@ ${fake.helpers.randomize([
"Precedence": ${fake.random.number({min: 1, max: 100})}, "Precedence": ${fake.random.number({min: 1, max: 100})},
${ !legacy && fake.random.number({min: 1, max: 10}) > 2 ? ` ${ !legacy && fake.random.number({min: 1, max: 10}) > 2 ? `
"Meta": { "Meta": {
"external-source": "${fake.helpers.randomize(['kubernetes', 'consul-api-gateway'])}" "external-source": "${fake.helpers.randomize(['kubernetes', ''])}"
}, },
` : `` } ` : `` }
"CreatedAt": "2018-05-21T16:41:27.977155457Z", "CreatedAt": "2018-05-21T16:41:27.977155457Z",

View File

@ -87,7 +87,7 @@ ${fake.helpers.randomize([
"Precedence": ${fake.random.number({min: 1, max: 100})}, "Precedence": ${fake.random.number({min: 1, max: 100})},
${ (!legacy || source[1] === "external-source") && fake.random.number({min: 1, max: 10}) > 2 ? ` ${ (!legacy || source[1] === "external-source") && fake.random.number({min: 1, max: 10}) > 2 ? `
"Meta": { "Meta": {
"external-source": "${fake.helpers.randomize(['kubernetes', 'consul-api-gateway'])}" "external-source": "${fake.helpers.randomize(['kubernetes', ''])}"
}, },
` : `` } ` : `` }
"CreatedAt": "2018-05-21T16:41:27.977155457Z", "CreatedAt": "2018-05-21T16:41:27.977155457Z",

View File

@ -86,7 +86,7 @@ ${(Math.random(1) > 0.3) ? `
"Intention": { "Intention": {
"Allowed": ${allowed}, "Allowed": ${allowed},
"HasPermissions": ${hasPerms}, "HasPermissions": ${hasPerms},
"ExternalSource": "${fake.helpers.randomize(['vault', 'nomad', 'kubernetes', ''])}", "ExternalSource": "${fake.helpers.randomize(['kubernetes', ''])}",
"HasExact": ${fake.random.boolean()}, "HasExact": ${fake.random.boolean()},
"DefaultAllow": ${fake.random.boolean()} "DefaultAllow": ${fake.random.boolean()}
} }
@ -116,7 +116,7 @@ ${(Math.random(1) > 0.3) ? `
"Intention": { "Intention": {
"Allowed": ${allowed}, "Allowed": ${allowed},
"HasPermissions": ${hasPerms}, "HasPermissions": ${hasPerms},
"ExternalSource": "${fake.helpers.randomize(['nomad', 'kubernetes', ''])}", "ExternalSource": "${fake.helpers.randomize(['kubernetes', ''])}",
"HasExact": ${fake.random.boolean()}, "HasExact": ${fake.random.boolean()},
"DefaultAllow": ${fake.random.boolean()} "DefaultAllow": ${fake.random.boolean()}
} }