Commit Graph

26167 Commits

Author SHA1 Message Date
Tim Gross
65ec00da1d cli: fix -t flag on job status command (#24054)
In #18925 we added a `-json` flag to the `job status` command, but the argument
handling had a bug where it would always set the `-json` flag if either the `-t`
or `-json` flags were set, resulting in a misleading error. Instead, pass the
`-json` flag value into the formatter.

Fixes: https://github.com/hashicorp/nomad/issues/24050
2024-09-25 09:12:52 -04:00
Tim Gross
cc9227b858 template: fix panic in change_mode=script on client restart (#24057)
When we introduced change_mode=script to templates, we passed the driver handle
down into the template manager so we could call its `Exec` method directly. But
the lifecycle of the driver handle is managed by the taskrunner and isn't
available when the template manager is first created. This has led to a series
of patches trying to fixup the behavior (#15915, #15192, #23663, #23917). Part
of the challenge in getting this right is using an interface to avoid the
circular import of the driver handle.

But the taskrunner already has a way to deal with this problem using a "lazy
handle". The other template change modes already use this indirectly through the
`Lifecycle` interface. Change the driver handle `Exec` call in the template
manager to a new `Lifecycle.Exec` call that reuses the existing behavior. This
eliminates the need for the template manager to know anything at all about the
handle state.

Fixes: https://github.com/hashicorp/nomad/issues/24051
2024-09-25 08:59:01 -04:00
Michael Schurter
93bf7caa75 deps: upgrade yamux from v0.1.1 to v0.1.2 (#24058)
The main point of this dependency upgrade is to pull in the fixes in
hashicorp/yamux#127 which prevents leaking deadlocked goroutines. It has
been observed to improve the issue in hashicorp/nomad#23305 but does not
seem sufficient to fix it entirely.

Since touching yamux is a rare and scary event, I do **not** intend to
backport this. If we discover the improvements are stable and
significant enough, or if further fixes land in yamux, backporting can
be done at that time.
2024-09-24 11:55:49 -07:00
Michael Smithhisler
338487c159 fix: add node pool attribute to interpretable values in task env (#24052) 2024-09-24 13:23:16 -04:00
Michael Smithhisler
389545bcf5 test: add valid identity name for test task (#24056) 2024-09-24 11:36:57 -04:00
dependabot[bot]
31e4669213 chore(deps): bump github.com/shirou/gopsutil/v3 from 3.23.9 to 3.24.5 (#23657)
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.9 to 3.24.5.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.9...v3.24.5)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 15:15:26 -04:00
dependabot[bot]
f89c0c923f chore(deps): bump github.com/mitchellh/go-ps (#23658)
Bumps [github.com/mitchellh/go-ps](https://github.com/mitchellh/go-ps) from 0.0.0-20190716172923-621e5597135b to 1.0.0.
- [Commits](https://github.com/mitchellh/go-ps/commits/v1.0.0)

---
updated-dependencies:
- dependency-name: github.com/mitchellh/go-ps
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 14:54:08 -04:00
Michael Smithhisler
f672d96000 add changelog entry for workload identity filename feature (#24045) 2024-09-23 14:51:44 -04:00
Michael Schurter
2376248d32 deps: upgrade raft from v1.6.1 -> v1.7.1 (#24029)
Fixes #20335

The major change between Raft v1.6 -> v1.7 was the introduction of the
Prevote feature. Before Prevote, when a partitioned node rejoins a
cluster it may cause an election even if the cluster was stable. Prevote
can avoid this useless election so reintroducing partitioned servers to
an otherwise stable cluster becomes seamless.

Full details: https://github.com/hashicorp/raft/pull/530

In #20335 we discussed whether or not to add a configuration option to
disable prevote in case bugs were discovered. While bugs have been found
(hence the v1.7.1 version as opposed to v1.7.0), I'm choosing to follow
Vault's lead of straightfordwardly bumping the raft dependency:
hashicorp/vault#27605 and hashicorp/vault#28218
2024-09-23 11:51:24 -07:00
dependabot[bot]
16a7aa91cd chore(deps): bump browser-actions/setup-chrome from 1.7.1 to 1.7.2 (#24033)
Bumps [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/browser-actions/setup-chrome/releases)
- [Changelog](https://github.com/browser-actions/setup-chrome/blob/master/CHANGELOG.md)
- [Commits](db1b524c26...facf10a55b)

---
updated-dependencies:
- dependency-name: browser-actions/setup-chrome
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 14:32:00 -04:00
dependabot[bot]
f86e770d1b chore(deps): bump github.com/gorilla/websocket from 1.5.0 to 1.5.3 (#24030)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.5.0 to 1.5.3.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.5.0...v1.5.3)

---
updated-dependencies:
- dependency-name: github.com/gorilla/websocket
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 14:11:40 -04:00
dependabot[bot]
a1e15645f9 chore(deps): bump github.com/hashicorp/go-plugin from 1.6.0 to 1.6.1 (#24031)
Bumps [github.com/hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/hashicorp/go-plugin/releases)
- [Changelog](https://github.com/hashicorp/go-plugin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-plugin/compare/v1.6.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 14:06:48 -04:00
Anthony
46d92a53a5 Usage doc for configuring Nomad OIDC with AWS IAM (#23845) 2024-09-23 14:01:22 -04:00
Michael Smithhisler
6b6aa7cc26 identity: adds ability to specify custom filepath for saving workload identities (#24038) 2024-09-23 10:27:00 -04:00
dependabot[bot]
0788aebb27 chore(deps): bump actions/setup-node from 4.0.3 to 4.0.4 (#24032)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](1e60f620b9...0a44ba7841)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 11:00:01 +02:00
dependabot[bot]
4a02677d2e chore(deps): bump hashicorp/actions-packaging-linux from 1.8 to 1.9 (#24034)
Bumps [hashicorp/actions-packaging-linux](https://github.com/hashicorp/actions-packaging-linux) from 1.8 to 1.9.
- [Release notes](https://github.com/hashicorp/actions-packaging-linux/releases)
- [Commits](9a9ce39887...8d55a640bb)

---
updated-dependencies:
- dependency-name: hashicorp/actions-packaging-linux
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 10:59:32 +02:00
Phil Renaud
e65767fbf0 [ui] Ember test suite upgraded (#24020)
* Ember test suite upgraded

* Switch up the order for the sake of testem

* Use the built-in ember test helper render for job editor rendering
2024-09-20 17:01:03 -04:00
Tim Gross
a7f2cb879e command line tools for redacting keyring from snapshots (#24023)
In #23977 we moved the keyring into Raft, which can expose key material in Raft
snapshots when using the less-secure AEAD keyring instead of KMS. This changeset
adds tools for redacting this material from snapshots:

* The `operator snapshot state` command gains the ability to display key
  metadata (only), which respects the `-filter` option.
* The `operator snapshot save` command gains a `-redact` option that removes key
  material from the snapshot after it's downloaded.
* A new `operator snapshot redact` command allows removing key material from an
  existing snapshot.
2024-09-20 15:30:14 -04:00
Tim Gross
9247dc9108 E2E: allow Consul version to omit tags (#24024)
When we start the Consul agent in the `consulcompat` test package, we check that
the version matches the version we expect. But Consul agents may omit non-core
parts of the version string (ex. `1.20.0-rc1` displays `1.20.0`). Compare only
the core portions of the version string.
2024-09-20 14:46:01 -04:00
Seth Hoenig
8bb94ec32d WIP: try less hard to cache go modules (#24016) 2024-09-20 09:37:13 -05:00
Tim Gross
b7d5acc47b test: wait for keyring for plan apply tests (#24021)
In #23977 we merged a change to how the keyring was stored. Because keyring
initialization takes slightly longer now, this uncovered existing timing bugs in
some of our tests where tests that require the keyring (ex. plan applier tests)
were waiting for the leader but not the keyring initialization. Fix some of the
examples we've seen cause test flakes.
2024-09-20 10:33:40 -04:00
Seth Hoenig
68ecf67c99 ci: (ent) specify instance types when using self hosted runners (#24015) 2024-09-20 07:53:34 -05:00
dependabot[bot]
16c4b7ca19 chore(deps): bump actions/download-artifact from 4.1.7 to 4.1.8 (#23990)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-20 08:44:45 +01:00
Seth Hoenig
d1fca7bde2 update changelog 1.8.4 (#23987)
* update changelog for 1.8.4 release

* changelog: add 1.8.4 backport changelog notes

I botched the changelog bits of the checklist, adding the backport notes
to the CE changelog now.
2024-09-19 14:57:31 -05:00
Tim Gross
44f4970372 keyring in raft (#23977)
In Nomad 1.4, we implemented a root keyring to support encrypting Variables and
signing Workload Identities. The keyring was originally stored with the
AEAD-wrapped DEKs and the KEK together in a JSON keystore file on disk. We
recently added support for using an external KMS for the KEK to improve the
security model for the keyring. But we've encountered multiple instances of the
keystore files not getting backed up separately from the Raft snapshot,
resulting in failure to restore clusters from backup.

Move Nomad's root keyring into Raft (encrypted with a KMS/Vault where available)
in order to eliminate operational problems with the separate on-disk keystore.

Fixes: https://github.com/hashicorp/nomad/issues/23665
Ref: https://hashicorp.atlassian.net/browse/NET-10523
2024-09-19 13:56:42 -04:00
Tim Gross
85e8774ed4 version: bump base to 1.9.0 (#24012)
We're releasing the beta for Nomad 1.9.0 shortly. Bumping the base version now
will make it easier to test out new features that require a version
check. Builds from `main` will show as `1.9.0-dev`.
2024-09-19 11:07:07 -04:00
James Rasell
370c1c06ac contributing: add note about first issue label. (#24002) 2024-09-19 15:28:29 +01:00
dependabot[bot]
b71124864b chore(deps): bump slackapi/slack-github-action from 1.26.0 to 1.27.0 (#23991)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 13:04:44 +01:00
dependabot[bot]
59b07eed4d chore(deps): bump github.com/creack/pty from 1.1.18 to 1.1.23 (#23995)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 11:24:24 +01:00
dependabot[bot]
29a5edb4c9 chore(deps): bump actions/upload-artifact from 4.3.3 to 4.4.0 (#23994)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...50769540e7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 09:20:24 +02:00
dependabot[bot]
287a4c0789 chore(deps): bump actions/setup-node from 4.0.2 to 4.0.3 (#23992)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](60edb5dd54...1e60f620b9)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 09:19:52 +02:00
dependabot[bot]
c057490c3b chore(deps): bump github.com/opencontainers/runc from 1.1.13 to 1.1.14 (#23903) 2024-09-19 08:17:19 +01:00
dependabot[bot]
518f9c6505 chore(deps): bump actions/setup-go from 5.0.1 to 5.0.2 (#23989) 2024-09-19 07:56:05 +01:00
Michael Smithhisler
25b2bd8467 test: add missing checks for vault binary in unit tests (#23986) 2024-09-18 17:12:29 -04:00
Deniz Onur Duzgun
52f0b40f4c security: fine tune security-scanner to reduce false-positives (#20465)
Resolve scan job runner

Resolve linting alerts

adding EOF on files

adding EOF on gitignore too

add hclfmt and bump action versions

update scan.hcl comments

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

fix typo

move scan.hcl file and paths-ignore for scans

change action runner

use org secret to checkout

typo

change runner

use hashicorp/setup-golang@v3

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

pin the github action sha
2024-09-18 16:55:39 -04:00
Daniel Bennett
ec81e7c57c networking: add ignore_collision for static port{} (#23956)
so more than one copy of a program can run
at a time on the same port with SO_REUSEPORT.

requires host network mode.

some task drivers (like docker) may also need
config {
  network_mode = "host"
}
but this is not validated prior to placement.
2024-09-17 16:01:48 -05:00
Daniel Bennett
603a747f5b Port and AllocatedPortMapping msgpack omitempty (#23980)
to optimize log entries with empty fields, which TestPlanNormalize checks
2024-09-17 14:21:54 -05:00
Tim Gross
b7f1800657 fingerprint: update landlock test to accept v4+ APIs (#23979)
The landlock fingerprint test assumes there's no version of the landlock API
>3. Update the test assertion to allow for the current v4 and any future
versions.
2024-09-17 15:07:44 -04:00
Tim Gross
a2b19851a2 keyring: reduce locking and replication overhead (#23975)
While working on #23655 I found there were a few places in the encrypter/keyring
where we could make modest improvements to performance and reliability of the
existing code.

This changeset allows keyring replication to skip trying to replicate from
itself, switches some of the read-only keyring accesses to use the read lock
instead of a r/w lock, fixes the logging configuration to drop spurious "extra
value" warnings in the logs, drops an unused type, and makes a minor refactoring
to eliminate shadowing of the `keyset` type. Pulling this out to its own PR lets
us backport these changes to the LTS and reduces the size of the PR that
implements #23665.

Ref https://github.com/hashicorp/nomad/issues/23665
2024-09-17 11:23:57 -04:00
dependabot[bot]
4d6856a306 chore(deps): bump golang.org/x/crypto from 0.24.0 to 0.27.0 (#23932) 2024-09-17 07:55:00 +01:00
Seth Hoenig
51215bf102 deps: update to go-set/v3 and refactor to use custom iterators (#23971)
* deps: update to go-set/v3

* deps: use custom set iterators for looping
2024-09-16 13:40:10 -05:00
Seth Hoenig
212a72b203 deps update go1.23.1 (#23972)
* deps: update to go1.23.1

* deps: update to golangci-lint 1.61.0
2024-09-16 11:03:23 -05:00
Phil Renaud
483506873e Revert "Pin body-parser to resolve an outdated dep problem (#23954)" (#23970)
This reverts commit 51caca1a85.
2024-09-16 11:44:03 -04:00
Daniel Bennett
5e1fae2856 networking: set alloc NetworkStatus.AddressIPv6 (#23959)
when a CNI result includes an IPv6 address,
set it on the alloc's NetworkStatus for reference.

e.g.:

$ nomad alloc status -json 3dca | jq '.NetworkStatus'
{
  "Address": "172.26.64.14",
  "AddressIPv6": "fd00:a110:c8::b",
  "DNS": null,
  "InterfaceName": "eth0"
}
2024-09-16 10:21:52 -05:00
dependabot[bot]
210044b465 chore(deps): bump github.com/shoenig/test from 1.7.1 to 1.11.0 (#23962) 2024-09-16 10:46:19 +01:00
Phil Renaud
51caca1a85 Pin body-parser to resolve an outdated dep problem (#23954) 2024-09-13 13:59:21 -04:00
Phil Renaud
c2bb18e167 Pin path-to-regexp with yarn1 syntax (#23955) 2024-09-13 13:51:29 -04:00
dependabot[bot]
9ed0e1aed8 chore(deps): bump ws from 7.4.6 to 7.5.10 in /scripts/screenshots/src (#23367)
Bumps [ws](https://github.com/websockets/ws) from 7.4.6 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.6...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 10:06:11 -04:00
dependabot[bot]
f579b4add1 chore(deps): bump ws from 7.5.9 to 7.5.10 in /ui (#23368)
Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 10:05:28 -04:00
Benjamin Boudreau
cdaf45d990 Stop referring non existent vault.file attribute (#23946)
The documentation is referring to a `file` attribute that does not exist on the `vault` block.

This PR changes those references to mention the `disable_file` attribute instead.
2024-09-12 09:10:41 -07:00