38 Commits

Author SHA1 Message Date
Charlie Voiselle
30ab8897d2 deps: Switch from mitchellh/cli to hashicorp/cli (#19321)
Co-authored-by: James Rasell <jrasell@hashicorp.com>
2024-12-19 15:41:11 +00:00
Seth Hoenig
4d83733909 tests: swap testify for test in more places (#20028)
* tests: swap testify for test in plugins/csi/client_test.go

* tests: swap testify for test in testutil/

* tests: swap testify for test in host_test.go

* tests: swap testify for test in plugin_test.go

* tests: swap testify for test in utils_test.go

* tests: swap testify for test in scheduler/

* tests: swap testify for test in parse_test.go

* tests: swap testify for test in attribute_test.go

* tests: swap testify for test in plugins/drivers/

* tests: swap testify for test in command/

* tests: fixup some test usages

* go: run go mod tidy

* windows: cpuset test only on linux
2024-02-29 12:11:35 -06:00
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Shishir
4042c28223 cli: add -quiet to nomad node status command. (#12426) 2022-04-05 15:53:43 -04:00
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
James Rasell
f5567b3261 cli: move tests to use NewMockUi func. 2020-10-05 16:07:41 +02:00
Mahmood Ali
81422d410a cli: show full id for single node or alloc status
Show full ID on individual alloc or node status views.  Shortening
the ID isn't very helpful in these cases, and makes looking up the full
id slightly more complicated when user needs to interact with API.

List views are unmodified and show short id unless `-vebose` flag is passed.

Before
```
$ nomad node status -self | head -n2
ID            = 21fc51f9
Name          = mars-2.local

$ nomad alloc status 15ae54cd | head -n3
ID                  = 15ae54cd-08dd-3681-03cf-4c23ace7e7c3
Eval ID             = a6b15f86
Name                = example.cache[0]
```

After:
```
$ nomad node status -self | head -n2
ID            = 21fc51f9-fd39-0fa0-fb41-f34c7aa36101
Name          = mars-2.local

$ nomad alloc status 15ae54cd | head -n3
ID                  = 15ae54cd-08dd-3681-03cf-4c23ace7e7c3
Eval ID             = a6b15f86-ca8e-e536-b544-4bfb43137ff3
Name                = example.cache[0]
```
2019-10-04 16:36:18 -04:00
Mahmood Ali
6208d53275 Prepare to reuse device resources printing 2018-11-16 10:26:32 -05:00
Mahmood Ali
276149eaa7 device stats summary in node status
Sample output with a mock device:

```
Host Resource Utilization
CPU             Memory          Disk
2651/26400 MHz  9.6 GiB/16 GiB  98 GiB/234 GiB

Device Resource Utilization
nomad/file/mock[README.md]    511 bytes
nomad/file/mock[e2e.go]       239 bytes
nomad/file/mock[e2e_test.go]  128 bytes

Allocations
No allocations placed
```
2018-11-14 22:13:23 -05:00
Alex Dadgar
aaf77ae13e Handle force draining 2018-06-06 13:05:39 -07:00
Michael Schurter
758e1cb7f3 cli: expand drain info for node status 2018-05-04 10:32:25 -07:00
Nick Ethier
4a4ed06db1 command: update tests to check for new error message 2018-04-18 13:51:17 -04:00
Michael Schurter
8da7335c16 non-Existent -> nonexistent
Reverting from #3963

https://www.merriam-webster.com/dictionary/existent
2018-03-12 11:59:33 -07:00
Josh Soref
ac40c42533 spelling: existent 2018-03-11 18:30:37 +00:00
Alex Dadgar
e3710a991e add prefix tests 2017-08-29 10:09:30 -07:00
Alex Dadgar
01f584a9d8 Remove tests checking autocomplete only does 1 arg 2017-08-28 15:42:32 -07:00
Chelsea Holland Komlo
ca6562adbd tab completion should only happen once 2017-08-16 17:04:47 +00:00
Chelsea Holland Komlo
af2f20f1bf tests for autocomplete functions 2017-08-15 20:21:50 +00:00
Alex Dadgar
a77c6a4f71 Parallel 2017-07-20 21:24:21 -07:00
Alex Dadgar
da25a3d5ce Switch to in-process agent 2017-07-20 21:07:32 -07:00
Alex Dadgar
beb01f1754 test fixes 2017-07-07 14:11:27 -07:00
Alex Dadgar
6639f31c4a Fix some commands test 2017-07-07 12:11:39 -07:00
Kenjiro Nakayama
7d804a41c7 Add test to check both -json and -t are not specified 2016-08-09 21:06:20 +09:00
Alex Dadgar
3fbe8a1642 node-status -self command and docs 2016-03-29 12:36:24 -07:00
Alex Dadgar
afbc8621ee less verbose output and show node's total resources 2016-03-20 17:36:40 -07:00
Ivo Verberk
cc4fea99fc Provide a consistent user experience with prefix based lookups.
* Require at least two characters for identifier
* Automatically strip off the last character in case of uneven length
2016-01-21 22:21:35 +01:00
Ivo Verberk
de3bc00a00 Detect a half-byte prefix and display a user-friendly error. 2016-01-21 20:53:05 +01:00
Ivo Verberk
9770a95608 Refactoring of full-id argument and id length constants
* full-id argument is now called verbose to be more future-proof
* constants for identifier length are a little more concise
2016-01-15 23:32:38 +01:00
Ivo Verberk
ab9409184a Shorten CLI identifiers
* Truncate all UUID identifiers to eight characters by default
* Refactor the node identifier to an auto-generated UUID
* Created and updated tests and mocks
2016-01-14 21:57:43 +01:00
Ivo Verberk
905742249e Refactoring continued
* Refactor other cli commands to new design
* Add PrefixList method to api package
* Add more tests
2015-12-24 20:53:37 +01:00
Ivo Verberk
e89b5af338 Refactoring
* Reverted changes to get methods
* Added prefix query parameter
* Updated node status to use prefix based searching
* Fixed tests
* Removed truncation logic
2015-12-22 23:44:33 +01:00
Ivo Verberk
1af7c579f9 Revert "On cli node status list print the short Node ID when possible"
This reverts commit 5d3bd1b6f0.
2015-12-22 10:18:58 +01:00
Armin
5d3bd1b6f0 On cli node status list print the short Node ID when possible 2015-12-20 17:33:27 +01:00
Ryan Uber
550434dc9b command: dump allocations for nodes in node-status 2015-09-15 11:20:08 -07:00
Ryan Uber
7e26f938a2 command: use meta struct for common options 2015-09-14 13:24:03 -07:00
Ryan Uber
98708120f7 command: more cli tests 2015-09-14 13:24:03 -07:00
Ryan Uber
a0c8a0bc0d command: add node-status command 2015-09-14 13:24:03 -07:00