Commit graph

17843 commits

Author SHA1 Message Date
Mahmood Ali 2f557751ca Update testify library to v1.5.1
Pick up a panic fix of f1bd0923b8

Some CirleCI builds fail somewhat mysteriously, e.g. https://circleci.com/gh/hashicorp/nomad/52676 , due to this bug.  The test json file emit the following:

```
{"Time":"2020-03-28T12:03:08.602544522Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"panic: send on closed channel\n"}
{"Time":"2020-03-28T12:03:08.602576075Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"\n"}
{"Time":"2020-03-28T12:03:08.602584429Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"goroutine 403 [running]:\n"}
{"Time":"2020-03-28T12:03:08.602590561Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"github.com/hashicorp/nomad/vendor/github.com/stretchr/testify/assert.Eventually.func1(0xc000a78000, 0xc0009cf160)\n"}
{"Time":"2020-03-28T12:03:08.602598464Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"\t/home/circleci/go/src/github.com/hashicorp/nomad/vendor/github.com/stretchr/testify/assert/assertions.go:1494 +0x47\n"}
{"Time":"2020-03-28T12:03:08.602604952Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"created by github.com/hashicorp/nomad/vendor/github.com/stretchr/testify/assert.Eventually\n"}
```
2020-03-30 07:06:52 -04:00
Mahmood Ali dedf1cd3d7 tests: remove TestHTTP_NodeDrain_Compat
Nomad 0.11 servers no longer support having pre-0.8 clients.
2020-03-30 07:06:52 -04:00
Mahmood Ali 8b2b3f99d3 tests: deflake TestHTTP_NodeDrain
A node may be recognized as not running any allocs and have its drain
flag reset before the test queries it.
2020-03-30 07:06:52 -04:00
Mahmood Ali b0cc23ae63 tests: deflake TestConsul_PeriodicSync 2020-03-30 07:06:47 -04:00
Chris Baker 2169eb6b3b
Merge pull request #7541 from hashicorp/b-7539-persist-snapshot-scaling-policy-table
support for persist/restore snapshot of scaling_policy table
2020-03-29 18:59:20 -05:00
Chris Baker d6287c43b9 clean up some tests 2020-03-29 23:38:36 +00:00
Jorge Marey 3731b70e03 Add new setUpstreamsLocked function to avoid lock 2020-03-29 20:34:04 +02:00
Chris Baker 5e3c38be2f state_store:
* added method to retrieve all scaling policies for use in snapshotting, plus test
* better testing for ScalingPoliciesByNamespace
* added scaling policy snapshot persist and restore (and test of restore)

manually tested snapshot restore.

resolves #7539
2020-03-29 13:32:44 +00:00
Mahmood Ali 887292d757
Resolve docker types conflict
Looks like the latest `github.com/docker/docker/registry.ResolveAuthConfig` expect
`github.com/docker/docker/api/types.AuthConfig` rather than
`github.com/docker/cli/cli/config/types.AuthConfig`. The two types are
identical but live in different packages.

Here, we embed `registry.ResolveAuthConfig` from upstream repo, but with
the signature we need.
2020-03-28 17:29:06 +01:00
Yoan Blanc 1d92edbbbe
docker: v19.03.8
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-28 17:29:04 +01:00
Mahmood Ali ec6afa5795 windows: support -dev mode
Support running `nomad agent -dev` in Windows, by setting proper network
interface.

Prior to this change, `nomad` uses `lo` interface but Windows uses
"Loopback Pseudo-Interface 1" to refer to loopback device interface:
https://github.com/golang/go/blob/go1.14.1/src/net/net_windows_test.go#L304-L318
.
2020-03-28 12:01:51 -04:00
Mahmood Ali 55ab85b30c
Merge pull request #7530 from greut/go-connections-v0.4.0
vendor: go-connections v0.4.0
2020-03-28 11:26:18 -04:00
Yoan Blanc ffe1bd9470
vendor: go-connections v0.4.0
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-28 08:09:13 +01:00
Jeff Escalante 255bfdfa66 update docs-page component to fix jump to section 2020-03-27 20:23:20 -04:00
Jeff Escalante 6bf670f931 add styling to offset permalinks from sticky nav 2020-03-27 20:23:20 -04:00
Charlie Voiselle 4f71d9d4d3
Merge pull request #7503 from hashicorp/docs-system-no-deploy
[docs] System scheduler doesn't do deployments.
2020-03-27 19:24:13 -04:00
Michael Schurter 63760dae24
Merge pull request #7525 from hashicorp/docs-netns-note
docs: improve wording of linux requirement
2020-03-27 15:04:41 -07:00
Michael Schurter e7812acde2 docs: improve wording of linux requirement 2020-03-27 13:56:37 -07:00
Charlie Voiselle fe8c7fa1d0
Merge pull request #7517 from hashicorp/docs-sunset-guides
Sunset /guide folder; Fix links
2020-03-27 15:27:16 -04:00
Charlie Voiselle 4e4fbbebdd fix search and replace error 2020-03-27 11:39:03 -04:00
Drew Bailey beb21d4fdb
Merge pull request #7520 from hashicorp/audit-httphandler
wrap http.Handlers
2020-03-27 10:31:29 -04:00
Drew Bailey a66b4be0f3
remove auditing for /ui/ 2020-03-27 10:12:42 -04:00
Drew Bailey de687edb2e
wrap http.Handlers
better comments
2020-03-27 09:35:10 -04:00
Charlie Voiselle 169a6f2ba2 Fixed pages with new changes 2020-03-26 19:58:26 -04:00
Charlie Voiselle 2d002ea9ac Fix double redirects
(cherry picked from commit 5cb4e48571609bf391e8dc0afcf832275990f33e)
2020-03-26 19:28:50 -04:00
Charlie Voiselle 3f2fb6ff00 Move ui guide redirects above catch-all
(cherry picked from commit 81298e3e5b1110a0f4d15e0641e59aee3514b059)
2020-03-26 19:28:40 -04:00
Charlie Voiselle b8cf42909d Fix whitespace
(cherry picked from commit 8e247ac192298ad54743a13b75c30b2572493adc)
2020-03-26 19:28:29 -04:00
Charlie Voiselle 23e5edb050 Fix ACL redirects; sort
(cherry picked from commit 624c411830a4f81232ae8e9007ba8f6b68b9f47e)
2020-03-26 19:28:19 -04:00
Charlie Voiselle a835c2ab09 Remove duplicate redirects
links ending with / and links without a terminal / are handled the same
according to the netlify redirect documenation

(cherry picked from commit 91171c6a1dd74e3396a66e35c27c6ec858c5977f)
2020-03-26 19:28:06 -04:00
Charlie Voiselle a72208eebe more links
(cherry picked from commit 0e39e2e49b0371c246dc1a9b4bb20af0b2f642a0)
2020-03-26 19:27:55 -04:00
Charlie Voiselle 4b580df670 fixing links
(cherry picked from commit 575f22e970e2429b8f9871f11b8c3e0924c82dc2)
2020-03-26 19:27:05 -04:00
Charlie Voiselle e1e1dab5fe correcting layout for reparented pages
(cherry picked from commit ce9d9b5e69fe5f47847cc511ffd73f6b43de92e7)
2020-03-26 19:26:52 -04:00
Charlie Voiselle 2328e3dcac link-fixup; move navigation 2020-03-26 19:26:38 -04:00
Charlie Voiselle 56016495ee Fix use-cases
(cherry picked from commit ac49040b9caa843fa78ef494baac3c6a08b15d45)
2020-03-26 19:20:56 -04:00
Charlie Voiselle 0aaca7d969 Removing guide folder
reparented some elements to docs.

(cherry picked from commit 4fa35e51e0e0d193bf81f4465f4e1ba4caa5b3ca)
2020-03-26 19:20:39 -04:00
Mahmood Ali c7097bac90
Merge pull request #7509 from hashicorp/b-ec2metadata-outside-aws
fingerprint: handle incomplete AWS imitation APIs
2020-03-26 18:27:43 -04:00
Lang Martin 50ff9ccd44
csi: plugin deregistration on plugin job GC (#7502)
* nomad/structs/csi: delete just one plugin type from a node

* nomad/structs/csi: add DeleteAlloc

* nomad/state/state_store: add deleteJobFromPlugin

* nomad/state/state_store: use DeleteAlloc not DeleteNodeType

* move CreateTestCSIPlugin to state to avoid an import cycle

* nomad/state/state_store_test: delete a plugin by deleting its jobs

* nomad/*_test: move CreateTestCSIPlugin to state

* nomad/state/state_store: update one plugin per transaction

* command/plugin_status_test: move CreateTestCSIPlugin

* nomad: csi: handle nils CSIPlugin methods, clarity
2020-03-26 17:07:18 -04:00
Mahmood Ali 6283a44870
Merge pull request #7257 from bbckr/avoid-resolving-dot-in-named-pipe
Avoid resolving dotted segments when host path for volume is named pipe
2020-03-26 16:59:29 -04:00
Jeff Escalante 78a9d7b856
Anchor Link Fixes (#7287) 2020-03-26 16:21:24 -04:00
Michael Lange 778ebcf816
Merge pull request #7512 from hashicorp/b-ui/null-host-volumes
UI: Guard against a null value for the HostVolumes hash
2020-03-26 11:17:55 -07:00
Michael Lange 2db4f5519a Guard against a null value for the HostVolumes hash
When a node has no host volumes, the API response will
have a null value for the HostVolumes attribute, which
in turn becomes a null value instead of an empty array
in the store. This protects against that, ensuring host
volumes is always an array.
2020-03-26 09:54:59 -07:00
Lang Martin 3375c92aa0
csi: make volume registration idempotent (#7490)
If not in use and not changing external ids, it should not be an error to register a volume again.

* nomad/state/state_store: make volume registration idempotent
2020-03-26 12:27:19 -04:00
Mahmood Ali 7985b1893f fixup! tests: Add tests for EC2 Metadata immitation cases 2020-03-26 11:37:54 -04:00
Mahmood Ali a1e7378c7b fixup! tests: Add tests for EC2 Metadata immitation cases 2020-03-26 11:33:44 -04:00
Mahmood Ali 1d50379bc6 fingerprint: handle incomplete AWS immitation APIs
Fix a regression where we accidentally started treating non-AWS
environments as AWS environments, resulting in bad networking settings.

Two factors some at play:

First, in [1], we accidentally switched the ultimate AWS test from
checking `ami-id` to `instance-id`.  This means that nomad started
treating more environments as AWS; e.g. Hetzner implements `instance-id`
but not `ami-id`.

Second, some of these environments return empty values instead of
errors!  Hetzner returns empty 200 response for `local-ipv4`, resulting
into bad networking configuration.

This change fix the situation by restoring the check to `ami-id` and
ensuring that we only set network configuration when the ip address is
not-empty.  Also, be more defensive around response whitespace input.

[1] https://github.com/hashicorp/nomad/pull/6779
2020-03-26 11:23:15 -04:00
Mahmood Ali b3de5d5721 tests: Add tests for EC2 Metadata immitation cases
Test that nomad doesn't set empty/bad network configuration when in an
environment that does incomplete immitation of EC2 Metadata API.
2020-03-26 11:13:21 -04:00
Yoan Blanc 139a0ae451
fixup! docker: drain fingerprint timer
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-26 16:02:20 +01:00
Yoan Blanc 5f0b3234f0
docker: drain fingerprint timer
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-26 16:00:53 +01:00
Lang Martin ea80330aaa
csi: nomad/structs: test volume denormalize without plugin (#7472) 2020-03-26 09:43:59 -04:00
Brandon Romano ba30101e40
Merge pull request #7504 from hashicorp/br.website-master-catchup
website: Miscellaneous cherry-picks from stable-website that was accidentally never pushed to master
2020-03-25 17:40:53 -07:00