ui: Add AWS Lambda as potential external source (#14605)

* ui: Add AWS Lambda as potential external source

* Update mocks to expect `lambda` as an external-source meta

* Additional mock to make sure all our mocks only contain whats possible
This commit is contained in:
John Cowen 2022-09-14 18:38:03 +01:00 committed by GitHub
parent f9b4fa17f1
commit f658ee9996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 61 additions and 6 deletions

View File

@ -22,6 +22,7 @@
.consul-external-source.vault::before {
@extend %with-vault-300;
}
.consul-external-source.lambda::before,
.consul-external-source.aws::before {
@extend %with-aws-300;
}

View File

@ -52,6 +52,7 @@
@extend %with-user-team-mask, %as-pseudo;
color: rgb(var(--tone-gray-500));
}
%popover-select .lambda button::before,
%popover-select .aws button::before {
@extend %with-aws-300;
}

View File

@ -9,7 +9,16 @@ export function serviceExternalSource(params, hash) {
const prefix = typeof hash.prefix === 'undefined' ? '' : hash.prefix;
if (
source &&
['consul-api-gateway', 'vault', 'kubernetes', 'terraform', 'nomad', 'consul', 'aws'].includes(
[
'consul-api-gateway',
'vault',
'kubernetes',
'terraform',
'nomad',
'consul',
'aws',
'lambda'
].includes(
source
)
) {

View File

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

View File

@ -87,7 +87,16 @@ ${typeof location.search.partition !== 'undefined' ? `
${ fake.random.number({min: 1, max: 10}) > 2 ? `
"Meta": {
"consul-dashboard-url": "${fake.internet.protocol()}://${fake.internet.domainName()}/?id={{Service}}",
"external-source": "${fake.helpers.randomize(['consul-api-gateway', 'vault', 'consul', 'nomad', 'terraform', 'kubernetes', 'aws', ''])}"
"external-source": "${fake.helpers.randomize([
'consul-api-gateway',
'vault',
'nomad',
'terraform',
'kubernetes',
'aws',
'lambda',
''
])}"
},
` : `
"Meta": null,

View File

@ -50,7 +50,16 @@ ${ fake.random.number({min: 1, max: 10}) > 2 ? `
range(fake.random.number({min: 1, max: 1})).map(
function(item, i)
{
return `"${fake.helpers.randomize(['vault', 'consul', 'nomad', 'terraform', 'kubernetes', 'aws', ''])}"`;
return `"${fake.helpers.randomize([
'consul-api-gateway',
'vault',
'nomad',
'terraform',
'kubernetes',
'aws',
'lambda',
''
])}"`;
}
)
}

View File

@ -63,7 +63,14 @@ return `
],
${ fake.random.number({min: 1, max: 10}) > 2 ? `
"Meta": {
"external-source": "${fake.helpers.randomize(['consul-api-gateway', 'consul', 'nomad', 'terraform', 'kubernetes', ''])}"
"external-source": "${fake.helpers.randomize([
'consul-api-gateway',
'consul',
'nomad',
'terraform',
'kubernetes',
''
])}"
},
` : `` }
"Address":"",

View File

@ -90,7 +90,16 @@ ${ fake.random.number({min: 1, max: 10}) > 2 ? `
range(fake.random.number({min: 1, max: 1})).map(
function(item, i)
{
return `"${fake.helpers.randomize(['consul-api-gateway', 'vault', 'nomad', 'terraform', 'kubernetes', 'aws', ''])}"`;
return `"${fake.helpers.randomize([
'consul-api-gateway',
'vault',
'nomad',
'terraform',
'kubernetes',
'aws',
'lambda',
''
])}"`;
}
)
}

View File

@ -5,6 +5,7 @@ brand:
nomad: Nomad
vault: Vault
aws: AWS
lambda: AWS Lambda
aws-iam: AWS IAM
kubernetes: Kubernetes
jwt: JWT