-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add method to bump generation in tests #222
Add method to bump generation in tests #222
Conversation
api/test/helpers/harnesses.go
Outdated
@@ -69,6 +73,7 @@ func (harness *MariaDBTestHarness) Setup( | |||
mariadb *TestHelper, | |||
timeout time.Duration, | |||
interval time.Duration, | |||
runUpdateOptional ...bool, |
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.
could we just create a logic in Setup that if UpdateGenerationCR is not provided then we don't run it? We should be able to check if UpdateGenerationCR is a real function or some golang default.
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.
So if not provided the func var will be nil so we can simply check for nil before running it and we dont need to change the signature of Setup. https://go.dev/play/p/oj808HE7Jj8
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.
Done
api/test/helpers/harnesses.go
Outdated
harness.UpdateAccount(newAccountName) | ||
harness.mariaDBHelper.SimulateMariaDBAccountCompleted(newAccountName) | ||
|
||
if harness.runUpdate { | ||
harness.UpdateGenerationCR() | ||
} |
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'm trying to find a better, more generic name for UpdateGenerationCR. As far as I understand the generic logic is that the account is updated and the made ready and then the service CR using the account needs to roll out the usage of the new account and then the finalizer removed from the old account. The impl of rolling out the usage of the new account is now requires extra steps as the service CR can only remove the finalizer if the new generation of the statefulset is ready. So based on that I would name this hook "UseNewAccount" or "SwitchToNewAccount"
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.
Done
In nova we need SimulateDeploymentReplicaReady call after SimulateMariaDBAccountCompleted(newAccountName) too be able reconcile NovaCr. Changes is needed because we added observeGeneration into subCrs and now readines logic depend on generations.
0c8cfdd
to
0c306d2
Compare
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.
This looks good to me
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gibizer, mrkisaolamb, stuggi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test mariadb-operator-build-deploy-kuttl
|
b02b9f3
into
openstack-k8s-operators:main
In nova we need SimulateDeploymentReplicaReady
call after SimulateMariaDBAccountCompleted(newAccountName) too be able reconcile NovaCr. Changes is needed
because we added observeGeneration into subCrs
and now readines logic depend on generations.