-
Notifications
You must be signed in to change notification settings - Fork 24
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
Extend Operator to PSQL-HA #199
base: main
Are you sure you want to change the base?
Conversation
Dynamic nodes
Added omitempty to nodes to fix existing unit tests
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.
Left some comments.
Overall, make sure the logic you are adding in provisioning and cloning are consistent. There's a few helper functions you add in db_helpers.go and clone_helpers.go. Try to anyalze what's needed in both helpers and consolidate them into some sort of syntatic sugar paradigm (as seen with the requestAppenders) workflow. Also, you'll need to move some of that logic and add to a new file in utils/common
as indicated in one of my comments so that you can use that function in webhooks. Look at how the defaulting and validation of additional arguments is done both in webhooks and in the regular code flow and it should give you an idea. Really great work stuff. I'll be available most of this weekend for questions. let me know if you want to block a few hours so we can work on this together!
// +optional | ||
Nodes []*Node `json:"nodes,omitempty"` | ||
} | ||
type Node struct { |
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.
Remember to validate this in web hooks. e.g validate vmNames being unique, properties correctly defined, etc.
return nil | ||
} | ||
|
||
func createDefaultNodes(database DatabaseInterface) []*v1alpha1.Node { |
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.
Recall that we want to include this in webhooks. In that package we use things from the common package we don't want to use things from this package. So move this logic tocommon/util/haHelpers.go
(maybe that can be the file name) where you specify the DEFAULTING logic so it can be used here and in web-hooks. Also think about what the defaulting logic would look like in case of cloning and provisioning.
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.
created the haHelpers and moved this method to that
@mazin-s Cody messaged you, but since the database_types and webhooks are coupled in the same package, refactoring these methods into |
Updated required nodes to 3 database nodes
end to end test with custom test case
Revert "end to end test with custom test case"
* bumped to gcr.io/kubebuilder/kube-rbac-proxy:v0.16.0 from v0.15.0 to fix security vulnerability * bumped to v0.5.2 * bumped up to 0.5.1
…b-operator into webhook-test-update
Webhook test update
end to end test with custom test case
What this PR does / why we need it:
Provision and clone postgres-ha databases. Continues work from another semester, reading in k8s resources to create that database (and proxy).
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):How Has This Been Tested?:
Unit tests run correctly to ensure no breaking changes.
We are working on the end-to-end tests.
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: