Commit Graph

13355 Commits

Author SHA1 Message Date
Danielle Tomlinson
ac8adc2ca7 Merge pull request #4938 from hashicorp/b-fix-make
make: Fix invocation of vault e2e test
2018-11-29 21:15:06 +01:00
Omar Khawaja
c5905a9fc9 fix step 5 broken link (#4939) 2018-11-29 14:35:39 -05:00
Mahmood Ali
e78c4365a7 Merge pull request #4937 from hashicorp/b-vault-panic
vault: protect against empty Vault secret response

Fixes #4921

Sadly, we don't have proper mechanism to mock Vault client, so not sure how to best test this.

I inspected the Vault client interactions, specially for cases where returned value is nil even if the error is also nil.  I believe we covered all correctly now:
* [`v.client.Sys().InitStatus()`](f3853f11da/nomad/vault.go (L427)) - the value is non-nil boolean
* [`v.client.Sys().CapabilitiesSelf(path)`](f3853f11da/nomad/vault.go (L812)): Capabilities handles empty bodies in [`hasCapability`](f3853f11da/vendor/github.com/hashicorp/vault/api/sys_capabilities.go (L43-L45)) - also the `nil` array is handled with proper fail-safe default.
* [`v.client.Logical().Read(fmt.Sprintf("auth/token/roles/%s", role))`](f3853f11da/nomad/vault.go (L834-L840)) handles when `rsecret` is nil
2018-11-29 10:35:58 -05:00
Danielle Tomlinson
4dfd952e05 make: Fix invocation of vault e2e test 2018-11-29 15:37:26 +01:00
Mahmood Ali
f3853f11da vault: protect against empty Vault secret response
Also, fix a case where a successful second attempt of loading token can
cause a panic.
2018-11-29 09:34:17 -05:00
Chris Baker
6f2502e803 Merge pull request #4932 from hashicorp/b-1172-rkt-env-vars
change to testing utilities to fix rkt tests
2018-11-29 09:18:10 -05:00
Nick Ethier
97c9e42fbe Merge pull request #4922 from hashicorp/f-drivermananger
add generic plugin manager interface and orchestration
2018-11-28 22:17:04 -05:00
Chris Baker
72ca56dabe testing: in MkAllocDir, do not update TaskConfig with All() from the task builder, just with Env() (because it pollutes environment variables with node attributes and fails the rkt tests) 2018-11-28 22:19:48 +00:00
Preetha
be65442002 Merge pull request #4919 from hashicorp/f-fingerprint-attribute-type
Modify fingerprint interface to use typed attribute struct
2018-11-28 14:18:28 -06:00
Preetha Appan
22ddb4d18d Fix lxc test panic 2018-11-28 13:56:17 -06:00
Michael Schurter
8cdce8b257 Merge pull request #4894 from hashicorp/f-device-hook
Device hook and devices affect computed node class
2018-11-28 12:10:43 -06:00
Preetha Appan
76f27a111d Fix failing lxc test 2018-11-28 11:05:35 -06:00
Preetha Appan
27fb643f5e Fix LXC driver fingerprint to use typedattributes 2018-11-28 10:09:10 -06:00
Preetha Appan
d36ba880a3 Fix docker driver to use new fingerprint typed attributes 2018-11-28 10:01:03 -06:00
Preetha Appan
829bf74aa8 modify fingerprint interface to use typed attribute struct 2018-11-28 10:01:03 -06:00
Nick Ethier
6352052211 client/plugin: remove println from plugin group func 2018-11-27 22:45:09 -05:00
Nick Ethier
6ead1a8f72 client/plugin: lint/spelling errors 2018-11-27 22:45:09 -05:00
Nick Ethier
5b11495b31 client/plugin: add generic plugin mananger interface and orchestration 2018-11-27 22:45:03 -05:00
Mahmood Ali
4922256170 Merge pull request #4918 from hashicorp/f-lxc-driver
Add LXC driver
2018-11-27 22:06:42 -05:00
Mahmood Ali
aa28f71bbe address review comments 2018-11-27 21:40:43 -05:00
Mahmood Ali
b546247626 Add Driver Plugin for LXC 2018-11-27 21:40:43 -05:00
Mahmood Ali
90daa8b2d3 Fixes in old lxc driver 2018-11-27 21:40:43 -05:00
Mahmood Ali
08349b5a94 Update go-lxc library to handle LXC 3.0 2018-11-27 21:40:43 -05:00
Michael Schurter
b959d9831c add nil check around task resources in device hook
Looking at NewTaskRunner I'm unsure whether TaskRunner.TaskResources
(from which req.TaskResources is set) is intended to be nil at times or
if the TODO in NewTaskRunner is intended to ensure it is always non-nil.
2018-11-27 17:25:33 -08:00
Michael Schurter
c7b4ee1546 assume that slices contain only non-nil items 2018-11-27 17:25:33 -08:00
Michael Schurter
a13607f2d9 client: properly support hook env vars
The old approach was incomplete. Hook env vars are now:

 * persisted and restored between agent restarts
 * deterministic (LWW if 2 hooks set the same key)
2018-11-27 17:25:33 -08:00
Alex Dadgar
429c5bb885 Device hook and devices affect computed node class
This PR introduces a device hook that retrieves the device mount
information for an allocation. It also updates the computed node class
computation to take into account devices.

TODO Fix the task runner unit test. The environment variable is being
lost even though it is being properly set in the prestart hook.
2018-11-27 17:25:33 -08:00
Michael Schurter
60aadc853b gofmt -s -w drivers/rkt/driver_test.go 2018-11-27 17:24:23 -08:00
Michael Schurter
e660046f06 Merge pull request #4896 from hashicorp/b-prevalloc-deadlock
Fix deadlock in previous alloc watcher by emitting last alloc update
2018-11-27 19:07:16 -06:00
Michael Schurter
3a61c2bb37 fix test breakage caused by rebase 2018-11-27 16:34:01 -08:00
Michael Schurter
518d03d7cd fix mispelings 2018-11-27 16:33:55 -08:00
Chris Baker
e3108507c5 Merge pull request #4891 from hashicorp/b-1150-rkt-volume-names
drivers/rkt: fix invalid volumes
2018-11-27 18:55:00 -05:00
Chris Baker
f84045098c change to docs in the driver proto to reflect standard pattern 2018-11-27 23:52:24 +00:00
Danielle Tomlinson
d361015562 Merge pull request #4909 from hashicorp/b-restart-delay
taskrunner: Return the restart delay correctly
2018-11-27 23:55:54 +01:00
Michael Schurter
748448970b client: comment on importance of chan ops ordering 2018-11-27 14:11:32 -08:00
Mahmood Ali
9e1d51659b Update client/structs/broadcaster.go
Co-Authored-By: schmichael <michael.schurter@gmail.com>
2018-11-27 14:06:08 -08:00
Michael Schurter
ff7df70f32 client: fix send-after-close in broadcaster 2018-11-27 14:06:08 -08:00
Michael Schurter
17a611bf98 client: check if prev alloc is already terminated
This is a defensive fast-path as 7c6aa0be already fixed the deadlock.
2018-11-27 14:06:08 -08:00
Michael Schurter
6d49163b12 client: emit last sent alloc to new listeners
Fixes a deadlock where the allocwatcher would block forever waiting for
an update from a terminal alloc.

Made the broadcaster easier to debug as well.
2018-11-27 14:06:08 -08:00
Michael Schurter
5d6d4bf290 Merge pull request #4883 from hashicorp/f-graceful-shutdown
Support graceful shutdowns in agent
2018-11-27 15:55:15 -06:00
Omar Khawaja
b4e3544ff7 New Nomad Vault Integration Guide (#4886)
* add vault integration guide in guides section and move current vault integration content to docs section

* complete guide with image

* fix typos

* rename step 6 and fix typos

* fix typos and awkward phrasing along with links

* fix duplicated step #

* fix typo

* fix links so that pages that pointed to the original vault integration content still point there
2018-11-27 10:28:01 -05:00
Preetha Appan
0af9e85812 Fix panic in test setup when task does not have resources
This affects exec/rawexec drivers
2018-11-26 21:42:45 -06:00
Preetha Appan
22ac0498ca Fix nil dereference in copy method 2018-11-26 15:53:15 -06:00
Chris Baker
4b6faec9bc drivers/rkt: updated test to include new AllocID field in TaskConfig 2018-11-26 21:37:58 +00:00
Michael Schurter
f06b2a872d client: fix races in use of goroutine group
The group utility struct does not support asynchronously launched
goroutines (goroutines-inside-of-goroutines), so switch those uses to a
normal go call.

This means watchNodeUpdates and watchNodeEvents may not be shutdown when
Shutdown() exits. During nomad agent shutdown this does not matter.

During tests this means a test may leak those goroutines or be unable to
know when those goroutines have exited.

Since there's no runtime impact and these goroutines do not affect alloc
state syncing it seems ok to risk leaking them.
2018-11-26 12:52:55 -08:00
Michael Schurter
0efa2d24e4 client: reuse group instead of diy'ing it 2018-11-26 12:52:31 -08:00
Michael Schurter
134c04744e client/ar: remove useless wait ch from runTasks
Arguably this makes task.WaitCh() useless, but I think exposing a wait
chan from TaskRunners is a generically useful API.
2018-11-26 12:51:18 -08:00
Michael Schurter
021c0cc4bf client: document how AR/TR Run methods behave 2018-11-26 12:50:35 -08:00
Omar Khawaja
8a38680ae1 Move current telemetry page to docs (#4898)
* move current telemetry page to docs

* fix broken links to telemetry doc
2018-11-26 15:18:57 -05:00
Chris Baker
790fe0b1db modified TaskConfig to include AllocID
use this for volume names in drivers/rkt to address #1150
2018-11-26 18:54:26 +00:00