Improving Postgres CR Status with Additional Details#2714
Improving Postgres CR Status with Additional Details#2714RavinaChidambaram wants to merge 6 commits intozalando:masterfrom
Conversation
Signed-off-by: RavinaChidambaram <cravina.19@gmail.com>
Signed-off-by: RavinaChidambaram <cravina.19@gmail.com>
|
Hi @FxKu , Is there any update on this PR? |
|
I had to concentrate on the 1.13.0 release. But we will definitely include it in the next release in autumn. This is a great addition. I have to focus on some internal projects for the next weeks, but still, I hope to find some time in between to review. |
|
@RavinaChidambaram can you fix the failing unit test so e2e pipeline can run? There are places where we logged the status assuming it's just a string. Now that it has become a struct you either have to change to %#v when formatting the log lines or specify the |
| type Condition struct { | ||
| Type ConditionType `json:"type" description:"type of status condition"` | ||
| Status v1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` | ||
| LastTransitionTime VolatileTime `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"` |
There was a problem hiding this comment.
why use an extra type and not just metav1.Time?
There was a problem hiding this comment.
Mostly to avoid semantic check inequality with metav1.time, with a wrapper around metav1.time there won't be a semantic inequality even if the times are different but everything else in the CR is same, this could be handy while writing unit tests or e2e tests I think
|
As half of my comments target the scale subresource, I would suggest to remove it from here and create a separate PR for it. Then you could concentrate only on the status and we get it merged quicker. Have you tried to run code-generation. I think, the generated code has to get updated with the new status structure. |
Signed-off-by: RavinaChidambaram <cravina.19@gmail.com>
|
I have made changes to fix the unit tests and successfully ran code-generation, unit tests and e2e test downstream. |
Signed-off-by: RavinaChidambaram <cravina.19@gmail.com>
|
Hi @FxKu , any updates? |
|
@RavinaChidambaram sorry for not coming back sooner. I see that you did not reflect all my comments. I also do wonder if we have to change the code logic and move the SetPostgresCRDStatus into another package so that the signature can remain the same
would always be constructed in the same way. WDYT? |
|
I think I have made all the changes that you mentioned, except for the metav1.time. And I have mentioned the reason for using that in the thread itself. Kindly let me know what you think about that. |
|
Cannot start a pipeline due to: Click on pipeline status check Details link below for more information. |
|
Hi @FxKu , |
Fixes #2669
Following things have been added:
observedGenerationconditionsof typeReconciliationSuccessfulandReadynumberOfInstancesandlabelSelectorfor scale subresourcepostgresClusterStatusis still part of the CRDDetailed example flow:
Conditions are updated everytime there is a change in
PostgresClusterStatus. And if the cluster is running successfully, the status looks like:If there is a transition from Running state to a failed state, type
ReconciliationSuccessfulwill be false.When a failed case (Create failed,Update failed, Sync failed) is encountered, the error message will be printed in the
messageinconditions