Commit Graph

2593 Commits

Author SHA1 Message Date
Michael Schurter
ec43315e13 Fix regression by returning error on unknown alloc 2017-11-01 15:16:38 -05:00
Michael Schurter
a3ea8302bf Fix race in test 2017-11-01 15:16:38 -05:00
Michael Schurter
fb3a780b7a Trigger GCs after alloc changes
GC much more aggressively by triggering GCs when allocations become
terminal as well as after new allocations are added.
2017-11-01 15:16:38 -05:00
Michael Schurter
9c1e595e2e Fix GC'd alloc tracking
The Client.allocs map now contains all AllocRunners again, not just
un-GC'd AllocRunners. Client.allocs is only pruned when the server GCs
allocs.

Also stops logging "marked for GC" twice.
2017-11-01 15:16:38 -05:00
Alex Dadgar
af7e1413a5 fix test 2017-10-30 12:35:31 -07:00
Alex Dadgar
05bb446323 Node access is done using locked Node copy
Fixes https://github.com/hashicorp/nomad/issues/3454

Reliably reproduced the data race before by having a fingerprinter
change the nodes attributes every millisecond and syncing at the same
rate. With fix, did not ever panic.
2017-10-27 13:27:24 -07:00
Alex Dadgar
f5549a6eb9 go style vars 2017-10-25 10:49:34 -07:00
Alex Dadgar
366e91276f fix two flaky tests 2017-10-23 18:15:52 -07:00
Alex Dadgar
8accabcd87 move to consul freeport implementation 2017-10-23 16:51:40 -07:00
Alex Dadgar
e1b1465081 Standardize retrieving a free port into a helper package 2017-10-23 16:48:20 -07:00
Alex Dadgar
3be474b811 don't double parallel 2017-10-23 16:48:06 -07:00
Alex Dadgar
41773c3fdf respond to comments 2017-10-23 15:50:27 -07:00
Alex Dadgar
5b4e31bb5b Skip if no docker 2017-10-19 16:55:10 -07:00
Alex Dadgar
8de487c241 fix flaky java tests 2017-10-19 16:49:57 -07:00
Alex Dadgar
e175c56082 Undo darwin user setting 2017-10-19 16:49:57 -07:00
Alex Dadgar
651159077b Run as user on mac 2017-10-19 16:49:57 -07:00
Alex Dadgar
838e7cbac9 sudo docker works 2017-10-19 16:49:57 -07:00
Alex Dadgar
039c1f84c6 docker tests 2017-10-19 16:49:57 -07:00
Michael Schurter
4a6255b6c6 Add logging around moby/moby#32648 bug 2017-10-18 10:44:03 -07:00
Michael Schurter
87b86230c4 Properly fail rkt fingerprinting on old vesions 2017-10-16 13:58:58 -07:00
Michael Schurter
dbc3a3baaa Squelch repeated rkt version warnings 2017-10-16 12:09:47 -07:00
Michael Schurter
f6f8c3dafd Test fixes from #3383 2017-10-13 15:45:35 -07:00
Michael Schurter
dd17810706 Merge pull request #3383 from hashicorp/b-migrate-token
base64 migrate token
2017-10-13 13:46:54 -07:00
Michael Schurter
897df36b4f Merge pull request #3376 from hashicorp/f-node-acls
Allow Node.SecretID for Node.GetNode and Allocs.GetAlloc
2017-10-13 11:51:48 -07:00
Michael Schurter
0d535aea95 base64 migrate token
HTTP header values must be ASCII.

Also constant time compare tokens and test the generate and compare
helper functions.
2017-10-13 10:59:13 -07:00
Alex Dadgar
1f3920ffdf rkt remove allocid 2017-10-13 10:07:50 -07:00
Adam Stankiewicz
79eccb2b1e Remove AllocID from ExecutorContext 2017-10-13 17:07:49 +02:00
Michael Schurter
5317c17e93 Alloc watcher must send Node.SecretID as AuthToken
An auth token is required if ACLs are enabled
2017-10-12 16:38:02 -07:00
Michael Schurter
fae8e7f699 SecretID -> AuthToken 2017-10-12 15:16:33 -07:00
Michael Schurter
1b21130dae Don't panic on unexpeced Consul response
Fixes #3326
2017-10-11 18:25:54 -07:00
Chelsea Holland Komlo
76b2c50dbc fix up build warnings 2017-10-11 17:11:57 -07:00
Chelsea Holland Komlo
2368068355 fixing up code review comments 2017-10-11 17:09:20 -07:00
Chelsea Holland Komlo
38f8217ea0 add tests for functionality 2017-10-11 17:09:20 -07:00
Chelsea Holland Komlo
fba1653057 Add functionality for authenticated volumes 2017-10-11 17:09:20 -07:00
Alex Dadgar
2c4c6b6ff6 Nomad UI Command 2017-10-09 23:01:55 -07:00
Michael Schurter
9b456787d0 Merge pull request #3288 from simar7/qemu-improvements
qemu: Add bound checks for memory assignment
2017-10-02 14:47:05 -07:00
Simarpreet Singh
d45670863c qemu: Fix lower memory bound to 128M
Signed-off-by: Simarpreet Singh <simar@linux.com>
2017-10-02 14:29:44 -07:00
Simarpreet Singh
82b8766da8 gofmt: format qemu.go and qemu_test.go
Signed-off-by: Simarpreet Singh <simar@linux.com>
2017-10-02 13:16:48 -07:00
Michael Schurter
04b8f8e7fc Remove structs import from api
Goes a step further and removes structs import from api's tests as well
by moving GenerateUUID to its own package.
2017-09-29 10:36:08 -07:00
Michael Schurter
900e708577 Properly autodetect Docker IP in Windows
Our Docker network plugin autodetection code was erroneously treating
Window's default network `nat` as a plugin and defaulting to it instead
of the host.

Fixes #3218
2017-09-27 16:49:23 -07:00
Michael Schurter
08f8411163 Only build rkt driver on linux
Build stub for non-linux targets
2017-09-27 14:21:45 -07:00
Simarpreet Singh
0fa2f3cbde qemu: Add bound checks for memory assignment
Signed-off-by: Simarpreet Singh <simar@linux.com>
2017-09-26 21:07:48 -07:00
Michael Schurter
eeeb544a2d Merge pull request #3256 from dalegaard/master
Enable rkt driver to use address_mode = 'driver'
2017-09-26 18:04:37 -05:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Lasse Dalegaard
5decea6a59 Ignore rkt network failure if container died early
If the container dies before the network can be read, we now ignore the
error coming out of the network information polling loop. Nomad will
restart the task regardless, so we might be masking the actual error.

The polling loop for the rkt network information, inside the `Start`
method, was getting a bit unwieldy. It's been refactored out so it's not
a seperate function.
2017-09-27 00:15:27 +02:00
Lasse Dalegaard
c359ba44a5 Make rkt port mapping test not exit immediately
The rkt port mapping test currently starts redis with --version, which
obviously makes redis exit again almost immediately. This means that the
container exists before the network status can be queried, and so the
test fails.
2017-09-26 23:10:24 +02:00
Lasse Dalegaard
b537f16eff Improve rkt driver network status poll loop
The network status poll loop will now report any networks it ignored, as
well as a no-networks situations.
2017-09-26 21:49:45 +02:00
Lasse Dalegaard
eade50b938 Refactor rkt network status loop
The network status poll loop for the rkt drivers `Start` method was a
bit messy, and could not display the last encountered error. Here we
clean it up.
2017-09-26 21:27:12 +02:00
Lasse Dalegaard
a7f5f8a363 Small logging fix in rkt/driver 2017-09-26 19:36:13 +02:00
Lasse Dalegaard
dd934a60a7 Bump minimum rkt version to 1.27.0.
The changes introduces in #3256 require at least rkt 1.27.0 because of
a bug in the JSON output of `rkt status` in previous versions.

Here we upgrade all references to rkt's minimum version, and also make
travis and vagrant use this version when running tests.

Finally we add a CHANGELOG notice.
2017-09-26 19:15:43 +02:00