hashicorp / hashicorp/nomad

No error on volume create if JSON invalid

Open
#17,542 1 comment 1 reaction 0 assignees View on GitHub
stage/accepted theme/api theme/storage type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
```
nomad version
Nomad v1.3.2 (bf602974112964e9691729f3f0716ff2bcdb3b44)
```

### Operating system and Environment details
```
CentOS Linux release 7.9.2009 (Core)
```

### Issue
JSON file is not verified when Nomad command to create a volume is launched.

### Reproduction steps
- Create an invalid JSON volume file (a comma is missing after "parameters" dictionnary)
```
> cat volume.json
{
"id": "volume-01",
"name" : "volume-01",
"type" : "csi",
"plugin_id" : "csi",
"capacity_min" : "100GiB",
"capacity_max" : "100GiB",
"capability": {
"access_mode" : "single-node-writer",
"attachment_mode" : "file-system"
},
"parameters": {
"type" : "io1",
"iopspergb": "100"
} <----- COMMA IS MISSING
"mount_options": {
"fs_type": "ext4"
}
}
```
- Launch the command "nomad volume create volume.json"
- The volume is created but can't be formated/mounted because csi plugin uses XFS by default and it doesn't works on our distribution. Format ext4 is ignored in the "mount_options".

#### Expected Result
An error which says that JSON is invalid.

#### Actual Result
```
nomad volume create volume.json
Created external volume vol-XXXXXX with ID volume-01
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.