From 594b110416045794cb4c077a9e3b6703ca2b3e63 Mon Sep 17 00:00:00 2001 From: ShouEnHsiao Date: Tue, 8 Aug 2023 06:03:00 +0000 Subject: [PATCH] fix: postgresql not deleted with harborcluster This CL is from https://github.com/goharbor/harbor-operator/pull/1014 which adds ownerReference to expectCR in PostgreSQLController.Update before comparing. Origin expectCR have no OwnerReference. Signed-off-by: Shou-En Hsiao --- pkg/cluster/controllers/database/update.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/cluster/controllers/database/update.go b/pkg/cluster/controllers/database/update.go index 8a5ac428b..dbe706998 100644 --- a/pkg/cluster/controllers/database/update.go +++ b/pkg/cluster/controllers/database/update.go @@ -36,6 +36,8 @@ func (p *PostgreSQLController) Update(ctx context.Context, harborcluster *goharb return databaseNotReadyStatus(DefaultUnstructuredConverterError, err.Error()), err } + expectCR.SetOwnerReferences(actualCR.GetOwnerReferences()) + if !common.Equals(ctx, p.Scheme, harborcluster, &actualCR) { p.Log.Info( "Update Database resource",