29 Commits

Author SHA1 Message Date
Daniel Bennett
ec81e7c57c networking: add ignore_collision for static port{} (#23956)
so more than one copy of a program can run
at a time on the same port with SO_REUSEPORT.

requires host network mode.

some task drivers (like docker) may also need
config {
  network_mode = "host"
}
but this is not validated prior to placement.
2024-09-17 16:01:48 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Seth Hoenig
9bfd89ccd3 api: purge testify and pretty dependencies (#15627)
* api: swap testify for test (acl)

* api: swap testify for test (agent)

 Please enter the commit message for your changes. Lines starting

* api: swap testify for test (allocations)

* api: swap testify for test (api)

* api: swap testify for test (compose)

* api: swap testify for test (constraint)

* api: swap testify for test (consul)

* api: swap testify for test (csi)

* api: swap testify for test (evaluations)

* api: swap testify for test (event stream)

* api: swap testify for test (fs)

* api: swap testify for test (ioutil)

* api: swap testify for test (jobs)

* api: swap testify for test (keyring)

* api: swap testify for test (operator_ent)

* api: swap testify for test (operator_metrics)

* api: swap testify for test (operator)

* api: swap testify for test (quota)

* api: swap testify for test (resources)

* api: swap testify for test (fix operator_metrics)

* api: swap testify for test (scaling)

* api: swap testify for test (search)

* api: swap testify for test (sentinel)

* api: swap testify for test (services)

* api: swap testify for test (status)

* api: swap testify for test (system)

* api: swap testify for test (tasks)

* api: swap testify for test (utils)

* api: swap testify for test (variables)

* api: remove dependencies on testify and pretty
2023-01-01 12:57:26 -06:00
Piotr Kazmierczak
c4be2c6078 cleanup: replace TypeToPtr helper methods with pointer.Of (#14151)
Bumping compile time requirement to go 1.18 allows us to simplify our pointer helper methods.
2022-08-17 18:26:34 +02:00
Seth Hoenig
3695901441 ci: use serial testing for api in CI
This is a followup to running tests in serial in CI.
Since the API package cannot import anything outside of api/,
copy the ci.Parallel function into api/internal/testutil, and
have api tests use that.
2022-03-17 08:35:01 -05:00
Nick Ethier
18ed6a7a85 test: fix up testing around host networks 2020-06-19 13:53:31 -04:00
Nick Ethier
a91df65402 fix tests from introducing new struct fields 2019-07-31 01:03:16 -04:00
Jasmine Dahilig
c467a94e2b backfill region from job hcl in jobUpdate and jobPlan endpoints
- updated region in job metadata that gets persisted to nomad datastore
- fixed many unrelated unit tests that used an invalid region value
(they previously passed because hcl wasn't getting picked up and
the job would default to global region)
2019-06-13 08:03:16 -07:00
Alex Dadgar
bc42873e07 Change types of weights on spread/affinity 2019-01-30 12:20:38 -08:00
Mahmood Ali
41c3250ee5 api: embed pointer conversion functions
Embed pointer conversion functions in the API package to avoid
unnecessary package dependency.  `helper` package imports more
dependencies relevant for internal use (e.g. `hcl`).
2019-01-18 15:31:04 -05:00
Preetha Appan
7cdaf6e37d Make spread weight a pointer with default value if unset 2019-01-11 10:31:21 -06:00
Alex Dadgar
0953d913ed Deprecate IOPS
IOPS have been modelled as a resource since Nomad 0.1 but has never
actually been detected and there is no plan in the short term to add
detection. This is because IOPS is a bit simplistic of a unit to define
the performance requirements from the underlying storage system. In its
current state it adds unnecessary confusion and can be removed without
impacting any users. This PR leaves IOPS defined at the jobspec parsing
level and in the api/ resources since these are the two public uses of
the field. These should be considered deprecated and only exist to allow
users to stop using them during the Nomad 0.9.x release. In the future,
there should be no expectation that the field will exist.
2018-12-06 15:09:26 -08:00
Preetha Appan
ed4ed16b5d Parsing and API layer for spread stanza 2018-09-04 16:10:11 -05:00
Preetha Appan
8f2d5742c4 Affinity parsing, api and structs 2018-09-04 16:10:11 -05:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Alex Dadgar
a56f67b76d Parallel 2017-07-21 16:33:04 -07:00
Diptanu Choudhury
5502a669e8 Added tests 2017-02-16 13:52:39 -08:00
Diptanu Choudhury
f551dcb83e Making the job spec return api.Job 2017-02-16 13:52:39 -08:00
Alex Dadgar
73733a8542 Fixes 2016-02-19 15:49:32 -08:00
Alex Dadgar
a0642a71ab Fix api test 2015-12-18 12:17:54 -08:00
Diptanu Choudhury
a52bff862d Fixed the api tests 2015-11-16 13:10:57 -08:00
Diptanu Choudhury
67c21e4b31 Added a RestartPolicy to some mocks 2015-10-30 21:33:33 -07:00
Alex Dadgar
c46447a572 Remove weight and hard/soft fields from constraint 2015-10-27 14:31:14 -07:00
Alex Dadgar
50862f8e31 Switch to using BlkioWeight 2015-10-06 15:44:01 -07:00
Armon Dadgar
b81105bd09 Change CPU from float64 to int 2015-09-23 11:14:32 -07:00
Ryan Uber
24cd105200 api: composing jobs takes region 2015-09-16 11:42:08 -07:00
Ryan Uber
dc8a672acd api: more tests 2015-09-09 18:10:16 -07:00
Ryan Uber
9fea4bf6cb api: more tests for jobs 2015-09-09 17:29:43 -07:00
Ryan Uber
5d1e515112 api: restructure client 2015-09-09 13:05:27 -07:00