Commit Graph

40 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
Seth Hoenig
2c44cbb001 api: enable support for setting original job source (#16763)
* api: enable support for setting original source alongside job

This PR adds support for setting job source material along with
the registration of a job.

This includes a new HTTP endpoint and a new RPC endpoint for
making queries for the original source of a job. The
HTTP endpoint is /v1/job/<id>/submission?version=<version> and
the RPC method is Job.GetJobSubmission.

The job source (if submitted, and doing so is always optional), is
stored in the job_submission memdb table, separately from the
actual job. This way we do not incur overhead of reading the large
string field throughout normal job operations.

The server config now includes job_max_source_size for configuring
the maximum size the job source may be, before the server simply
drops the source material. This should help prevent Bad Things from
happening when huge jobs are submitted. If the value is set to 0,
all job source material will be dropped.

* api: avoid writing var content to disk for parsing

* api: move submission validation into RPC layer

* api: return an error if updating a job submission without namespace or job id

* api: be exact about the job index we associate a submission with (modify)

* api: reword api docs scheduling

* api: prune all but the last 6 job submissions

* api: protect against nil job submission in job validation

* api: set max job source size in test server

* api: fixups from pr
2023-04-11 08:45:08 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
Alessandro De Blasis
9a5248b932 cli: show host_network in nomad status (#11432)
Enhance the CLI in order to return the host network in two flavors 
(default, verbose) of the `node status` command.

Fixes: #11223.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
2021-11-05 09:02:46 -04:00
Drew Bailey
7ce0b5017c Events/msgtype cleanup (#9117)
* use msgtype in upsert node

adds message type to signature for upsert node, update tests, remove placeholder method

* UpsertAllocs msg type test setup

* use upsertallocs with msg type in signature

update test usage of delete node

delete placeholder msgtype method

* add msgtype to upsert evals signature, update test call sites with test setup msg type

handle snapshot upsert eval outside of FSM and ignore eval event

remove placeholder upsertevalsmsgtype

handle job plan rpc and prevent event creation for plan

msgtype cleanup upsertnodeevents

updatenodedrain msgtype

msg type 0 is a node registration event, so set the default  to the ignore type

* fix named import

* fix signature ordering on upsertnode to match
2020-10-19 09:30:15 -04:00
James Rasell
f5567b3261 cli: move tests to use NewMockUi func. 2020-10-05 16:07:41 +02:00
Alex Dadgar
3902385b3e Status honors exact match and displays matches when more than one is available 2017-08-29 08:42:09 -07:00
Alex Dadgar
01f584a9d8 Remove tests checking autocomplete only does 1 arg 2017-08-28 15:42:32 -07:00
Chelsea Holland Komlo
1fdabecad3 get status of deployment via status cli command 2017-08-25 21:06:33 +00:00
Chelsea Holland Komlo
f6ca06ce43 refactor and fixups from code review 2017-08-25 17:34:05 +00:00
Chelsea Holland Komlo
a5238232aa limit argument autocompletion to one 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
d1ab4f4317 small fixups 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
c24caaaa18 fix autocomplete to list all matches 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
9e3be518e3 adds any resource autocomplete
defaults to listing jobs if no id is provided
2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
7a476c6049 migrate nomad status to nomad job status 2017-08-09 15:16:04 +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
4ad897ae92 Fix test 2017-07-20 17:42:58 -07:00
Alex Dadgar
7515f778a9 Thread through warnings about deprecations 2017-05-09 20:52:47 -07:00
Cameron Davison
561d7e3e97 s/Created/Created At/ 2016-08-15 21:40:34 -05:00
Cameron Davison
a66c568b3b remove time flag, and update docs with new column 2016-08-08 21:15:45 -05:00
Cameron Davison
40bc21fa8f add time flag to add created column to allocation 2016-08-07 19:44:56 -05:00
Diptanu Choudhury
4095e33fa0 Displaying the job summary in nomad status command 2016-07-25 17:26:38 -07:00
Alex Dadgar
ad00346640 test fix 2016-05-27 11:50:15 -07: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
648a3487c9 Merge branch 'master' into f-cli-short-ids 2016-01-15 09:19:53 +01:00
Alex Dadgar
6e46fb9315 Fix test 2016-01-14 14:38:02 -08: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
Ryan Uber
da35ecc4f3 command: fix tests after job validation 2015-09-16 11:42:28 -07:00
Ryan Uber
a7b70259c8 command: testing alloc/eval dump and short mode for status 2015-09-15 12:53:13 -07: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
4b708bf6df command: use testutil.TestServer in command tests 2015-09-14 13:24:03 -07:00
Ryan Uber
8246db154d command: cli tests 2015-09-14 13:24:03 -07:00
Ryan Uber
314ce4be43 command: basic status command 2015-09-14 13:24:02 -07:00