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

Log which apps are being awaited before continuing deletion #537

Merged
merged 2 commits into from
Sep 23, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Log which apps are being awaited before continuing deletion

## [2.23.1] - 2024-08-19

### Changed
Expand Down
9 changes: 7 additions & 2 deletions service/controller/resource/app/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"context"
"fmt"
"strings"
"time"

"github.com/giantswarm/apiextensions-application/api/v1alpha1"
Expand Down Expand Up @@ -49,7 +50,11 @@ func (r Resource) EnsureDeleted(ctx context.Context, obj interface{}) error {
if err != nil {
return microerror.Mask(err)
} else if len(apps) > 0 {
r.logger.Debugf(ctx, "waiting for %d apps to be deleted for cluster '%s/%s'", len(apps), cr.GetNamespace(), key.ClusterID(&cr))
var appNames []string
for _, app := range apps {
appNames = append(appNames, app.Name)
}
r.logger.Debugf(ctx, "waiting for %d apps to be deleted for cluster '%s/%s': %s", len(apps), cr.GetNamespace(), key.ClusterID(&cr), strings.Join(appNames, ", "))
return r.cancel(ctx)
}

Expand Down Expand Up @@ -106,7 +111,7 @@ func (r Resource) deleteClusterApps(ctx context.Context, apps []*v1alpha1.App) e
// namely when `prune: false` is used and app is gone in the repository,
// but there is no way to recognize this case here.
if key.IsManagedByFlux(*app) {
r.logger.Debugf(ctx, "skipping Flux-managed '%s/%s' app", app.Namespace, app.Name)
r.logger.Debugf(ctx, "skipping Flux-managed '%s/%s' app in deletion", app.Namespace, app.Name)
continue
}

Expand Down
Loading