Skip to content

Commit a097d1f

Browse files
Merge remote-tracking branch 'remotes/from/ce/main'
2 parents 7b12feb + 7e587fd commit a097d1f

File tree

5 files changed

+66
-63
lines changed

5 files changed

+66
-63
lines changed

changelog/_13259.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:change
2+
auth/kubernetes: Update plugin to [v0.24.1](https://github.com/hashicorp/vault-plugin-auth-kubernetes/releases/tag/v0.24.1)
3+
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ require (
149149
github.com/hashicorp/vault-plugin-auth-gcp v0.23.1
150150
github.com/hashicorp/vault-plugin-auth-jwt v0.26.1
151151
github.com/hashicorp/vault-plugin-auth-kerberos v0.17.1
152-
github.com/hashicorp/vault-plugin-auth-kubernetes v0.24.0
152+
github.com/hashicorp/vault-plugin-auth-kubernetes v0.24.1
153153
github.com/hashicorp/vault-plugin-auth-oci v0.21.1
154154
github.com/hashicorp/vault-plugin-database-couchbase v0.16.1
155155
github.com/hashicorp/vault-plugin-database-elasticsearch v0.20.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,8 @@ github.com/hashicorp/vault-plugin-auth-jwt v0.26.1 h1:eSXJVECExviE3Zj6mV06cMM47q
849849
github.com/hashicorp/vault-plugin-auth-jwt v0.26.1/go.mod h1:ob1LGh1ScQuKBU+V0bTWP2fkdr4x0OREoFMb7oIX4R4=
850850
github.com/hashicorp/vault-plugin-auth-kerberos v0.17.1 h1:eOlMi+w5VTdvMmyP18GPnckybjwFYLna0eXBLWsb+BQ=
851851
github.com/hashicorp/vault-plugin-auth-kerberos v0.17.1/go.mod h1:FET3h3/cvfy+H0PbQdMVgDZnBlgSFVhJbovrRRU+9Ic=
852-
github.com/hashicorp/vault-plugin-auth-kubernetes v0.24.0 h1:vxl9+h4GWfbdl1kg2ff/Q621JEv2jIlCz4zfypLZNmY=
853-
github.com/hashicorp/vault-plugin-auth-kubernetes v0.24.0/go.mod h1:NA10EFL3dQF2TJcjb72rC7jcmaJ9LGLsEPFc0QIGVkI=
852+
github.com/hashicorp/vault-plugin-auth-kubernetes v0.24.1 h1:EBSaP3mKs0wffpJgmPWI+dU++8CLrC3uexdvmCON7/Y=
853+
github.com/hashicorp/vault-plugin-auth-kubernetes v0.24.1/go.mod h1:to9rJ8c0g0qC1++j55TrWjopLhuB0MKgt1PSRbdwhxg=
854854
github.com/hashicorp/vault-plugin-auth-oci v0.21.1 h1:PLMLH0VV3Wan2XS4l9KJOSlrabhpEihZS2HSuv4rFaY=
855855
github.com/hashicorp/vault-plugin-auth-oci v0.21.1/go.mod h1:EzPAiRkV/FeKL+cTZr3jK5AKKNVhyOVa3JT+RzCZy3k=
856856
github.com/hashicorp/vault-plugin-database-couchbase v0.16.1 h1:z5j7s7F1toEmvjABVP9TWDiFu+hrTt5fP830UmbFk+0=

ui/app/components/page/namespaces.hbs

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
{{#if this.showContent}}
5656
{{! Show namespace list }}
5757
{{#if this.hasNamespaces}}
58-
<Toolbar class="top-margin-16">
58+
<Toolbar class="top-margin-16 has-bottom-margin-s">
5959
<ToolbarFilters>
6060
<FilterInputExplicit
6161
@query={{@model.pageFilter}}
@@ -81,65 +81,46 @@
8181
</ToolbarActions>
8282
</Toolbar>
8383

84-
<ListView
85-
@items={{@model.namespaces}}
86-
@itemNoun="namespace"
87-
@paginationRouteName="vault.cluster.access.namespaces"
88-
@onPageChange={{this.handlePageChange}}
89-
as |list|
90-
>
91-
{{#if @model.namespaces.length}}
92-
<ListItem as |Item|>
93-
<Item.content>
94-
{{list.item.id}}
95-
</Item.content>
96-
<Item.menu>
97-
<Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|>
98-
<dd.ToggleIcon
99-
@icon="more-horizontal"
100-
@text="More options"
101-
@hasChevron={{false}}
102-
data-test-popup-menu-trigger
103-
/>
104-
{{#let (concat this.namespace.path (if this.namespace.path "/") list.item.id) as |targetNamespace|}}
105-
{{#if (includes targetNamespace this.namespace.accessibleNamespaces)}}
106-
<dd.Interactive
107-
{{on "click" (fn this.switchNamespace targetNamespace)}}
108-
data-test-popup-menu="switch"
109-
>Switch to namespace</dd.Interactive>
110-
{{/if}}
111-
{{/let}}
112-
<dd.Interactive
113-
@color="critical"
114-
{{on "click" (fn (mut this.nsToDelete) list.item)}}
115-
data-test-popup-menu="delete"
116-
>Delete</dd.Interactive>
117-
</Hds::Dropdown>
118-
{{#if (eq this.nsToDelete list.item)}}
119-
<ConfirmModal
120-
@color="critical"
121-
@onClose={{fn (mut this.nsToDelete) null}}
122-
@onConfirm={{fn this.deleteNamespace list.item}}
123-
@confirmTitle="Delete this namespace?"
124-
@confirmMessage="Any engines or mounts in this namespace will also be removed."
125-
/>
126-
{{/if}}
127-
</Item.menu>
128-
</ListItem>
129-
{{else}}
130-
<list.empty class="top-padding-32 is-marginless" data-test-list-view-empty-state as |A|>
131-
<A.Header @title={{list.emptyTitle}} @titleTag="h2" data-test-empty-state-title />
132-
<A.Body @text={{list.emptyMessage}} data-test-empty-state-message />
133-
<A.Footer data-test-empty-state-actions as |F|>
134-
<F.LinkStandalone
135-
@icon="learn-link"
136-
@text="Secure multi-tenancy with namespaces tutorial"
137-
@href={{doc-link "/vault/tutorials/enterprise/namespaces"}}
84+
{{#if @model.namespaces.length}}
85+
<ListTable @columns={{this.tableColumns}} @data={{this.namespaceIds}}>
86+
<:popupMenu as |rowData|>
87+
<Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|>
88+
<dd.ToggleIcon
89+
@icon="more-horizontal"
90+
@text="More options"
91+
@hasChevron={{false}}
92+
data-test-popup-menu-trigger
13893
/>
139-
</A.Footer>
140-
</list.empty>
141-
{{/if}}
142-
</ListView>
94+
{{#let (concat this.namespace.path (if this.namespace.path "/") rowData.id) as |targetNamespace|}}
95+
{{#if (includes targetNamespace this.namespace.accessibleNamespaces)}}
96+
<dd.Interactive
97+
{{on "click" (fn this.switchNamespace targetNamespace)}}
98+
data-test-popup-menu="switch"
99+
>Switch to namespace</dd.Interactive>
100+
{{/if}}
101+
{{/let}}
102+
<dd.Interactive
103+
@color="critical"
104+
{{on "click" (fn (mut this.nsToDelete) rowData.id)}}
105+
data-test-popup-menu="delete"
106+
>Delete</dd.Interactive>
107+
</Hds::Dropdown>
108+
{{#if (eq this.nsToDelete rowData.id)}}
109+
<ConfirmModal
110+
@color="critical"
111+
@onClose={{fn (mut this.nsToDelete) null}}
112+
@onConfirm={{fn this.deleteNamespace rowData.id}}
113+
@confirmTitle="Delete this namespace?"
114+
@confirmMessage="Any engines or mounts in this namespace will also be removed."
115+
/>
116+
{{/if}}
117+
</:popupMenu>
118+
</ListTable>
119+
{{else}}
120+
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
121+
<A.Header @title="No Namespaces found" @titleTag="h2" data-test-empty-state-title />
122+
</Hds::ApplicationState>
123+
{{/if}}
143124
{{else}}
144125
{{! Show empty state }}
145126
{{#if this.showSetupAlert}}

ui/app/components/page/namespaces.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,29 @@ export default class PageNamespacesComponent extends Component<Args> {
6464

6565
wizardId = WIZARD_ID_MAP.namespace;
6666

67+
tableColumns = [
68+
{
69+
key: 'id',
70+
label: 'Path',
71+
},
72+
{
73+
key: 'popupMenu',
74+
label: 'Action',
75+
width: '75px',
76+
},
77+
];
78+
6779
constructor(owner: unknown, args: Args) {
6880
super(owner, args);
6981
this.query = this.args.model.pageFilter || '';
7082
}
7183

84+
get namespaceIds() {
85+
return this.args.model.namespaces.map((namespace) => {
86+
return { id: namespace.id };
87+
});
88+
}
89+
7290
// show the full available namespace path e.g. "root/ns1/child2", "admin/ns1/child2"
7391
get namespacePath() {
7492
if (this.namespace.inRootNamespace) {
@@ -133,7 +151,8 @@ export default class PageNamespacesComponent extends Component<Args> {
133151
}
134152

135153
@action
136-
async deleteNamespace(nsToDelete: NamespaceModel) {
154+
async deleteNamespace(namespaceId: string) {
155+
const nsToDelete = this.args.model.namespaces.find((ns) => ns.id === namespaceId) as NamespaceModel;
137156
try {
138157
// Attempt to destroy the record
139158
await nsToDelete.destroyRecord();

0 commit comments

Comments
 (0)