Files
fleet/changes/43857-improve-error-on-missing-gitops-name
T
Scott Gress 348fa47c84 Improve name key validation in GitOps (#44553)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
  - [X] omitted `name:` from a file without `org_settings:`, got:
```
	* No `name` was provided in /tmp/testback/fleets/third-fleet.yml. If this file is intended to define org-level settings, add `org_settings:` as a top-level key. Otherwise, use `name` to specify the fleet name.
```
  - [X] omitted `name:` from a file with `org_settings:`, got no error.
  - [X] omitted `name:` from `no-team.yml`, got:
```
	* `name` must be `No Team` for `no-team.yml`
```
  - [X] omitted `name:` from `unassigned.yml`, got:
```
	* `name` must be `Unassigned` for `unassigned.yml`
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved error messages when GitOps YAML files omit the required
`name` field, with specific remediation guidance tailored to each
configuration file type
* Enhanced validation error messaging when top-level `org_settings` is
missing or incorrectly placed, providing clearer instructions on
required YAML structure

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-11 13:49:02 -05:00

2 lines
69 B
Plaintext

- Improved error when `name` key is omitted from a GitOps YAML file.