Commit Graph

20590 Commits

Author SHA1 Message Date
Tim Gross
f51d035256 interpolate maps in dynamic blocks (#9921)
Update hcl2 for patch to fix map interpolation in dynamic blocks
2021-01-29 10:16:07 -05:00
Michael Lange
4b7ee22692 Merge pull request #9909 from hashicorp/b-ui/incorrect-error-message
UI: Use server-sent error messages when applicable
2021-01-28 14:02:32 -08:00
Michael Lange
3aa4cf3f2d Add an acceptance test exercising errors from an HTTP response to a notification 2021-01-28 13:47:22 -08:00
Michael Lange
5dfa556983 Test coverage for the messageFromAdapterError util 2021-01-28 12:18:53 -08:00
Michael Lange
dbf826d7ef Don't use generic ACL error messages
When the error is actually a 403, an ACL error is appropriate, but when
it isn't, fallback on what the API returns.
2021-01-28 12:18:53 -08:00
Michael Lange
6c98f1b1a2 Improve the message-from-adapter-error util
Automatically detect ACL errors
Provide a generic error message as a fallback
2021-01-28 12:18:52 -08:00
Michael Lange
d0f96f31a4 Merge pull request #9886 from hashicorp/b-ui/topo-viz-accounting
UI: Topology info panel incorrect accounting bugs
2021-01-28 09:23:01 -08:00
Buck Doyle
73be2c3439 Merge branch 'master' into b-ui/topo-viz-accounting 2021-01-28 09:56:46 -06:00
Michael Lange
5bbe53f222 Merge pull request #9906 from hashicorp/b-ui/topo-lines-not-shown
UI: Show allocation associations in the topo viz more often (and fix a bug)
2021-01-27 16:05:43 -08:00
Michael Lange
ac758a7947 Adjust the no-association-lines logic
On very small clusters, the node count heuristic is impractical and
leads to confusion. By additionally requiring 10+ sibling allocs, the
lines will be shown more often.
2021-01-27 10:24:03 -08:00
Michael Lange
494b90c995 Don't render association lines on resize when lines aren't supposed to be shown at all 2021-01-27 10:20:10 -08:00
Tim Gross
3b42d75225 docs: add metrics from raft leadership transitions 2021-01-27 11:50:11 -05:00
Mahmood Ali
d1095ca77d Merge pull request #9903 from hashicorp/b-e2e-tweaks-20210126_2
e2e: Disable node drain deadline tests
2021-01-27 09:36:08 -05:00
Mahmood Ali
38a7e73c91 e2e: skip node drain deadline/force tests 2021-01-27 08:42:16 -05:00
Mahmood Ali
e5bdc5cf71 e2e: use f.NoError instead of requires 2021-01-27 08:36:23 -05:00
Michael Lange
491bb3bde1 Merge pull request #9896 from hashicorp/b-ui-hz-casing
UI: Use MHz instead of Mhz throughout
2021-01-26 11:23:48 -08:00
Michael Lange
ff252db327 Use Hz instead of hz throughout the UI 2021-01-26 10:53:26 -08:00
Michael Lange
f89cfc3474 Merge pull request #9894 from hashicorp/b-ui/topo-viz-align-text-ff
Use dominant-baseline instead of alignment-baseline to get firefox support
2021-01-26 09:31:18 -08:00
Michael Lange
c76b5e1f64 Use dominant-baseline instead of alignment-baseline to get firefox support 2021-01-26 08:56:52 -08:00
Mahmood Ali
efdcd34ca2 Merge pull request #9721 from Mongey/cm-headers
Allow setting of headers in api client
2021-01-26 10:55:22 -05:00
Mahmood Ali
0385b5d1c6 Merge pull request #9891 from hashicorp/e2e-deflake-tests-20210126
2021-01-26 Attempt at deflaking e2e tests
2021-01-26 10:46:08 -05:00
Buck Doyle
eb1a84821a Fix audit workflow action versions (#9877)
This fixes the version reference error seen in this workflow failure:
https://github.com/hashicorp/nomad/actions/runs/504695096

I’ve also included an update to the sticky comment action version to address this warning in the above link:

marocchino/sticky-pull-request-comment@33a6cfb looks like the shortened version of a commit SHA. Referencing actions by the short SHA will be disabled soon. Please see https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions.

We were previously using 33a6cfb after the maintainer merged my PR to allow the comment to be read from a file, there was no released version with that, but it’s now included in v2.0.0.
2021-01-26 09:06:22 -06:00
Mahmood Ali
1349e49bec e2e: Disable Connect tests
The connect tests are very disruptive: restart consul/nomad agents with new
tokens.  The test seems particularly flaky, failing 32 times out of 73 in my
sample.

The tests are particularly problematic because they are disruptive and affect
other tests. On failure, the nomad or consul agent on the client can get into a
wedged state, so health/deployment info in subsequent tests may be wrong. In
some cases, the node will be deemed as fail, and then the subsequent tests may
fail when the node is deemed lost and the test allocations get migrated unexpectedly.
2021-01-26 10:01:14 -05:00
Mahmood Ali
78ccc93c2b e2e: deflake nodedrain test
The nodedrain deadline test asserts that all allocations are migrated by the
deadline. However, when the deadline is short (e.g. 10s), the test may fail
because of scheduler/client-propagation delays.

In one failing test, it took ~15s from the RPC call to the moment to the moment
the scheduler issued migration update, and then 3 seconds for the alloc to be
stopped.

Here, I increase the timeouts to avoid such false positives.
2021-01-26 10:01:14 -05:00
Mahmood Ali
1290eb75f9 e2e: vault increase timeout
Increase the timeout for vaultsecrets.  As the default  interval is 0.1s, 10
retries mean it only retries for one second, a very short time for some waiting
scenarios in the test (e.g. starting allocs, etc).
2021-01-26 10:01:14 -05:00
Mahmood Ali
fe9929270c e2e: prefer testutil.WaitForResultRetries
Prefer testutil.WaitForResultRetries that emits more descriptive errors on
failures. `require.Evatually` fails with opaque "Condition never satisfied"
error message.
2021-01-26 10:01:14 -05:00
Mahmood Ali
b49df6e9ae e2e: special case "Unexpected EOF" errors
This is an attempt at deflaking the e2e exec tests, and a way to improve
messages.

e2e occasionally fail with "unexpected EOF" even though the exec output matches
expectations. I suspect there is a race in handling EOF in server/http handling.

Here, we special case this error and ensures we get all failures,
to help debug the case better.
2021-01-26 10:01:14 -05:00
Mahmood Ali
25f10e13e5 e2e: tweak failure messages
Tweak the error messages for the flakiest tests, so that on test failure, we get
more output
2021-01-26 09:16:48 -05:00
Mahmood Ali
f7acda4260 e2e: use testify requires instead of t.Fatal
testify requires offer better error message that is easier to notice when seeing
a wall of text in the builds.
2021-01-26 09:14:47 -05:00
Mahmood Ali
30573f048e e2e: deflake consul/CheckRestart test
Ensure we pass the alloc ID to status.  Otherwise, the test may fail if there is
another spurious allocation running from another test.
2021-01-26 09:12:20 -05:00
Mahmood Ali
fcb7e160da e2e: Fix build script and pass shellcheck 2021-01-26 09:11:37 -05:00
James Rasell
adc67ce462 Merge pull request #9888 from hashicorp/f-docs-gh-9842
docs: clarify where variables can be placed with HCLv2.
2021-01-26 14:33:18 +01:00
James Rasell
0d795bdac1 docs: clarify where variables can be placed with HCLv2. 2021-01-26 12:29:58 +01:00
Michael Lange
d3dd3f5b08 Test coverage for the topology info panel.
This fixes a couple bugs

1. Overreporting resources reserved due to counting terminal allocs
2. Overreporting unique client placements due to uniquing on object refs
   instead of on client ID.
2021-01-25 19:01:11 -08:00
Michael Lange
792559e72e Clamp widths at zero to prevent negative width warnings
This would only ever realistically happen with fixture data, but still
good to not have these warnings.
2021-01-25 18:59:55 -08:00
Michael Lange
a22a952b38 Only count the scheduled allocs on the topo viz node stats bar 2021-01-25 11:29:01 -08:00
Mahmood Ali
2867e262f1 Merge pull request #9798 from hashicorp/e2e-terraform-tweaks-20200113
This PR makes two ergonomics changes, meant to get e2e builds more reproducible and ease changes.

### AMI Management

First, we pin the server AMIs to the commits associated with the build.  No more using the latest AMI a developer build in a test branch, or accidentally using a stale AMI because we forgot to build one!  Packer is to tag the AMI images with the commit sha used to generate the image, and then Terraform would look up only the AMIs associated with that sha. To minimize churn, we use the SHA associated with the latest Packer configurations, rather than SHA of all.

This has few benefits: reproducibility and avoiding accidental AMI changes and contamination of changes across branches. Also, the change is a stepping stone to an e2e pipeline that builds new AMIs automatically if Packer files changed.

The downside is that new AMIs will be generated even for irrelevant changes (e.g. spelling, commits), but I suspect that's OK. Also, an engineer will be forced to build the AMI whenever they change Packer files while iterating on e2e scripts; this hasn't been an issue for me yet, and I'll be open for iterating on that later if it proves to be an issue.

### Config Files and Packer

Second, this PR moves e2e config hcl management to Terraform instead of Packer. Currently, the config files live in `./terraform/config`, but they are baked into the servers by Packer and changes are ignored.  This current behavior surprised me, as I spent a bit of time debugging why my config changes weren't applied.  Having Terraform manage them would ease engineer's iteration.  Also, make Packer management more consistent (Packer only works `e2e/terraform/packer`), and easing the logic for AMI change detection.

The config directory is very small (100KB), and having it as an upload step adds negligible time to `terraform apply`.
2021-01-25 13:20:28 -05:00
Seth Hoenig
9db4663c9e Merge pull request #9829 from hashicorp/f-terminating-gateway
consul/connect: Add support for Connect terminating gateways
2021-01-25 10:56:19 -06:00
Mahmood Ali
c45c8e8bb6 update readme about profiles and packer build 2021-01-25 11:40:26 -05:00
Seth Hoenig
74780f08bf consul/connect: copy bind address map if empty
This parameter is now supposed to be non-nil even if
empty, and the Copy method should also maintain that
invariant.
2021-01-25 10:36:04 -06:00
Seth Hoenig
37544ca86a consul/connect: remove debug line 2021-01-25 10:36:04 -06:00
Seth Hoenig
ceae8ad1cf consul/connect: Add support for Connect terminating gateways
This PR implements Nomad built-in support for running Consul Connect
terminating gateways. Such a gateway can be used by services running
inside the service mesh to access "legacy" services running outside
the service mesh while still making use of Consul's service identity
based networking and ACL policies.

https://www.consul.io/docs/connect/gateways/terminating-gateway

These gateways are declared as part of a task group level service
definition within the connect stanza.

service {
  connect {
    gateway {
      proxy {
        // envoy proxy configuration
      }
      terminating {
        // terminating-gateway configuration entry
      }
    }
  }
}

Currently Envoy is the only supported gateway implementation in
Consul. The gateay task can be customized by configuring the
connect.sidecar_task block.

When the gateway.terminating field is set, Nomad will write/update
the Configuration Entry into Consul on job submission. Because CEs
are global in scope and there may be more than one Nomad cluster
communicating with Consul, there is an assumption that any terminating
gateway defined in Nomad for a particular service will be the same
among Nomad clusters.

Gateways require Consul 1.8.0+, checked by a node constraint.

Closes #9445
2021-01-25 10:36:04 -06:00
Drew Bailey
85129bb794 ignore setting job summary when oldstatus == newstatus (#9884) 2021-01-25 10:34:27 -05:00
Steven Collins
ae91c836f5 Adds community USB plugin to documentation site 2021-01-25 10:15:36 -05:00
zzhai
1f71e9dae4 Update syntax.mdx
"one label"
should be the singular form.
2021-01-25 08:42:59 -05:00
Jeff Escalante
251b07099c update dependencies, removed unused dependency (#9878) 2021-01-22 21:24:26 -05:00
Michael Lange
6e6a162495 Merge pull request #9876 from hashicorp/b-ui/default-namespace-casing
UI: Use the same prefix pattern for both the region switcher and the namespace switcher
2021-01-22 13:43:54 -08:00
Michael Lange
ee58aeaceb Clip long namespace names but make sure to keep the full name in the title attribute 2021-01-22 13:18:15 -08:00
Michael Lange
e90d23d522 Use the same prefix pattern from the region switcher for the namespace switcher 2021-01-22 13:18:15 -08:00
Tim Gross
cf3f8eb2d9 changelog entry 2021-01-22 13:41:28 -05:00