Commit Graph

25973 Commits

Author SHA1 Message Date
James Rasell
f3de47e63d quota: Allow cores to be configured within an enterprise quota. (#23543) 2024-07-11 14:54:25 +01:00
dependabot[bot]
81a5eed99b chore(deps): bump github.com/container-storage-interface/spec (#23514)
Bumps [github.com/container-storage-interface/spec](https://github.com/container-storage-interface/spec) from 1.7.0 to 1.10.0.
- [Release notes](https://github.com/container-storage-interface/spec/releases)
- [Commits](https://github.com/container-storage-interface/spec/compare/v1.7.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/container-storage-interface/spec
  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-07-11 07:56:03 -05:00
dependabot[bot]
9381febedb chore(deps): bump github.com/klauspost/cpuid/v2 from 2.2.5 to 2.2.8 (#23513)
Bumps [github.com/klauspost/cpuid/v2](https://github.com/klauspost/cpuid) from 2.2.5 to 2.2.8.
- [Release notes](https://github.com/klauspost/cpuid/releases)
- [Changelog](https://github.com/klauspost/cpuid/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/cpuid/compare/v2.2.5...v2.2.8)

---
updated-dependencies:
- dependency-name: github.com/klauspost/cpuid/v2
  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-07-11 07:55:00 -05:00
dependabot[bot]
4ccc613165 build(deps): bump github.com/gorilla/handlers from 1.5.1 to 1.5.2 (#23356)
Bumps [github.com/gorilla/handlers](https://github.com/gorilla/handlers) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/gorilla/handlers/releases)
- [Commits](https://github.com/gorilla/handlers/compare/v1.5.1...v1.5.2)

---
updated-dependencies:
- dependency-name: github.com/gorilla/handlers
  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-07-11 07:54:07 -05:00
dependabot[bot]
83b5a4cbfd chore(deps): bump github.com/shoenig/go-landlock from 1.2.0 to 1.2.1 (#23512)
Bumps [github.com/shoenig/go-landlock](https://github.com/shoenig/go-landlock) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/shoenig/go-landlock/releases)
- [Commits](https://github.com/shoenig/go-landlock/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/shoenig/go-landlock
  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-07-11 07:53:31 -05:00
Piotr Kazmierczak
4212bfd669 docs: update documentation of namespace delete command (#23536) 2024-07-10 18:31:35 +02:00
Tim Gross
171305c5de docs: fix formatting in 1.6.10 changelog (#23532) 2024-07-10 10:57:56 -04:00
Tim Gross
b09c1146a9 CLI: fix prefix matching across multiple commands (#23502)
Several commands that inspect objects where the names are user-controlled share
a bug where the user cannot inspect the object if it has a name that is an exact
prefix of the name of another object (in the same namespace, where
applicable). For example, the object "test" can't be inspected if there's an
object with the name "testing".

Copy existing logic we have for jobs, node pools, etc. to the impacted commands:

* `plugin status`
* `quota inspect`
* `quota status`
* `scaling policy info`
* `service info`
* `volume deregister`
* `volume detach`
* `volume status`

If we get multiple objects for the prefix query, we check if any of them are an
exact match and use that object instead of returning an error. Where possible
because the prefix query signatures are the same, use a generic function that
can be shared across multiple commands.

Fixes: https://github.com/hashicorp/nomad/issues/13920
Fixes: https://github.com/hashicorp/nomad/issues/17132
Fixes: https://github.com/hashicorp/nomad/issues/23236
Ref: https://hashicorp.atlassian.net/browse/NET-10054
Ref: https://hashicorp.atlassian.net/browse/NET-10055
2024-07-10 09:04:10 -04:00
Jeff Boruszak
d3041a0e86 docs: Autoscaling agent 404 and navigation fix (#23524) 2024-07-09 15:45:57 -04:00
Piotr Kazmierczak
75a1df3390 namespaces: warn if deleting namespaces that have allocs, volumes, vars or quotas associated with them (#23499) 2024-07-09 17:10:09 +02:00
James Rasell
5bce4b531e changelog: add entry for #18876 (#23520)
Co-authored-by: Piotr Kazmierczak <470696+pkazmierczak@users.noreply.github.com>
2024-07-09 13:18:30 +01:00
Piotr Kazmierczak
7772711c89 plugins: fix nomadTopologyToProto panic on systems that don't support NUMA (#23399)
After changes introduced in #23284 we no longer need to make a if
!st.SupportsNUMA() check in the GetNodes() topology method. In fact this check
will now cause panic in nomadTopologyToProto method on systems that don't
support NUMA.
2024-07-09 08:41:52 +02:00
Phil Renaud
6560a0ce02 [ui] Generalized namespace handling, generalized facet searching, node pools facet search (#23468)
* Generalized namespace handling, generalized facet searching, node pools facet search

* Testfixes for namespace facet on jobs list

* Filter or not, need to watch for * namespaces
2024-07-08 16:57:11 -04:00
Deniz Onur Duzgun
ef6cdec884 security: add escape to arbitrary file access (#23319) 2024-07-08 14:00:09 -04:00
Charlie Voiselle
21818843f0 actions/setup-node v3.7.0 ==> v4.0.2 (#23503) 2024-07-08 09:47:02 -04:00
Phil Renaud
7cf6332632 [ui] When a job is deleted in the background, wait until redirect before cache unload (#23492)
* Wait until the job page is moved-off before unloading the job from ember data cache

* handle transitionAborted error
2024-07-04 17:04:30 -04:00
Deniz Onur Duzgun
441f8f21ff build: update to go1.22.5 (#23498) 2024-07-03 15:33:40 -04:00
Tim Gross
18fdda6242 vault: fix namespace reset for clients with unset namespace (#23491)
The Vault "logical" API doesn't allow configuring the namespace on a per-request
basis. Instead, it's set on the client. Our `vaultclient` wrapper locks access
to the API client and sets the namespace (and token, if applicable) for each
request, and then resets the namespace and unlocks the API client.

The logic for resetting the namespace incorrectly assumed that if the Vault
configuration didn't set the namespace that it was canonicalized to the
non-empty string `"default"`. This results in the API client's namespace getting
"stuck" whenever a job uses a non-default namespace if the configuration value
is empty. Update the logic to always go back to the configuration, rather than
accepting the "previous" namespace from the caller.

This changeset also removes some long-dead code in the Vault client wrapper.

Fixes: https://github.com/hashicorp/nomad/issues/22230
Ref: https://hashicorp.atlassian.net/browse/NET-10207
2024-07-03 10:13:20 -04:00
Piotr Kazmierczak
88e8973004 consul: additional unit test for consul config merging (#23495) 2024-07-03 16:09:16 +02:00
James Rasell
1f915c0f8f quota: add cores to resource addition calculation. (#23486) 2024-07-03 07:46:30 +01:00
Martina Santangelo
859a515523 mbits: filter mbits so they aren't shown in diff (#23489) 2024-07-02 10:03:46 -04:00
Charlie Voiselle
9bdaab4f9c [actions] Update projects GitHub actions (#23483)
* Updated actions

* actions/checkout v4.1.1 ==> v4.1.7
* actions/download-artifact v3.0.2 ==> v4.1.7
* actions/setup-go v4.0.1 ==> v5.0.1
* actions/setup-node v3.7.0 ==> v4.0.2
* actions/upload-artifact v3.1.2 ==> v4.3.3
* andstor/file-existence-action v2.0.0 ==> v3.0.0
* browser-actions/setup-chrome v1.2.0 ==> v1.7.1
* dessant/lock-threads v4.0.1 ==> v5.0.1
* marocchino/sticky-pull-request-comment v2.6.2 ==> v2.9.0
* mshick/add-pr-comment v2.8.1 ==> v2.8.2
* nanasess/setup-chromedriver v2.1.2 ==> v2.2.2
* slackapi/slack-github-action v1.24.0 ==> v1.26.0

* Update HashiCorp actions

* hashicorp/actions-docker-build v1 ==> v2.0.0
* hashicorp/actions-generate-metadata v1.1.1 ==> v1.1.1(pinned)
* hashicorp/actions-packaging-linux v1 ==> v1.8.0
* hashicorp/setup-copywrite v1.1.2 ==> v1.1.3

* fix parameter
2024-07-01 22:32:10 -04:00
Seth Hoenig
3f57c9bcf2 cli: fix bold output of devices headers (#23477) 2024-07-01 12:36:55 -05:00
Tim Gross
eedbd36fef qemu: pass task resources into driver for cgroup setup (#23466)
As part of the work for 1.7.0 we moved portions of the task cgroup setup down
into the executor. This requires that the executor constructor get the
`TaskConfig.Resources` struct, and this was missing from the `qemu` driver. We
fixed a panic caused by this change in #19089 before we shipped, but this fix
was effectively undo after we added plumbing for custom cgroups for `raw_exec`
in 1.8.0. As a result, running `qemu` tasks always fail on Linux.

This was undetected in testing because our CI environment doesn't have QEMU
installed. I've got all the unit tests running locally again and have added QEMU
installation when we're running the drivers tests.

Fixes: https://github.com/hashicorp/nomad/issues/23250
2024-07-01 11:41:10 -04:00
dependabot[bot]
a01c688984 chore(deps): bump github.com/hashicorp/go-envparse (#23471)
Bumps [github.com/hashicorp/go-envparse](https://github.com/hashicorp/go-envparse) from 0.0.0-20180119215841-310ca1881b22 to 0.1.0.
- [Release notes](https://github.com/hashicorp/go-envparse/releases)
- [Commits](https://github.com/hashicorp/go-envparse/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-envparse
  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-07-01 09:30:49 +02:00
dependabot[bot]
ec294dab1d chore(deps): bump github.com/docker/docker (#23472)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.0.2+incompatible to 27.0.2+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.0.2...v27.0.2)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  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-07-01 09:29:57 +02:00
Piotr Kazmierczak
d5e1515e80 docker: default to hyper-v isolation on Windows (#23452) 2024-07-01 08:56:43 +02:00
Phil Renaud
bbd1bb3485 Read-based checks for viewing templates and write-based checks for saving them (#23458) 2024-06-28 17:30:56 -04:00
Piotr Kazmierczak
cc01c09f8b windows: remove winappcontainer and winexec helpers (#23448)
This removes helper winappcontainer and winexec helper code, since it is no longer needed after #23432
2024-06-28 18:49:56 +02:00
Piotr Kazmierczak
356ea87e00 template: disable sandboxed rendering on Windows (#23432)
Following #23443, we no longer need to sandbox template rendering on Windows.
2024-06-28 17:16:27 +02:00
Tim Gross
cd3101d624 scale: add -check-index to job scale command (#23457)
The RPC handler for scaling a job passes flags to enforce the job modify index
is unchanged when it makes the write to Raft. But its only checking against the
existing job modify index at the time the RPC handler snapshots the state store,
so it can only enforce consistency for its own validation.

In clusters with automated scaling, it would be useful to expose the enforce
index options to the API, so that cluster admins can enforce that scaling only
happens when the job state is consistent with a state they've previously seen in
other API calls. Add this option to the CLI and API and have the RPC handler
check them if asked.

Fixes: https://github.com/hashicorp/nomad/issues/23444
2024-06-27 16:54:06 -04:00
Tim Gross
7d3ce7e92d job statuses: fix filtering for namespace parameter (#23456)
The job statuses endpoint does not filter jobs by the namespace query parameter
unless the user passes a management token. The RPC handler creates a filter
based on all the allowed namespaces but improperly conditions reducing this down
to only the requested set on there being a management token. Note this does not
give the user access to jobs they shouldn't have, only ignores the parameter.

Remove the RPC handler's extra condition that prevents using the requested
namespace. This is safe because we specifically check the ACL for that namespace
earlier in the handler.

Fixes: https://github.com/hashicorp/nomad/issues/23370
2024-06-27 16:19:36 -04:00
Piotr Kazmierczak
863d42bc4b docs: upgrade guide updates for backported Docker windows changes (#23453)
Upgrade guide should be uniform across all supported versions, otherwise
backporting breaking changes is tedious.
2024-06-27 19:35:56 +02:00
Piotr Kazmierczak
0ece7b5c16 docker: validate that containers do not run as ContainerAdmin on Windows (#23443)
This enables checks for ContainerAdmin user on docker images on Windows. It's
only checked if users run docker with process isolation and not hyper-v,
because hyper-v provides its own, proper sandboxing.

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-06-27 16:22:24 +02:00
Tim Gross
df67e74615 Consul: add preflight checks for Envoy bootstrap (#23381)
Nomad creates Consul ACL tokens and service registrations to support Consul
service mesh workloads, before bootstrapping the Envoy proxy. Nomad always talks
to the local Consul agent and never directly to the Consul servers. But the
local Consul agent talks to the Consul servers in stale consistency mode to
reduce load on the servers. This can result in the Nomad client making the Envoy
bootstrap request with a tokens or services that have not yet replicated to the
follower that the local client is connected to. This request gets a 404 on the
ACL token and that negative entry gets cached, preventing any retries from
succeeding.

To workaround this, we'll use a method described by our friends over on
`consul-k8s` where after creating the objects in Consul we try to read them from
the local agent in stale consistency mode (which prevents a failed read from
being cached). This cannot completely eliminate this source of error because
it's possible that Consul cluster replication is unhealthy at the time we need
it, but this should make Envoy bootstrap significantly more robust.

This changset adds preflight checks for the objects we create in Consul:
* We add a preflight check for ACL tokens after we login via via Workload
  Identity and in the function we use to derive tokens in the legacy
  workflow. We do this check early because we also want to use this token for
  registering group services in the allocrunner hooks.
* We add a preflight check for services right before we bootstrap Envoy in the
  taskrunner hook, so that we have time for our service client to batch updates
  to the local Consul agent in addition to the local agent sync.

We've added the timeouts to be configurable via node metadata rather than the
usual static configuration because for most cases, users should not need to
touch or even know these values are configurable; the configuration is mostly
available for testing.


Fixes: https://github.com/hashicorp/nomad/issues/9307
Fixes: https://github.com/hashicorp/nomad/issues/10451
Fixes: https://github.com/hashicorp/nomad/issues/20516

Ref: https://github.com/hashicorp/consul-k8s/pull/887
Ref: https://hashicorp.atlassian.net/browse/NET-10051
Ref: https://hashicorp.atlassian.net/browse/NET-9273
Follow-up: https://hashicorp.atlassian.net/browse/NET-10138
2024-06-27 10:15:37 -04:00
Phil Renaud
54aafa574d [ui] Jobs list should handle 502s and 504s gracefully (#23427)
* UI handles 502s and 504s gracefully

* Test and cleanup
2024-06-26 21:51:18 -04:00
Matt McQuillan
6df8537b69 Merge pull request #23440 from hashicorp/mmcquillan/jirasyncfix
Fixing sync to work only on Issue Link field
2024-06-26 10:47:25 -04:00
Charlie Voiselle
07516c8159 [docs] Add Sentinel info to version-specific upgrade page (#23173)
The upgrade to sentinel v0.26 is a breaking change, requiring users of
custom Sentinel plugins to rebuild them using sentinel-sdk v4
2024-06-26 10:46:38 -04:00
Matt McQuillan
9224da6bf1 change to sync on only the GitHub link 2024-06-26 10:33:56 -04:00
Matt McQuillan
7ccef279ef removing 'test' from sync name 2024-06-26 10:31:01 -04:00
Tim Gross
bd2a2ce33c deps: update Consul API and consul-template (#23436)
* Upgrade consul-template to 0.39.0 to allow template queries of admin
  partitions and sameness groups.
* Upgrade our Consul API to 1.29.1 because it's required for CT, and to remove
  the replacement pinned version we were using to pick up some newer Consul API
  features we needed in 1.7.0.

Ref: https://hashicorp.atlassian.net/browse/NET-10153
2024-06-26 08:49:35 -04:00
dependabot[bot]
c5b7f6b3c5 chore(deps): bump github.com/hashicorp/go-getter from 1.7.4 to 1.7.5 (#23434)
Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.4...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 16:43:02 -04:00
dependabot[bot]
3dc7fdaad6 chore(deps): bump github.com/hashicorp/go-retryablehttp (#23428)
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.2 to 0.7.7.
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.2...v0.7.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 09:04:49 -04:00
Antti
bbdc8b7fa7 docs: add deprecation notice to cron on docs/job-specification/periodic (#23424) 2024-06-24 11:35:20 -04:00
liukch
cc7a5ed7e2 docs: Fix parameter type and default value in client reserved configuration. (#23359) 2024-06-21 16:29:59 -04:00
Heitor de Bittencourt
0588172a19 docs/jobspec: Fix "task" block placement (#23406)
The `task` block should be inside the `group` block. The example in the
page places the `task` block directly under `job`.
2024-06-21 15:21:32 -04:00
Tim Gross
336f27d96e changelog: update titles of recent ENT-only backports (#23414)
The changelog is slightly misleading in that recent Enterprise-only backports
following our LTS release have titles that don't call out they're for Enterprise
only. Updating the title brings us in line with what Consul has done.
2024-06-21 14:55:07 -04:00
Piotr Kazmierczak
8f80bd505f scheduler: fix a bug where we subtract reserved node resources twice (#23386)
Fixes a bug in the nodeResources.Comparable method, where CPU resources were
accidentally offset with reserved resources, whereas functions that use this
field expect total CPU resources.
2024-06-21 15:22:59 +02:00
Daniel Bennett
c84b4ad67b e2e: add test for task schedule{} (#23382) 2024-06-20 11:18:53 -05:00
Tim Gross
ee48bdd4d9 server: fix panic if heartbeat reset happens for GC'd node (#23383)
When setting up the timer for heartbeat invalidation, there's no control that
allows us to remove that timer when the node is GC'd. If the GC window is narrow
enough, it's possible to GC a node that has a waiting heartbeat timer. In this
case, we hit a bug where querying for the node returns `nil` and this is
incorrectly handled when checking for disconnect/reconnect state. Fix this bug
by correctly handling a `nil` node and allowing the `Node.Update` RPC to fire
normally (which then errors correctly).

Fixes: https://github.com/hashicorp/nomad/issues/23376
Ref: https://hashicorp.atlassian.net/browse/NET-10109
2024-06-20 10:05:44 -04:00