Category
Error handling gaps
Description
DeleteManagedSecrets and DeleteManagedServices in internal/resources/resources.go return immediately on the first non-NotFound deletion error. This means if the third of ten secrets fails to delete, the remaining seven are never attempted. The caller receives an error for one resource but has no way to know which resources were skipped.
For cleanup operations, this is particularly problematic — a transient error on one resource abandons cleanup of all remaining resources, requiring the user to re-run cleanup to catch the rest.
Severity
Medium — increases maintenance burden or risk of future bugs
Affected Files
internal/resources/resources.go:70-96 — DeleteManagedSecrets returns on first delete error, skipping remaining secrets
internal/resources/resources.go:100-126 — DeleteManagedServices has the same early-return pattern
Proposed Fix
Collect all deletion errors using errors.Join (or a slice) and continue attempting to delete remaining resources. Return the aggregated error along with the count of successfully deleted resources. This gives the caller a complete picture and maximizes cleanup progress on each invocation.
Area
Cleanup
Architecture Layer
Layer 2 - K8s Abstractions (vm, resources, wait)
Category
Error handling gaps
Description
DeleteManagedSecretsandDeleteManagedServicesininternal/resources/resources.goreturn immediately on the first non-NotFound deletion error. This means if the third of ten secrets fails to delete, the remaining seven are never attempted. The caller receives an error for one resource but has no way to know which resources were skipped.For cleanup operations, this is particularly problematic — a transient error on one resource abandons cleanup of all remaining resources, requiring the user to re-run cleanup to catch the rest.
Severity
Medium — increases maintenance burden or risk of future bugs
Affected Files
internal/resources/resources.go:70-96—DeleteManagedSecretsreturns on first delete error, skipping remaining secretsinternal/resources/resources.go:100-126—DeleteManagedServiceshas the same early-return patternProposed Fix
Collect all deletion errors using
errors.Join(or a slice) and continue attempting to delete remaining resources. Return the aggregated error along with the count of successfully deleted resources. This gives the caller a complete picture and maximizes cleanup progress on each invocation.Area
Cleanup
Architecture Layer
Layer 2 - K8s Abstractions (vm, resources, wait)