-
Notifications
You must be signed in to change notification settings - Fork 127
Cluster controller first iteration #1688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster controller first iteration #1688
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.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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