Skip to content

Commit

Permalink
fix: postgresql not deleted with harborcluster (goharbor#1064)
Browse files Browse the repository at this point in the history
This CL is from goharbor#1014
which adds ownerReference to expectCR in PostgreSQLController.Update before comparing.
Origin expectCR have no OwnerReference.

Signed-off-by: ShouEnHsiao <[email protected]>
  • Loading branch information
ShouEnHsiao authored Aug 21, 2023
1 parent eea6b24 commit 4989936
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/cluster/controllers/database/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4989936

Please sign in to comment.