cleanup app when workspace is deleted

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2021-08-05 17:37:12 +08:00
parent 418a2a09c7
commit 3e5822a0b2
6 changed files with 347 additions and 6 deletions

View File

@@ -338,7 +338,10 @@ func convertApp(app *v1alpha1.HelmApplication, versions []*v1alpha1.HelmApplicat
}
out.AppVersionTypes = "helm"
out.Isv = app.GetWorkspace()
// If this keys exists, the workspace of this app has been deleted, set the isv to empty.
if _, exists := app.Annotations[constants.DangingAppCleanupKey]; !exists {
out.Isv = app.GetWorkspace()
}
out.ClusterTotal = &rlsCount
out.Owner = app.GetCreator()