Commit Graph

36 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
Dao Thanh Tung
67e39d5d24 Add check for missing path in client host_volume config (#17393) 2023-06-05 19:31:19 -04:00
Luiz Aoqui
81f0b359dd node pools: register a node in a node pool (#17405) 2023-06-02 17:50:50 -04:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Lance Haig
99f43c1144 Update ioutil library references to os and io respectively for command (#16329)
No user facing changes so I assume no change log is required
2023-03-08 09:20:04 -06:00
jmwilkinson
46f3977db2 Allow wildcard datacenters to be specified in job file (#11170)
Also allows for default value of `datacenters = ["*"]`
2023-02-02 09:57:45 -05:00
Piotr Kazmierczak
949a6f60c7 renamed stanza to block for consistency with other projects (#15941) 2023-01-30 15:48:43 +01: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
Karan Sharma
2d95f06026 feat: Warn if bootstrap_expect is even number (#12961) 2022-06-06 15:22:59 +02:00
Michael Schurter
3968509886 artifact: fix numerous go-getter security issues
Fix numerous go-getter security issues:

- Add timeouts to http, git, and hg operations to prevent DoS
- Add size limit to http to prevent resource exhaustion
- Disable following symlinks in both artifacts and `job run`
- Stop performing initial HEAD request to avoid file corruption on
  retries and DoS opportunities.

**Approach**

Since Nomad has no ability to differentiate a DoS-via-large-artifact vs
a legitimate workload, all of the new limits are configurable at the
client agent level.

The max size of HTTP downloads is also exposed as a node attribute so
that if some workloads have large artifacts they can specify a high
limit in their jobspecs.

In the future all of this plumbing could be extended to enable/disable
specific getters or artifact downloading entirely on a per-node basis.
2022-05-24 16:29:39 -04:00
Eng Zer Jun
fca4ee8e05 test: use T.TempDir to create temporary test directory (#12853)
* test: use `T.TempDir` to create temporary test directory

This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix TestLogmon_Start_restart on Windows

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix failing TestConsul_Integration

t.TempDir fails to perform the cleanup properly because the folder is
still in use

testing.go:967: TempDir RemoveAll cleanup: unlinkat /tmp/TestConsul_Integration2837567823/002/191a6f1a-5371-cf7c-da38-220fe85d10e5/web/secrets: device or resource busy

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-05-12 11:42:40 -04:00
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
Thomas Lefebvre
41f84c657a Add config command and config validate subcommand to nomad CLI (#9198) 2022-02-08 16:52:35 -05:00
James Rasell
c08a036655 Merge pull request #11403 from hashicorp/f-gh-11059
agent/docs: add better clarification when top-level data dir needs setting
2022-01-13 16:41:35 +01:00
Michael Schurter
b4d3a610db agent: validate reserved_ports are valid
Goal is to fix at least one of the causes that can cause a node to be
ineligible to receive work:
https://github.com/hashicorp/nomad/issues/9506#issuecomment-1002880600
2022-01-12 14:21:47 -08:00
James Rasell
0a571b7389 agent: clarify error info when data dir needs setting. 2021-10-28 15:05:56 +02:00
Michael Schurter
fc89835daf client: improve errors & tests for dynamic ports 2021-10-13 16:25:25 -07:00
James Rasell
87bfe0e558 Merge pull request #9027 from hashicorp/f-gh-9026
cli: move tests to use NewMockUi func.
2020-10-06 08:28:18 +02:00
Chris Baker
b0c2e5176a updated docs and validation to further prohibit null chars in region, datacenter, and job name 2020-10-05 18:01:50 +00:00
James Rasell
f5567b3261 cli: move tests to use NewMockUi func. 2020-10-05 16:07:41 +02:00
Chris Baker
cdcc1db700 refactored config validation into a new method, modified Meta.Client
tests appropriately
2019-01-08 15:07:36 +00:00
Chris Baker
31f82895a9 added validation on client metadata keys 2019-01-07 17:16:38 +00:00
Alex Dadgar
9c6de4bb20 plugin dir parsing 2018-08-30 13:43:09 -07:00
Chelsea Holland Komlo
5b7027d9ec refactor to retryJoiner interface 2018-05-07 16:57:06 -04:00
Josh Soref
d171cda670 spelling: preemptively 2018-03-11 17:58:48 +00:00
Alex Dadgar
e1b1465081 Standardize retrieving a free port into a helper package 2017-10-23 16:48:20 -07:00
Alex Dadgar
7b7ef952f5 Fix tests 2017-08-16 16:26:52 -07:00
Alex Dadgar
a73e945067 More parallel 2017-07-20 09:36:34 -07:00
Alex Dadgar
1d7588a1fc Fix TestRetryJoin 2016-11-15 15:28:21 -08:00
Michael Schurter
1304ba8b2d Addresses are just addresses - no ports
Store address+port in an unexported field for ease-of-use
2016-11-09 11:49:55 -08:00
Michael Schurter
1e0b4d76e8 Fix test that fails now that advertise can't be localhost 2016-11-08 16:22:04 -08:00
Alex Dadgar
d536fe9027 Remove all calls to the default logger 2015-12-11 15:02:13 -08:00
Chris Aubuchon
0d0fe0a408 Add cluster join command line options and configuration options 2015-12-02 13:55:29 -06:00
Alex Dadgar
e9254c5f2d Don't enfoce that the agent can't be run as both server and client 2015-10-01 17:27:36 -07:00
Alex Dadgar
c84fd2b292 Add parsing of client configuration from the commandline 2015-10-01 16:46:42 -07:00
Ryan Uber
8c76a1bfc0 agent: test agent command args 2015-09-22 14:04:40 -07:00