diff --git a/.changelog/14903.txt b/.changelog/14903.txt new file mode 100644 index 000000000..b55f2006a --- /dev/null +++ b/.changelog/14903.txt @@ -0,0 +1,3 @@ +```release-note:feature +ui: Removed reference to node name on service instance page when using agentless +``` diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance.hbs index a2ddf18d6..884e4eb01 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/instance.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/instance.hbs @@ -151,10 +151,12 @@ as |item|}}
Service Name
{{item.Service.Service}}
-
-
Node Name
-
{{item.Node.Node}}
-
+ {{#unless item.Node.Meta.synthetic-node}} +
+
Node Name
+
{{item.Node.Node}}
+
+ {{/unless}} {{#if item.Service.PeerName}}
Peer Name
diff --git a/ui/packages/consul-ui/mock-api/v1/health/service/_ b/ui/packages/consul-ui/mock-api/v1/health/service/_ index 1a9bbedc2..aaf9a1e0f 100644 --- a/ui/packages/consul-ui/mock-api/v1/health/service/_ +++ b/ui/packages/consul-ui/mock-api/v1/health/service/_ @@ -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, diff --git a/ui/packages/consul-ui/tests/acceptance/dc/services/instances/show.feature b/ui/packages/consul-ui/tests/acceptance/dc/services/instances/show.feature index bb45b5a0b..55b87cedb 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/services/instances/show.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/services/instances/show.feature @@ -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]"