hashicorp / hashicorp/nomad

allow `nomad config validate` to include command line flags in validation

Open
#25,205 4 comments 0 reactions 0 assignees View on GitHub
theme/config type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Output from `nomad version`
Nomad v1.8.4
BuildDate 2024-09-17T20:18:34Z
Revision 22ab32e6cff66cf52f5e3f115b93de776bc09583
### Operating system and Environment details
macOS 15.3.1 (though issue is not OS-specific)
### Issue
Running `nomad config validate` doesn't work on a `config.hcl` file that contains both `client {}` and `server {}` blocks.
My understanding is that this is a valid configuration (we use it in production), and just launch the agent with the `-client` or `-server` flag as appropriate for the machine.

### Reproduction steps

#### Expected Result
Config is validated
#### Actual Result
```
Must specify either server, client or dev mode for the agent.
Configuration is invalid
```
### Job file (if appropriate)

### Nomad Server logs (if appropriate)

### Nomad Client logs (if appropriate)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the implementation of the `nomad config validate` command and reproduce the failure using a configuration containing both `client {}` and `server {}` blocks. Trace how agent mode is selected and determine how command-line flags should participate in validation; done means the configuration validates successfully when the appropriate mode flag is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.