Commit Graph

27418 Commits

Author SHA1 Message Date
James Rasell
1916a16311 exec: Set LOGNAME env var on exec based drivers. (#26703)
Typically the `LOGNAME` environment variable should be set according
to the values within `/etc/passwd` and represents the name of the
logged in user. This should be set, where possible, alongside the
USER and HOME variables for all drivers that use the shared
executor and do not use a sub-shell.
2025-09-05 14:07:27 +01:00
Michael Schurter
c046e83d17 bump cronexpr from v1.1.2 -> v1.1.3 (#26700)
No functional changes. Bumping just to clear up some license
ambiguities.
2025-09-05 07:46:02 +01:00
Daniel Bennett
9682aa2724 consul connect: allow "cni/*" network mode (#26449)
don't require "bridge" network mode when using connect{}

we document this as "at your own risk" because CNI configuration
is so flexible that we can't guarantee a user's network will work,
but Nomad's "bridge" CNI config may be used as a reference.
2025-09-04 12:29:50 -04:00
Juana De La Cuesta
2944a34b58 Reuse token if it exists on client reconnect (#26604)
Currently every time a client starts, it creates a new consul token per service or task,. This PR changes the behaviour , it persists consul ACL token to the client state and it starts by looking up a token before creating a new one.

Fixes: #20184
Fixes: #20185
2025-09-04 15:27:57 +02:00
Daniel Bennett
3ad22ddad5 e2e: ui: fix token form fill (#26692)
look, I know I misspelled "locater" in the code comment, but it's easier to acknowledge that here in this commit message than it is to push a new commit with all the test/approval machinery in github.
2025-09-03 12:11:35 -04:00
dependabot[bot]
d0db16386f chore(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1 (#26669) 2025-09-03 15:22:58 +01:00
James Rasell
269e05ba33 test: Migrate volumewatcher to must and fix racy test. (#26686)
The TestVolumeWatch_LeadershipTransition test was a little racy
and the fix required adding an eventually wrapper to the end of
the test. While doing this work, it seemed fit to move the package
to the must library also.
2025-09-03 14:21:10 +01:00
James Rasell
270ab1011e lint: Enable and fix SA9004 constant type lint errors. (#26678)
When creating constants with a custom type, each definition should
include the type definition. If only the first constant defines
this, it will have a different type to the other constants.

This change fixes occurances of this and enables SA9004 within CI
linting to catch future problems while the change is in review.
2025-09-03 07:45:29 +01:00
Chris Roberts
b856e065f2 Merge pull request #26440 from hashicorp/f-winsvc-service
Add Windows service commands and Event Log support
2025-09-02 17:10:19 -07:00
Chris Roberts
c3dcdb5413 [cli] Add windows service commands (#26442)
Adds a new `windows` command which is available when running on
a Windows hosts. The command includes two new subcommands:

* `service install`
* `service uninstall`

The `service install` command will install the called binary into
the Windows program files directory, create a new Windows service,
setup configuration and data directories, and register the service
with the Window eventlog. If the service and/or binary already
exist, the service will be stopped, service and eventlog updated
if needed, binary replaced, and the service started again.

The `service uninstall` command will stop the service, remove the
Windows service, and deregister the service with the eventlog. It
will not remove the configuration/data directory nor will it remove
the installed binary.
2025-09-02 16:40:35 -07:00
Chris Roberts
61c36bdef7 [winsvc] Add support for Windows Eventlog (#26441)
Defines a `winsvc.Event` type which can be sent using the `winsvc.SendEvent`
function. If nomad is running on Windows and can send to the Windows
Eventlog the event will be sent. Initial event types are defined for
starting, ready, stopped, and log message.

The `winsvc.EventLogger` provides an `io.WriteCloser` that can be included
in the logger's writers collection. It will extract the log level from
log lines and write them appropriately to the eventlog. The eventlog
only supports error, warning, and info levels so messages with other
levels will be ignored.

A new configuration block is included for enabling logging to the
eventlog. Logging must be enabled with the `log_level` option and
the `eventlog.level` value can then be of the same or higher severity.
2025-09-02 16:40:31 -07:00
Chris Roberts
48d91dc1f9 [winsvc] Add interfaces for Windows services and service manager
Provides interfaces to the Windows service manager and Windows
services. These interfaces support creating new Windows services,
deleting Windows services, configuring Windows services, and
registering/deregistering services with Windows Eventlog.

A path helper is included to support expansion of paths using a
subset of known folder IDs.

A privileged helper is included to check that the process is
currently being executed with elevated privileges, which are
required for managing Windows services and modifying the registry.
2025-09-02 16:39:45 -07:00
dependabot[bot]
df3c74ff55 chore(deps): bump github.com/aws/aws-sdk-go-v2/config (#26668) 2025-09-02 14:23:53 +01:00
dependabot[bot]
242cbed90d chore(deps): bump google.golang.org/grpc from 1.74.2 to 1.75.0 (#26670) 2025-09-02 12:25:46 +01:00
dependabot[bot]
3840ae63c0 chore(deps): bump github.com/docker/cli (#26666) 2025-09-02 11:32:51 +01:00
James Rasell
cddc1b0127 config: Validate keyring config to catch invalid provider types. (#26673) 2025-09-02 11:07:49 +01:00
James Rasell
267dc72f4e e2e: Correctly handle IMDSv2 when discovering UI proxy address. (#26674)
The call to IMDSv1 has been failing since we switched to v2 which
meant the UI e2e script attempted to use the service IP address
for its tests. The service IP address is the Nomad client's
private address which is not routable from the e2e test runner
which means the test fails.

This change updates the IP discovery to use IMDSv2 which means the
address is correctly populated and routable. The change also makes
this discovery method by a job action within the proxy job. This
exercises that feature and utilizes it in a way for which it was
designed.
2025-09-02 11:02:48 +01:00
James Rasell
ab2a25018a deps: Update github.com/ulikunitz/xz to v0.5.15 (#26671) 2025-09-02 10:21:42 +01:00
dependabot[bot]
5f09631efe chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/ec2/imds (#26667) 2025-09-01 08:45:40 +01:00
James Rasell
d5f2c0201e e2e: Wait for keyring before starting client intro client agents. (#26660)
Ensuring the keyring is ready before starting the Nomad client in
the client intro e2e test speeds up execution. This is because the
client does not have to wait to retry failed registrations due to
the keyring not being ready.
2025-09-01 07:32:40 +01:00
tehut
87be37e8cc nmd 940/pnpm related build failures (#26659)
* replace yarn with pnpm in build scripts
* pin node version to v20
* pin pnpm version to pnpm@10.15.0
2025-08-29 09:34:58 -07:00
dependabot[bot]
5f1eb5c552 chore(deps): bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 (#26658) 2025-08-29 09:30:11 +01:00
James Rasell
6bd8bc6c0c e2e: Add client intro test to exercise strict enforcement (#26648) 2025-08-29 08:40:48 +01:00
James Rasell
07bd1de72e e2e: Update UI playwright container image to v1.55.0 (#26650) 2025-08-28 16:41:57 +01:00
James Rasell
9e893ef2ad e2e: Add Client Intro test framework and initial test. (#26639)
The new client intro test mimics the Consul and Vault compat tests
and uses local agents to perform the required setup. This method
allows us the flexibility moving forward to test when enforcement
mode is in strict.

The test suite will now be triggered from the test-e2e CI run
and can also be called by a make target.
2025-08-28 09:53:07 +01:00
James Rasell
9d1d5f2f03 csi: Correctly sort IDs when listing controller plugin clients. (#26640) 2025-08-28 08:05:58 +01:00
Michael Smithhisler
485356c3d3 csi: fix volume registration error (#26642) 2025-08-27 15:00:16 -04:00
Tim Gross
5f34867420 build: fix copywrite configuration file syntax (#26644)
Because the Enterprise code has a set of copywrite exclusion entries below the
one listed here in CE, we need to make sure that the last CE line in the
configuration file ends in a comma.
2025-08-27 14:15:24 -04:00
Chris Roberts
fd1e40537c [artifact] add artifact inspection after download (#26608)
This adds artifact inspection after download to detect any issues
with the content fetched. Currently this means checking for any
symlinks within the artifact that resolve outside the task or
allocation directories. On platforms where lockdown is available
(some Linux) this inspection is not performed.

The inspection can be disabled with the DisableArtifactInspection
option. A dedicated option for disabling this behavior allows
the DisableFilesystemIsolation option to be enabled but still
have artifacts inspected after download.
2025-08-27 10:37:34 -07:00
James Rasell
e5eb125264 agent: Ensure node identity renew handler decodes the request body. (#26638)
The HTTP request body contains the node ID where the request should
be routed and without decoding this, we cannot route to anything
other than local nodes.
2025-08-27 14:06:12 +01:00
James Rasell
dcfcbc8f16 ci: Enable SA5008 linting and fix discovered error. (#26633) 2025-08-27 09:24:50 +01:00
Chris Roberts
4b9597a31d [agent] Fix error checking within retry join (#26434)
The `RetryJoin` function checks for an error and logs it before
retrying. The error variables were shadowed which resulted in
the errors never being logged. This predefines the variables
to prevent them from being shadowed.

The testlog package was also updated to support providing a custom
writer which allows logging output to be easily caught and inspected.
2025-08-26 14:18:12 -07:00
James Rasell
71e66231f9 docs: Add node identity and introduction CLI, API, and config docs (#26516)
Co-authored-by: Aimee Ukasick <Aimee.Ukasick@ibm.com>
2025-08-26 15:26:00 +01:00
James Rasell
d0ffb31fea e2e: Add Client Identity get and renew tests. (#26632) 2025-08-26 13:49:06 +01:00
Allison Larson
3fff1aa3cc Support IMDSv2 on windows e2e runners (#26629) 2025-08-25 15:37:50 -07:00
Leah Bush
36d423ceda Merge pull request #26580 from hashicorp/leah/feat/upgrade-node
feat: upgrade node version to v22
2025-08-25 10:02:30 -05:00
Aimee Ukasick
bb7114e518 Docs Chore: Add release notes for 1.10.1-1.10.3 (#26593)
* add 1.10.3

* add 1.10.2

* Add 1.10.1 release notes; add partials to share

* address feedback
2025-08-25 09:38:15 -05:00
dependabot[bot]
6e44a80df0 chore(deps): bump google.golang.org/protobuf from 1.36.7 to 1.36.8 (#26614)
Bumps google.golang.org/protobuf from 1.36.7 to 1.36.8.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.8
  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>
2025-08-25 09:26:50 -04:00
dependabot[bot]
ac4ac733dd chore(deps): bump github.com/zclconf/go-cty from 1.16.3 to 1.16.4 (#26612)
Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.16.3 to 1.16.4.
- [Release notes](https://github.com/zclconf/go-cty/releases)
- [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zclconf/go-cty/compare/v1.16.3...v1.16.4)

---
updated-dependencies:
- dependency-name: github.com/zclconf/go-cty
  dependency-version: 1.16.4
  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>
2025-08-25 09:22:25 -04:00
dependabot[bot]
9a811a4762 chore(deps): bump github.com/hashicorp/cap from 0.9.0 to 0.10.0 (#26611)
Bumps [github.com/hashicorp/cap](https://github.com/hashicorp/cap) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/hashicorp/cap/releases)
- [Changelog](https://github.com/hashicorp/cap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/cap/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/cap
  dependency-version: 0.10.0
  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>
2025-08-25 09:20:00 -04:00
dependabot[bot]
e41c5094e0 chore(deps): bump github.com/aws/aws-sdk-go-v2/config (#26610)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.31.0 to 1.31.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.31.0...config/v1.31.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.31.2
  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>
2025-08-25 09:18:02 -04:00
Chris Roberts
33a72c2d01 [landlock] Allow read access for random content (#26510)
When attempting to clone a git repository within a sandbox that is
configured with landlock, the clone will fail with error messages
related to inability to get random bytes for a temporary file.
Including a read rule for `/dev/urandom` resolves the error
and the git clone works as expected.
2025-08-22 14:04:55 -07:00
Tim Gross
767683ce3e E2E: allow setting instance_type variable (#26607)
When we refactored the E2E provisioning to allow it to be reused by the upgrade
testing, we didn't thread the `instance_type` variable from the main module down
into the `provision-infra` module. This prevents you from setting a custom
instance size when deploying the E2E cluster manually.
2025-08-22 15:22:10 -04:00
Allison Larson
f6a078c7e5 Disable IMDSv2 on windows test instances (#26606) 2025-08-21 16:29:35 -07:00
Juana De La Cuesta
e7868639d6 func: add the correct value for costumer feedback on var error (#26601) 2025-08-21 15:37:53 +02:00
Michael Smithhisler
da4cf07ff4 logs: skip logging SIGPIPE signal (#26582) 2025-08-21 09:08:49 -04:00
dependabot[bot]
d8342aed76 chore(deps): bump golang.org/x/mod from 0.26.0 to 0.27.0 (#26536) 2025-08-21 11:02:54 +00:00
dependabot[bot]
ed967892f2 chore(deps): bump github.com/aws/aws-sdk-go-v2/config (#26537) 2025-08-21 10:47:57 +00:00
Allison Larson
694e0ac2e3 Require IMDSv2 for e2e EC2 instances (#26585)
Re-enables this now that go-discover is updated in all the right places.
2025-08-20 14:47:43 -07:00
Alexey Kulakov
919e5c2aa4 feat(ui): yarn -> pnpm (#26309) 2025-08-20 13:01:22 -07:00