Fix the tangle in cluster statuses

Description

Be aware that any changes in statuses may affect compatibility with DBaaS-CLI tool and other 3d-party libs/tools.

  1. There are duplicating (overlapping) statuses:

  2. Most of the statuses here in fact untyped constants: https://github.com/percona/percona-xtradb-cluster-operator/blob/6a7ccc3958ab4bad99580a77c4be9c52d30d000a/pkg/apis/pxc/v1/pxc_types.go#L83-L97 which already lead to misuse of "types" here https://github.com/percona/percona-xtradb-cluster-operator/blob/6a7ccc3958ab4bad99580a77c4be9c52d30d000a/pkg/controller/pxc/status.go#L31 and here https://github.com/percona/percona-xtradb-cluster-operator/blob/6a7ccc3958ab4bad99580a77c4be9c52d30d000a/pkg/controller/pxc/status.go#L42 - `cr.Status.Status` has type `api.AppState` but it being compared and set to const that intend to be `api.ClusterConditionType`

  3. The logic in `cr.updateStatus()` (https://github.com/percona/percona-xtradb-cluster-operator/blob/6a7ccc3958ab4bad99580a77c4be9c52d30d000a/pkg/controller/pxc/status.go#L23) is so bloody sophisticated. I'm sure it can be simplified. Anyway the logic should be described in some way in the comments, plus it gonna be lovely to have unit tests to cover all that stuff.

  4. Also, it might be worth to align PXC & PSMDB some statues. Like:

Environment

None

Smart Checklist

Activity

Done

Details

Assignee

Reporter

Time tracking

7h 35m logged

Fix versions

Priority

Smart Checklist

Created June 30, 2020 at 10:39 AM
Updated March 5, 2024 at 6:13 PM
Resolved August 9, 2021 at 8:08 AM