-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NET-5414: sameness group service show (#19586)
Fix viewing peered services on different namespaces
- Loading branch information
Tyler Wendlandt
authored
Nov 9, 2023
1 parent
cb86b29
commit 7699fb1
Showing
10 changed files
with
146 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
ui: fix being able to view peered services from non-default namnespaces | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
ui/packages/consul-ui/app/components/consul/service/list/item/index.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: BUSL-1.1 | ||
}} | ||
|
||
<BlockSlot @name='header'> | ||
<dl class={{@item.MeshStatus}}> | ||
<dt> | ||
Health | ||
</dt> | ||
<dd {{tooltip @item.healthTooltipText}}></dd> | ||
</dl> | ||
{{#if (gt @item.InstanceCount 0)}} | ||
<a | ||
data-test-service-name | ||
href={{href-to | ||
'dc.services.show.index' | ||
@item.Name | ||
params=this.linkParams | ||
}} | ||
> | ||
{{@item.Name}} | ||
</a> | ||
{{else}} | ||
<p data-test-service-name> | ||
{{@item.Name}} | ||
</p> | ||
{{/if}} | ||
</BlockSlot> | ||
<BlockSlot @name='details'> | ||
<Consul::Kind @item={{@item}} /> | ||
<Consul::ExternalSource @item={{@item}} /> | ||
{{#if | ||
(and | ||
(not-eq @item.InstanceCount 0) | ||
(and (not-eq @item.Kind 'terminating-gateway') (not-eq @item.Kind 'ingress-gateway')) | ||
) | ||
}} | ||
<span> | ||
{{format-number @item.InstanceCount}} | ||
{{pluralize @item.InstanceCount 'instance' without-count=true}} | ||
</span> | ||
{{/if}} | ||
{{! we are displaying imported-services - don't show bucket-list }} | ||
{{#unless @isPeerDetail}} | ||
<Consul::Bucket::List @item={{@item}} @nspace={{@nspace}} @partition={{@partition}} /> | ||
{{/unless}} | ||
{{#if (eq @item.Kind 'terminating-gateway')}} | ||
<span data-test-associated-service-count> | ||
{{format-number @item.GatewayConfig.AssociatedServiceCount}} | ||
{{pluralize @item.GatewayConfig.AssociatedServiceCount 'linked service' without-count=true}} | ||
</span> | ||
{{else if (eq @item.Kind 'ingress-gateway')}} | ||
<span data-test-associated-service-count> | ||
{{format-number @item.GatewayConfig.AssociatedServiceCount}} | ||
{{pluralize @item.GatewayConfig.AssociatedServiceCount 'upstream' without-count=true}} | ||
</span> | ||
{{/if}} | ||
{{#if (or @item.ConnectedWithGateway @item.ConnectedWithProxy)}} | ||
<dl class='mesh'> | ||
<dt> | ||
<Tooltip> | ||
This service uses a proxy for the Consul service mesh | ||
</Tooltip> | ||
</dt> | ||
{{#if (and @item.ConnectedWithGateway @item.ConnectedWithProxy)}} | ||
<dd data-test-mesh> | ||
in service mesh with proxy and gateway | ||
</dd> | ||
{{else if @item.ConnectedWithProxy}} | ||
<dd data-test-mesh> | ||
in service mesh with proxy | ||
</dd> | ||
{{else if @item.ConnectedWithGateway}} | ||
<dd data-test-mesh> | ||
in service mesh with gateway | ||
</dd> | ||
{{/if}} | ||
</dl> | ||
{{/if}} | ||
<TagList @item={{@item}} /> | ||
</BlockSlot> |
25 changes: 25 additions & 0 deletions
25
ui/packages/consul-ui/app/components/consul/service/list/item/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import Component from '@glimmer/component'; | ||
|
||
export default class ConsulServiceListItem extends Component { | ||
get linkParams() { | ||
const hash = {}; | ||
|
||
if (this.args.item.Partition && this.args.partition !== this.args.item.Partition) { | ||
hash.partition = this.args.item.Partition; | ||
hash.nspace = this.args.Namespace; | ||
} else if (this.args.item.Namespace && this.args.nspace !== this.args.item.Namespace) { | ||
hash.nspace = this.args.item.Namespace; | ||
} | ||
|
||
if (this.args.item.PeerName) { | ||
hash.peer = this.args.item.PeerName; | ||
} | ||
|
||
return hash; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters