diff --git a/tools/reaper/README.md b/tools/reaper/README.md index 8dcca14..34a6d42 100644 --- a/tools/reaper/README.md +++ b/tools/reaper/README.md @@ -37,6 +37,8 @@ compute.googleapis.com/InstanceTemplate: gke-flux-test-full-dove-default-pool-42 compute.googleapis.com/InstanceTemplate: gke-flux-test-full-dove-default-pool-dcded0bb container.googleapis.com/Cluster: flux-test-full-dove artifactregistry.googleapis.com/Repository: projects/darkowlzz-gcp/locations/us-central1/repositories/flux-test-full-dove +2023/11/04 00:49:45 resources found but not deleted +exit status 1 ``` JSON output is also supported: diff --git a/tools/reaper/main.go b/tools/reaper/main.go index eb58608..3c26b10 100644 --- a/tools/reaper/main.go +++ b/tools/reaper/main.go @@ -205,6 +205,11 @@ func main() { } } } + } else if !*delete && len(resources) > 0 { + // Exit with non-zero exit code when resources are found but not + // deleted. This is to help detect stale resources when run in CI by + // failing the job. + log.Fatal("resources found but not deleted") } }