From 4989936fc23454f2c0fa7f57823697c411095ee9 Mon Sep 17 00:00:00 2001 From: ShouEnHsiao <117429071+ShouEnHsiao@users.noreply.github.com> Date: Mon, 21 Aug 2023 05:30:25 -0700 Subject: [PATCH] fix: postgresql not deleted with harborcluster (#1064) 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: ShouEnHsiao --- 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",