Commit Graph

21040 Commits

Author SHA1 Message Date
Tim Gross
bca3aa938b CSI: fix wrong RPC name on ListSnapshots 2021-04-07 12:00:33 -04:00
Tim Gross
6a5fe39c80 CSI: fix decoding error on snapshot create
Consumers of the CSI HTTP API are expecting a response object and not a slice
of snapshots. Fix the return value.
2021-04-07 12:00:33 -04:00
Tim Gross
32fb81dd25 CSI: capability check ListVolumes at RPC for nicer error messages
The plugin stub object does not include fine-grained capability checks, which
means `nomad volume status -verbose` will return ugly and verbose error
"Unimplemented" messages from the plugin if it does not support the CSI
`ListVolumes` RPC. Return a nicer error message from our RPC handler instead.
2021-04-07 12:00:22 -04:00
Tim Gross
ddc73681a3 CSI: fix HTTP routing for external volume list
The HTTP router did not correctly route `/v1/volumes/external` without being
explicitly added to the top-level router. Break this out into its own request
handler.
2021-04-07 12:00:22 -04:00
Tim Gross
cd2eea1286 CSI: fix early return on error from list external volumes command
If a plugin returns an error, we should continue at the outer scope to query
the next plugin, otherwise we just retry the plugin we got an error
on (potentially infinitely if it's an invalid request like an unsupported
plugin).
2021-04-07 12:00:22 -04:00
Tim Gross
73c95a92b0 docs: update CSI create/register fields
Add new `access_mode`/`attachment_mode` fields. Make it more clear which set
of fields belong to create vs register. Update the example spec that's
generated by `volume init`.
2021-04-07 11:24:09 -04:00
Tim Gross
a37af3100e CSI: use AccessMode/AttachmentMode from CSIVolumeClaim
Registration of Nomad volumes previously allowed for a single volume
capability (access mode + attachment mode pair). The recent `volume create`
command requires that we pass a list of requested capabilities, but the
existing workflow for claiming volumes and attaching them on the client
assumed that the volume's single capability was correct and unchanging.

Add `AccessMode` and `AttachmentMode` to `CSIVolumeClaim`, use these fields to
set the initial claim value, and add backwards compatibility logic to handle
the existing volumes that already have claims without these fields.
2021-04-07 11:24:09 -04:00
Tim Gross
0c51bb02dd refactor: move VolumeRequest validation to Validate method 2021-04-07 11:24:09 -04:00
Tim Gross
144239600d refactor: internal claim methods should be private 2021-04-07 11:24:09 -04:00
Chris Baker
ca6671914d Merge pull request #10302 from hashicorp/f-10301-api-header-race-condition
fix potential race condition in API client
2021-04-07 07:00:26 -05:00
Chris Baker
aef0e4a676 third attempt at fixing circle 2021-04-06 21:29:55 +00:00
Chris Baker
04166d6c80 second attempt at fixing circle 2021-04-06 21:00:45 +00:00
Chris Baker
1da78a43dc refactor enable_race circleci parameter 2021-04-06 20:38:52 +00:00
Chris Baker
c249b8d444 updated changelog 2021-04-06 20:27:12 +00:00
Chris Baker
6064867251 sdk: header map copy to avoid race condition in #10301 2021-04-06 18:06:27 +00:00
Chris Baker
4e25e8e235 documenting test for #10301
enable -race detector for testing api
2021-04-06 17:31:29 +00:00
Luiz Aoqui
6caee502bf docs: add empty_ignore_system node selector strategy for autoscaling (#10306) 2021-04-06 13:02:56 -04:00
Seth Hoenig
3f4b175cd4 Merge pull request #10307 from hashicorp/f-go-get-buf
build: install buf during bootstrap
2021-04-06 10:06:14 -06:00
Seth Hoenig
c85bbbee70 build: install buf during bootstrap
Previously installing buf was left out of `make bootstrap` because it
had conflicts with the `tools/go.mod` file and dependencies used by
other tools. With Go 1.16 we eliminated that `go.mod` file, and can
now just install `buf` with `go install` like everything else.
2021-04-06 09:42:44 -06:00
Michael Lange
b206efefaf Merge pull request #10303 from hashicorp/d/broken-link-bootstrap-scheduler
Fix the broken link in the bootstrapping custom scheduler warning
2021-04-05 15:04:19 -07:00
Michael Lange
e99d5a86e6 Fix the broken link in the bootstrapping custom scheduler warning 2021-04-05 14:27:22 -07:00
Drew Bailey
af00546d2d allow setting stale flag from cli to retrieve individual server license (#10300) 2021-04-05 15:35:14 -04:00
Seth Hoenig
dd21e8cea6 Merge pull request #10235 from hashicorp/f-cns-oss
consul: plumbing for specifying consul namespace in job/group
2021-04-05 10:33:44 -06:00
Seth Hoenig
28038bdf47 consul: minor CR cleanup 2021-04-05 10:10:16 -06:00
Seth Hoenig
2922839fff docs: apply suggestions from code review
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-04-05 10:03:19 -06:00
Seth Hoenig
a97254fa20 consul: plubming for specifying consul namespace in job/group
This PR adds the common OSS changes for adding support for Consul Namespaces,
which is going to be a Nomad Enterprise feature. There is no new functionality
provided by this changeset and hopefully no new bugs.
2021-04-05 10:03:19 -06:00
Drew Bailey
5c3399853d changelog entry for on_update configuration settings (#10299)
* changelog entry for on_update configuration settings

* Update CHANGELOG.md

Co-authored-by: Tim Gross <tgross@hashicorp.com>

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-04-05 11:04:03 -04:00
Drew Bailey
efaa22b397 license changelog (#10298) 2021-04-05 10:57:20 -04:00
Mahmood Ali
421056edde Merge pull request #10295 from greut/chore/bump-golangci-lint-to-v1.39
chore: bump golangci-lint from v1.24 to v1.39
2021-04-03 08:40:10 -04:00
Yoan Blanc
3bfde04f40 fixup! chore: bump golangci-lint from v1.24 to v1.39
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2021-04-03 13:41:05 +02:00
Yoan Blanc
4a1392aaec fix: golangci-lint with -mod=vendor
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2021-04-03 10:25:06 +02:00
Yoan Blanc
a814f0253f chore: bump golangci-lint from v1.24 to v1.39
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2021-04-03 09:50:23 +02:00
Michael Schurter
3db2f2f9f5 Merge pull request #10294 from hashicorp/schmichael-patch-1
docs: specify buf v0.30.1
2021-04-02 13:06:20 -07:00
Michael Schurter
46fbebd7b2 docs: specify buf v0.30.1
If you use too new of a `buf` you will hit #10293
2021-04-02 12:40:09 -07:00
Mahmood Ali
33628b5038 Merge pull request #10286 from hashicorp/b-executor-stats
Memory stats for cgroup-v2
2021-04-02 12:27:55 -04:00
Mahmood Ali
13a9e4bc31 reuse existing function and typo fix 2021-04-02 11:56:27 -04:00
Tim Gross
b1458b0861 CSI: correctly handly empty capacity fields during registration
When a volume is registered via `nomad volume register` and not via the
creation workflow, it may not have any of the capacity fields set (as they're
not used for registration). Handle this case without error, and let the
downstream RPCs handle the error case for `nomad volume create`.
2021-04-02 11:48:26 -04:00
Drew Bailey
d72a9b6f29 remove flakey exec test that tests non-deterministic docker behavior (#10291) 2021-04-02 11:15:22 -04:00
Chris Baker
e3346307fd Merge pull request #10290 from hashicorp/f-move-json-handles-back-to-structs-package
move json handle back to `structs`
2021-04-02 09:12:35 -05:00
Chris Baker
a9488cf652 added missing import from command/agent 2021-04-02 13:53:28 +00:00
Chris Baker
cb3d6ece21 json handles were moved to a new package in #10202
this was unecessary after refactoring, so this moves them back to their
original location in package structs
2021-04-02 13:31:10 +00:00
Mahmood Ali
0b51d882e0 Merge pull request #10285 from hashicorp/build-no-codegen-by-default
dev: ignore msgpack codegen code in dev by default
2021-04-01 22:03:01 -04:00
Mahmood Ali
f14921d41d cli: Show memory usage instead of RSS
If a task doesn't report RSS, let's use memory usage.
2021-04-01 20:26:41 -04:00
Chris Baker
f1cb714a39 Merge pull request #10202 from hashicorp/f-node-drain-api
remove deprecated `Drain` field from `structs.Node`
2021-04-01 16:48:53 -05:00
Mahmood Ali
c868444b44 dev: ignore msgpack codegen code in dev by default
This change disables using msgpack generated serializers in dev by
default.

In released binaries, we use code-generated msgpack serializers to
improve performance.  However, in development, code generated
serializers are a pain. If a developer forgets to re-generate code, the
code generated gets out of sync with the go structs, and result into
subtle bugs where some values appear not to persist as expected.

The CI and release scripts will continue to use the msgpack
code-generation. Devs who want to test locally can set
`GO_TAGS=codegen_generated` as well.
2021-04-01 16:27:18 -04:00
Chris Baker
80066ac798 Merge branch 'main' into f-node-drain-api 2021-04-01 15:22:57 -05:00
James Rasell
442d640704 docs: add fixed-value and pass-through autoscaler plugin docs. (#10278)
docs: add fixed-value and pass-through autoscaler plugin docs.
2021-04-01 16:11:37 -04:00
Luiz Aoqui
71d5d17d7d Merge pull request #10199 from hashicorp/docs-update-autoscaling-aws-permission
docs: Update AWS permission requirements for the Autoscaler
2021-04-01 16:10:28 -04:00
Luiz Aoqui
eff770046d Merge pull request #10183 from hashicorp/docs-autoscaling-policy-eval-cli
docs: add Autoscaler CLI flags for policy eval configuration
2021-04-01 16:10:01 -04:00
Tim Gross
c12c90262d CSI: fingerprint detailed node capabilities
In order to support new node RPCs, we need to fingerprint plugin capabilities
in more detail. This changeset mirrors recent work to fingerprint controller
capabilities, but is not yet in use by any Nomad RPC.
2021-04-01 16:00:58 -04:00