<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #43770 Just updates the error message to make it say what's wrong and what can be done about it. We still abort the entire export because it would be wrong to create a patch policy not associated to an FMA. # 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. - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters. - [ ] Timeouts are implemented and retries are limited to avoid infinite loops - [ ] If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes ## Testing - [x] Added/updated automated tests - [ ] Where appropriate, [automated tests simulate multiple hosts and test for host isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing) (updates to one hosts's records do not affect another) - [x] QA'd all new/changed functionality manually New error message: ``` $ fleetctl generate-gitops --dir ./my-gitops --fleet Example-Fleet Generating GitOps configuration files... Error generating policies for fleet Example-Fleet: The patch policy "macOS - Zen Browser up to date" references a software installer that is no longer a Fleet-maintained app. Please delete the policy manually. Error: Something's gone wrong. Please try again. If this keeps happening please file an issue: https://github.com/fleetdm/fleet/issues/new/choose ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced error handling in the `generate-gitops` command to provide clearer messaging when a patch policy references a Fleet-maintained application that has been removed from the catalog. The command will now abort with explicit guidance, instructing users to manually remove the orphaned policy. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 lines
222 B
Plaintext
2 lines
222 B
Plaintext
Fixed an unclear error message that happened when running `fleetctl generate-gitops` with an existing patch policy for an installer that no longer references a Fleet-maintained app because it was deleted from the catalog.
|