Commit Graph

19818 Commits

Author SHA1 Message Date
James Rasell
4efee0979e website: bump default version to 0.12.7. 2020-10-26 13:08:21 +01:00
Tim Gross
58562234c5 changelog entry for #8967 (#9164) 2020-10-23 14:27:32 -04:00
Drew Bailey
fbb199d416 event sink crud operation api (#9155)
* network sink rpc/api plumbing

state store methods and restore

upsert sink test

get sink

delete sink

event sink list and tests

go generate new msg types

validate sink on upsert

* go generate
2020-10-23 14:23:00 -04:00
Michael Schurter
d002a8f391 Merge pull request #9135 from hashicorp/f-namespaces
core: open source namespaces
2020-10-23 10:23:55 -07:00
Kevin Pruett
2e8f0f373f Merge pull request #9156 from hashicorp/pruett.alertbanner-exp
Document new `expirationDate` prop for AlertBanner
2020-10-23 10:52:35 -04:00
Kevin Pruett
cebcca19ad Document new expirationDate prop for AlertBanner 2020-10-23 10:52:11 -04:00
Stefan Richter
55d00d77ae Add NOMAD_JOB_ID and NOMAD_JOB_PAERENT_ID env variables (#8967)
Beforehand tasks and field replacements did not have access to the
unique ID of their job or its parent. This adds this information as
new environment variables.
2020-10-23 10:49:58 -04:00
Tim Gross
e2f73f3d5c docs: add regression warning for GH-9148 to upgrade guide (#9157)
* docs: add regression warning for GH-9148 to upgrade guide
* changelog entry
2020-10-23 10:05:56 -04:00
Tim Gross
9e9dac4a2c Revert "e2e: fix destination of templates in VaultSecrets test (#9146)" (#9163)
This reverts commit 8aed53c177.
2020-10-23 09:01:25 -04:00
Michael Schurter
47b8db8a33 docs: namespaces are oss in Nomad 1.0 2020-10-22 15:26:32 -07:00
Michael Schurter
6c2f589ed0 Update generate_msgtypes.sh now that iota is gone 2020-10-22 15:26:32 -07:00
Michael Schurter
ecfcb0026e core: open source namespaces 2020-10-22 15:26:32 -07:00
Tim Gross
8a90b7eb16 artifact/template: make destination path absolute inside taskdir (#9149)
Prior to Nomad 0.12.5, you could use `${NOMAD_SECRETS_DIR}/mysecret.txt` as
the `artifact.destination` and `template.destination` because we would always
append the destination to the task working directory. In the recent security
patch we treated the `destination` absolute path as valid if it didn't escape
the working directory, but this breaks backwards compatibility and
interpolation of `destination` fields.

This changeset partially reverts the behavior so that we always append the
destination, but we also perform the escape check on that new destination
after interpolation so the security hole is closed.

Also, ConsulTemplate test should exercise interpolation
2020-10-22 15:47:49 -04:00
Buck Doyle
5237c11817 Add logged Faker seed when none is set in tests (#9140)
This will hopefully make it easier to reproduce test failures
that happen intermittently, especially in CI.
2020-10-22 13:45:51 -05:00
Mahmood Ali
ec3650fe17 Merge pull request #9142 from hashicorp/f-hclv2-2.3
Support HCLv2 for Nomad jobs
2020-10-22 12:26:28 -05:00
Tim Gross
8aed53c177 e2e: fix destination of templates in VaultSecrets test (#9146)
The `$NOMAD_SECRETS_DIR` environment variable is rendered as `/secrets`, which
prior to the recent security patch would unintentionally escape the file
sandbox and get dropped in a directory named `/secrets` where the Nomad client
binary was running. The `VaultSecrets` test was accidentally relying on this
behavior and that causes the test to fail.
2020-10-22 13:00:08 -04:00
Drew Bailey
3347b40d11 remove event durability (#9147)
* remove event durability

temporarily removing go-memdb event durability until a new strategy is developed on how to best handled increased durability needs

* drop events table schema and state store methods

* fix neweventbuffer invocations
2020-10-22 12:21:03 -04:00
Mahmood Ali
93bbe181e0 address review feedback 2020-10-22 11:49:37 -04:00
davidr912
ca1cb4b484 Update job/plan documentation (#9145)
Updated to reflect plan expects the job definition as JSON object and not as the string form of the JSON
2020-10-22 10:17:47 -04:00
Mahmood Ali
4d76e8bd79 Don't parse the server-set fields of the job struct 2020-10-22 08:18:57 -04:00
Tim Gross
fc1b0c11e6 csi: prevent in-use plugin GC from blocking volume GC (#9141)
During CSI plugin GC, we don't return an error if the volume is in use,
because this is not an error condition. If we were to return an error during a
`nomad system gc`, we would not continue on to GC volumes.

But check for the specific error message fails if the GC is performed on a
worker rather than on the leader, due to RPC forwarding wrapping the error
message. Use a less specific test so that we don't return an error.
2020-10-21 16:54:28 -04:00
Mahmood Ali
9fe7423403 api: update /render api to parse hclv2 2020-10-21 15:46:57 -04:00
Mahmood Ali
1d85c6a4eb cli: use HCLv2 parser
Also, fallback to using HCLv1.
2020-10-21 15:46:57 -04:00
Mahmood Ali
034733cdc9 Update vendored libraries 2020-10-21 15:46:56 -04:00
Mahmood Ali
7fb6bc3941 Add hclv2 parser 2020-10-21 15:46:56 -04:00
Tim Gross
8c7ccb2d49 bump website version to 0.12.6 2020-10-21 14:34:12 -04:00
Tim Gross
19b1ca9b4f upgrade guide documentation 2020-10-21 14:34:12 -04:00
Tim Gross
dc451b324f changelog entry 2020-10-21 14:34:12 -04:00
Tim Gross
076db2ef6b artifact/template: prevent file sandbox escapes
Ensure that the client honors the client configuration for the
`template.disable_file_sandbox` field when validating the jobspec's
`template.source` parameter, and not just with consul-template's own `file`
function.

Prevent interpolated `template.source`, `template.destination`, and
`artifact.destination` fields from escaping file sandbox.
2020-10-21 14:34:12 -04:00
Mahmood Ali
2a9232902c hclv1: tweak HCLv1 tests
This ensures that gatway ReadOnly key is tested.  Also, update the hclv1
test-fixtures to be hclv1 compliant.
2020-10-21 14:05:46 -04:00
Mahmood Ali
922b671719 api: parse service gateway name
Adding gateway name eases HCLv2 parsing. This field is only used for parsing the
job and is ignored for any other pruposes
2020-10-21 14:05:46 -04:00
Mahmood Ali
589a9e995d Tag Job spec with HCLv2 tags 2020-10-21 14:05:46 -04:00
Tim Gross
d552b4e8d1 e2e: path fixes for local_binary uploads (#9137)
When uploading a local binary for provisioning, the location that we pass into
the provisioning script needs to be where we uploaded it to, not the source on
our laptop. Also, the null_resource for uploading needs to read in the private
key, not its path.
2020-10-21 10:20:22 -04:00
Tim Gross
f6ca24c624 changelog entry for #9093 (#9132) 2020-10-20 16:20:23 -04:00
Alexander Shtuchkin
1be5243d08 Implement 'batch mode' for persisting allocations on the client. (#9093)
Fixes #9047, see problem details there.

As a solution, we use BoltDB's 'Batch' mode that combines multiple
parallel writes into small number of transactions. See
https://github.com/boltdb/bolt#batch-read-write-transactions for
more information.
2020-10-20 16:15:37 -04:00
Seth Hoenig
fe8ffd0762 Merge pull request #9130 from hashicorp/b-canarymeta-interpolation-tests
consul: add tests for meta/canarymeta interpolation
2020-10-20 14:45:06 -05:00
Seth Hoenig
25dd3cccf1 docs: update changelog for canary meta 2020-10-20 12:54:30 -05:00
Seth Hoenig
3b55c2fc01 client: add tests around meta and canarymeta interpolation
Expanding on #9096, add tests for making sure service.Meta and
service.CanaryMeta are interpolated from environment variables.
2020-10-20 12:50:29 -05:00
Jorge Marey
bb8f239fc7 Add interpolation on service canarymeta 2020-10-20 12:45:36 -05:00
Seth Hoenig
16f634f1fc Merge pull request #9127 from josemaia/patch-2
Remove limitation that has been fixed
2020-10-20 12:17:29 -05:00
Buck Doyle
7c7b1131f0 Remove logo spin for prefers-reduced-motion (#9128)
Spinning is one of the triggers mentioned on this page:
https://webkit.org/blog/7551/responsive-design-for-motion/

Thanks to @fivetanley for mentioning that this exists.
2020-10-20 11:52:15 -05:00
Seth Hoenig
f14c898958 Merge pull request #9118 from hashicorp/f-use-upstream-gopsutil-again
deps: use upstream gopsutil once more
2020-10-20 10:30:44 -05:00
José Maia
217902cf9e Remove limitation that has been fixed
Issue #6459 has been fixed for a while, but the docs still point to it as a limitation
2020-10-20 15:32:41 +01:00
Drew Bailey
659943a18b adds two base event stream e2e tests (#9126)
* adds two base event stream e2e tests

test evaluation filter keys are included

* Apply suggestions from code review

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

* gc aftereach

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2020-10-20 08:26:21 -04:00
Seth Hoenig
cf9a86f1db Merge pull request #9119 from hashicorp/f-update-gomod-1.15
build: update gomod go version
2020-10-19 14:36:19 -05:00
Tim Gross
1c3c24210a update tree tool to pass lint-go (#9125)
* update `tree` tool to pass lint-go
* bump `tools/go.mod` to go1.15
2020-10-19 15:33:56 -04:00
Drew Bailey
7ce0b5017c Events/msgtype cleanup (#9117)
* use msgtype in upsert node

adds message type to signature for upsert node, update tests, remove placeholder method

* UpsertAllocs msg type test setup

* use upsertallocs with msg type in signature

update test usage of delete node

delete placeholder msgtype method

* add msgtype to upsert evals signature, update test call sites with test setup msg type

handle snapshot upsert eval outside of FSM and ignore eval event

remove placeholder upsertevalsmsgtype

handle job plan rpc and prevent event creation for plan

msgtype cleanup upsertnodeevents

updatenodedrain msgtype

msg type 0 is a node registration event, so set the default  to the ignore type

* fix named import

* fix signature ordering on upsertnode to match
2020-10-19 09:30:15 -04:00
Mahmood Ali
b4034d6cf7 Merge pull request #9109 from benbuzbee/gopath-proto
Use GOPATH/src explicitly in proto build target
2020-10-18 18:21:31 -05:00
Seth Hoenig
dbf1390571 build: update gomod go version
Keep go.mod go version up to date with the version of Go used
to build Nomad.
2020-10-17 09:04:33 -05:00
Seth Hoenig
10cc366305 deps: use upstream gopsutil once more
The PR we needed https://github.com/shirou/gopsutil/pull/889 has been merged
upstream, which means we can use upstream rather than our fork of psutil.
2020-10-17 08:54:50 -05:00