mirror of https://github.com/hashicorp/consul
Browse Source
* update UINodes and UINodeInfo response with consul-version info added as NodeMeta, fetched from serf members * update test cases TestUINodes, TestUINodeInfo * added nil check for map * add consul-version in local agent node metadata * get consul version from serf member and add this as node meta in catalog register request * updated ui mock response to include consul versions as node meta * updated ui trans and added version as query param to node list route * updates in ui templates to display consul version with filter and sorts * updates in ui - model class, serializers,comparators,predicates for consul version feature * added change log for Consul Version Feature * updated to get version from consul service, if for some reason not available from serf * updated changelog text * updated dependent testcases * multiselection version filter * Update agent/consul/state/catalog.go comments updated Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com> --------- Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>pull/18081/head^2
Vijay
1 year ago
committed by
GitHub
26 changed files with 397 additions and 16 deletions
@ -0,0 +1,3 @@
|
||||
```release-note:feature |
||||
ui: Display the Consul agent version in the nodes list, and allow filtering and sorting of nodes based on versions. |
||||
``` |
@ -0,0 +1,45 @@
|
||||
/** |
||||
* Copyright (c) HashiCorp, Inc. |
||||
* SPDX-License-Identifier: MPL-2.0 |
||||
*/ |
||||
|
||||
import comparators from 'consul-ui/sort/comparators/node'; |
||||
import { properties } from 'consul-ui/services/sort'; |
||||
import { module, test } from 'qunit'; |
||||
|
||||
module('Unit | Sort | Comparator | node', function () { |
||||
const comparator = comparators({ properties }); |
||||
test('items are sorted by a fake Version', function (assert) { |
||||
const items = [ |
||||
{ |
||||
Version: '2.24.1', |
||||
}, |
||||
{ |
||||
Version: '1.12.6', |
||||
}, |
||||
{ |
||||
Version: '2.09.3', |
||||
}, |
||||
]; |
||||
const comp = comparator('Version:asc'); |
||||
assert.equal(typeof comp, 'function'); |
||||
|
||||
const expected = [ |
||||
{ |
||||
Version: '1.12.6', |
||||
}, |
||||
{ |
||||
Version: '2.09.3', |
||||
}, |
||||
{ |
||||
Version: '2.24.1', |
||||
}, |
||||
]; |
||||
let actual = items.sort(comp); |
||||
assert.deepEqual(actual, expected); |
||||
|
||||
expected.reverse(); |
||||
actual = items.sort(comparator('Version:desc')); |
||||
assert.deepEqual(actual, expected); |
||||
}); |
||||
}); |
Loading…
Reference in new issue