Skip to content

Commit

Permalink
update documentation and improve deletion logs
Browse files Browse the repository at this point in the history
  • Loading branch information
FxKu committed Mar 12, 2024
1 parent 1abc370 commit e5ece83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions docs/reference/operator_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,11 @@ configuration they are grouped under the `kubernetes` key.
cannot fully sync it, there can be leftovers. By enabling finalizers the
operator will ensure all managed resources are deleted prior to the
Postgresql resource. There is a trade-off though: The deletion is only
performed at the next cluster SYNC cycle when finding a `deletionTimestamp`
in the metadata and not immediately after issueing a delete command. The
final removal of the custom resource will add a DELETE event to the worker
queue but the child resources are already gone at this point.
performed after the next two SYNC cycles with the first one updating the
internal spec and the latter reacting on the `deletionTimestamp` while
processing the SYNC event. The final removal of the custom resource will
add a DELETE event to the worker queue but the child resources are already
gone at this point.
The default is `false`.

* **enable_pod_disruption_budget**
Expand Down
2 changes: 0 additions & 2 deletions pkg/controller/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ func (c *Controller) processEvent(event ClusterEvent) {
c.curWorkerCluster.Store(event.WorkerID, cl)

// has this cluster been marked as deleted already, then we shall start cleaning up
lg.Infof("cluster DeletionTimestamp is %s", cl.ObjectMeta.DeletionTimestamp)
if !cl.ObjectMeta.DeletionTimestamp.IsZero() {
lg.Infof("cluster has a DeletionTimestamp of %s, starting deletion now.", cl.ObjectMeta.DeletionTimestamp.Format(time.RFC3339))
if err = cl.Delete(); err != nil {
Expand All @@ -340,7 +339,6 @@ func (c *Controller) processEvent(event ClusterEvent) {
lg.Error(cl.Error)
return
}
lg.Infof("cluster has been deleted")
} else {
if err = cl.Sync(event.NewSpec); err != nil {
cl.Error = fmt.Sprintf("could not sync cluster: %v", err)
Expand Down

0 comments on commit e5ece83

Please sign in to comment.