Skip to content

Commit

Permalink
fix: postgresql not deleted with harborcluster
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 committed Aug 8, 2023
1 parent f06cd9e commit 7b1ec05
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 7b1ec05

Please sign in to comment.