Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/controller/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,25 @@ func (c *Controller) addCluster(lg *logrus.Entry, clusterName spec.NamespacedNam
func (c *Controller) processEvent(event ClusterEvent, isInInitialList bool) {
var clusterName spec.NamespacedName
var clHistory ringlog.RingLogger
var clusterUID types.UID
var err error

lg := c.logger.WithField("worker", event.WorkerID)

if event.EventType == EventAdd || event.EventType == EventSync || event.EventType == EventRepair {
clusterName = util.NameFromMeta(event.NewSpec.ObjectMeta)
clusterUID = event.NewSpec.UID
} else {
clusterName = util.NameFromMeta(event.OldSpec.ObjectMeta)
clusterUID = event.OldSpec.UID
}
lg = lg.WithField("cluster-name", clusterName)

c.clustersMu.RLock()
cl, clusterFound := c.clusters[clusterName]
if clusterFound && cl.UID != clusterUID {
clusterFound = false

@FxKu FxKu Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will lead to an error during deletion, see

Must be the reason why e2e tests always fail with the cluster deletion test (if they even get there)

}
if clusterFound {
clHistory = c.clusterHistory[clusterName]
}
Expand Down
Loading