Skip to content

Commit

Permalink
Improve gitops dry run logging for query deletion (#23202)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamtheaker authored Oct 25, 2024
1 parent a97e6ef commit 86713f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit 86713f1

Please sign in to comment.