Skip to content

Commit

Permalink
fix: postgresql not deleted with harborcluster
Browse files Browse the repository at this point in the history
add ownerReference to expectCR in PostgreSQLController.Update before comparing.
Origin expectCR have no OwnerReference .
  • Loading branch information
samuelchen authored Feb 6, 2023
1 parent 9c19b15 commit 98b811c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cluster/controllers/database/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func (p *PostgreSQLController) Update(ctx context.Context, harborcluster *goharb
FromUnstructured(expectUnstructuredCR.UnstructuredContent(), &expectCR); err != nil {
return databaseNotReadyStatus(DefaultUnstructuredConverterError, err.Error()), err
}


expectCR.SetOwnerReferences(actualCR.GetOwnerReferences())

if !common.Equals(ctx, p.Scheme, harborcluster, &actualCR) {
p.Log.Info(
"Update Database resource",
Expand Down

0 comments on commit 98b811c

Please sign in to comment.