Skip to content

Cluster sync adj in p&a flavour#1814

Draft
M4KIF wants to merge 1 commit intofeature/database-controllersfrom
jkoterba/feature/cluster-sync-adj
Draft

Cluster sync adj in p&a flavour#1814
M4KIF wants to merge 1 commit intofeature/database-controllersfrom
jkoterba/feature/cluster-sync-adj

Conversation

@M4KIF
Copy link
Copy Markdown

@M4KIF M4KIF commented Apr 2, 2026

Description

everyone!!!!!

Key Changes

Highlight the updates in specific files

Testing and Verification

How did you test these changes? What automated tests are added?

Related Issues

Jira tickets, GitHub issues, Support tickets...

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contribution License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment with the exact sentence copied from below.


I have read the CLA Document and I hereby sign the CLA


2 out of 5 committers have signed the CLA.
@minjieqiu
@DmytroPI-dev
@mploski
@limak9182
@M4KIF
You can retrigger this bot by commenting recheck in this Pull Request

@M4KIF M4KIF changed the base branch from main to feature/database-controllers April 2, 2026 14:35
CNPG cluster
Poolers
Access resources (configmap and secret)
And all of them needs to be set to Ready for our PostgresCluster phase to become Ready?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

yes, that's correct

rewrite to consider taking state of other objects into account
before declaring readyness.

CNPG cluster
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but what I'm missing in the code is checking if CNPG cluster is ready and if yes then updating our ClusterReady condition to true, so at the end (here) we can check if all conditions are true and set whole custom resource status ready to true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Currently? Yes, currently It's mostly a scaffolding to which I will place any business logic.

}
return ctrl.Result{}, patchErr
default:
if statusErr := updateStatus(clusterReady, metav1.ConditionFalse, reasonClusterBuildSucceeded,
Copy link
Copy Markdown

@limak9182 limak9182 Apr 3, 2026

Choose a reason for hiding this comment

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

Here we are updating the status with clusterReady condition False if we patched CNPG Cluster and requeue.
Shouldnt we in the next reconciliation go again to this check again if CNPG cluster is in desired state:

!equality.Semantic.DeepEqual(currentNormalized, desiredNormalized)

and if it is (we are not going inside this if), set the clusterReady condition to true?
Something like:

statusErr := updateStatus(clusterReady, metav1.ConditionTrue...

just after this big if block?

Maybe one more CNPG cluster check is needed, just to be sure it's in healthy and ready state, if not then requeue or leave with error?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

actually after thinking about it, it should be probably after reconcileManagedRoles as it's the last thing we are doing with CNPG cluster.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In general I think It's a bit misleading that we do cluster ready and condtion == false. At least for me, It should be sth like ClusterErrorRetry, like http codes.

Copy link
Copy Markdown

@limak9182 limak9182 Apr 3, 2026

Choose a reason for hiding this comment

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

Sorry I think I don't not fully understand that. By cluster do you mean our PostgresClusterCR or Cluster Ready condition (actual CNPG cluster)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants