Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve gitops dry run logging for query deletion #23202

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Configuration/yaml-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ org_settings:
- `live_query_disabled` disables the ability to run live queries (ad hoc queries executed via the UI or fleetctl) (default: `false`).
- `query_reports_disabled` disables query reports and deletes existing repors (default: `false`).
- `query_report_cap` sets the maximum number of results to store per query report before the report is clipped. If increasing this cap, we recommend enabling reports for one query at time and monitoring your infrastructure. (Default: `1000`)
- `scripts_disabled` blocks access to run scripts. Scripts may still be added in the UI and CLI (defaul: `false`).
- `scripts_disabled` blocks access to run scripts. Scripts may still be added in the UI and CLI (default: `false`).
- `server_url` is the base URL of the Fleet instance (default: provided during Fleet setup)

Can only be configured for all teams (`org_settings`).
Expand Down
6 changes: 5 additions & 1 deletion server/service/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,11 @@ func (c *Client) doGitOpsQueries(config *spec.GitOps, logFn func(format string,
}
if !found {
queriesToDelete = append(queriesToDelete, oldQuery.ID)
fmt.Printf("[-] deleting query %s\n", oldQuery.Name)
if !dryRun {
fmt.Printf("[-] deleting query %s\n", oldQuery.Name)
} else {
fmt.Printf("[-] would've deleted query %s\n", oldQuery.Name)
}
}
}
if len(queriesToDelete) > 0 {
Expand Down
Loading