Cluster controller first iteration#1688
Cluster controller first iteration#1688DmytroPI-dev merged 1 commit intofeature/database-controllersfrom
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
cf2c9aa to
2d6dd0f
Compare
| // 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()) |
There was a problem hiding this comment.
i dont think we need patching for setting status, simple update is good enough
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
same here, not sure why it is here
62943b3 to
a2770c5
Compare
3a701c4
into
feature/database-controllers
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