ui: Remove node name from agentless service instance (#14903)

* [NET-949]: Remove node name from agentless instance

* Add changelog entry
This commit is contained in:
Tyler Wendlandt 2022-10-07 04:01:34 -06:00 committed by GitHub
parent 9335a5e2e1
commit 11fe7dc8c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 16 deletions

3
.changelog/14903.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:feature
ui: Removed reference to node name on service instance page when using agentless
```

View File

@ -151,10 +151,12 @@ as |item|}}
<dt>Service Name</dt>
<dd><a href="{{href-to 'dc.services.show' item.Service.Service}}">{{item.Service.Service}}</a></dd>
</dl>
<dl>
<dt>Node Name</dt>
<dd><a href="{{href-to 'dc.nodes.show' item.Node.Node}}">{{item.Node.Node}}</a></dd>
</dl>
{{#unless item.Node.Meta.synthetic-node}}
<dl>
<dt>Node Name</dt>
<dd><a data-test-service-instance-node-name href="{{href-to 'dc.nodes.show' item.Node.Node}}">{{item.Node.Node}}</a></dd>
</dl>
{{/unless}}
{{#if item.Service.PeerName}}
<dl>
<dt>Peer Name</dt>

View File

@ -18,6 +18,16 @@
const proxy = service.indexOf('-proxy')
const sidecar = service.indexOf('-sidecar-proxy')
const id = (proxy !== -1 ? service.slice(0, -6) + '-with-id-proxy' : service + '-with-id');
const externalSource = fake.helpers.randomize([
'consul-api-gateway',
'vault',
'nomad',
'terraform',
'kubernetes',
'aws',
'lambda',
''
]);
let kind = '';
switch(true) {
case service.endsWith('-mesh-gateway'):
@ -42,7 +52,10 @@
"Address":"${ip}",
"Datacenter":"dc1",
"TaggedAddresses":{"lan":"${ip}","wan":"${ip}"},
"Meta":{"${service}-network-segment":""},
"Meta":{
"${service}-network-segment":"",
"synthetic-node":${externalSource === 'kubernetes' ? "true" : "false"}
},
${typeof location.search.peer !== 'undefined' ? `
"PeerName": "${location.search.peer}",
` : ``}
@ -87,16 +100,7 @@ ${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',
'nomad',
'terraform',
'kubernetes',
'aws',
'lambda',
''
])}"
"external-source": "${externalSource}"
},
` : `
"Meta": null,

View File

@ -2,7 +2,7 @@
Feature: dc / services / instances / show: Show Service Instance
Background:
Given 1 datacenter model with the value "dc1"
And 2 instance models from yaml
And 3 instance models from yaml
---
- Service:
ID: service-0-with-id
@ -45,6 +45,15 @@ Feature: dc / services / instances / show: Show Service Instance
ServiceID: ""
Output: Output of check
Status: critical
- Service:
ID: service-2-with-id
Meta:
external-source: kubernetes
synthetic-node: true
Node:
Node: node-2
Meta:
synthetic-node: true
---
Scenario: A Service instance has no Proxy
Given 1 proxy model from yaml
@ -62,6 +71,7 @@ Feature: dc / services / instances / show: Show Service Instance
---
Then the url should be /dc1/services/service-0/instances/another-node/service-1-with-id/health-checks
Then I see externalSource like "nomad"
And I see the text "another-node" in "[data-test-service-instance-node-name]"
And I don't see upstreams on the tabs
And I see healthChecksIsSelected on the tabs
@ -115,3 +125,14 @@ Feature: dc / services / instances / show: Show Service Instance
---
Then the url should be /dc1/services/service-0/instances/node-0/service-0-with-id/health-checks
And I don't see proxy on the tabs
Scenario: A Service instance with a synthetic node does not display the node name
When I visit the instance page for yaml
---
dc: dc1
service: service-2
node: node-2
id: service-2-with-id
---
Then the url should be /dc1/services/service-2/instances/node-2/service-2-with-id/health-checks
Then I see externalSource like "kubernetes"
And I don't see the text "node-2" in "[data-test-service-instance-node-name]"