Skip to content

Conversation

@DmytroPI-dev
Copy link

@DmytroPI-dev DmytroPI-dev commented Feb 5, 2026

Description

Cluster controller for CNPG first iteration

Key Changes

Drafted API and controller for Cluster controller

Testing and Verification

Manual tests only

Related Issues

JIRA: CPI-1883

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
Contributor

github-actions bot commented Feb 5, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@DmytroPI-dev
Copy link
Author

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

@DmytroPI-dev
Copy link
Author

recheck

@DmytroPI-dev DmytroPI-dev force-pushed the feature/database-controllers-cluster-controller branch from cf2c9aa to 2d6dd0f Compare February 10, 2026 15:40
// syncStatus is a helper function to map CNPG Cluster state to PostgresCluster object and commit it to API.
func (r *PostgresClusterReconciler) syncStatus(ctx context.Context, postgresCluster *enterprisev4.PostgresCluster, cnpgCluster *cnpgv1.Cluster, err error) error {
// will use Patch as we did for main reconciliation loop.
latestPGCluster := client.MergeFrom(postgresCluster.DeepCopy())
Copy link
Collaborator

Choose a reason for hiding this comment

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

i dont think we need patching for setting status, simple update is good enough

Copy link
Author

Choose a reason for hiding this comment

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

I was using Update initially, but it causes error as below:

"Operation cannot be fulfilled on postgresclusters.enterprise.splunk.com \"postgresql-cluster-dev-overridden\": the object has been modified; please apply your changes to the latest version and try again". 

As this was the very same error I noticed earlier, when decided to switch from Update to Patch in Reconcile method, I decided to use Patch here as well. If the above error is not critical, we can use Update, of course, but I assume that any error logs will be confusing, though it resolves automatically in next reconciliation loop.


// If CNPG is missing, or in a transitional state (not Ready/Failed), we'll keep checking.
if postgresCluster.Status.Phase == "Pending" || postgresCluster.Status.Phase == "Provisioning" {
return ctrl.Result{RequeueAfter: retryDelay}, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, not sure why it is here

@DmytroPI-dev DmytroPI-dev force-pushed the feature/database-controllers-cluster-controller branch from 62943b3 to a2770c5 Compare February 13, 2026 11:43
@DmytroPI-dev DmytroPI-dev marked this pull request as ready for review February 13, 2026 11:44
@mploski mploski self-requested a review February 13, 2026 11:47
@DmytroPI-dev DmytroPI-dev merged commit 3a701c4 into feature/database-controllers Feb 13, 2026
7 of 11 checks passed
@DmytroPI-dev DmytroPI-dev deleted the feature/database-controllers-cluster-controller branch February 13, 2026 11:50
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants