-
Notifications
You must be signed in to change notification settings - Fork 50
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
Clean conductors from db during rescaling #620
Clean conductors from db during rescaling #620
Conversation
6997dc7
to
074fc0b
Compare
@@ -446,6 +453,41 @@ func (r *NovaConductorReconciler) ensureDeployment( | |||
return ctrl.Result{}, nil | |||
} | |||
|
|||
func (r *NovaConductorReconciler) cleanServiceFromNovaDb( |
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 can be generalized now as it only differs from the scheduler one by Binary: "nova-conductor"
so that can be passed as a parameter and also the keystoneAuthURL can be taken as a parameter.
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 a68cc8c
condition.DeploymentReadyCondition, | ||
corev1.ConditionTrue, | ||
) | ||
Expect(novaAPIServer.FindRequest("DELETE", "/compute/os-services/3", "")).To(BeTrue()) |
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.
Now that fixture records the query param please assert that the code queried a list of conductor services.
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 a68cc8c
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.
cool. As a follow up add the same to the schedule test
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/14f8c0fdb2054343b690b3a735ca0290 ✔️ nova-operator-content-provider SUCCESS in 2h 26m 29s |
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 see a list of code cleanup possibilities. I did them in a81aba2 If you like it feel free to squash it in.
condition.DeploymentReadyCondition, | ||
corev1.ConditionTrue, | ||
) | ||
Expect(novaAPIServer.FindRequest("DELETE", "/compute/os-services/3", "")).To(BeTrue()) |
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.
cool. As a follow up add the same to the schedule test
controllers/common.go
Outdated
@@ -102,6 +103,35 @@ type conditionsGetter interface { | |||
GetConditions() condition.Conditions | |||
} | |||
|
|||
func cleanNovaServiceFromNovaDb(ctx context.Context, | |||
h *helper.Helper, authURL string, adminUser string, | |||
authPassword string, timeout time.Duration, l logr.Logger, serviceName string) error { |
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.
timeout parameter is unused and therefore can be removed
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 would move the ) error {
to the next line for readability
controllers/common.go
Outdated
func cleanNovaServiceFromNovaDb(ctx context.Context, | ||
h *helper.Helper, authURL string, adminUser string, | ||
authPassword string, timeout time.Duration, l logr.Logger, serviceName string) error { | ||
computeClient, _, err := getNovaClient(ctx, h, authURL, adminUser, authPassword, defaultRequestTimeout, l) |
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.
- It seems that the result return value of getNovaClient is unused so that can also be removed.
- also as far as I see the
defaultRequestTimeout
is also unused in getNovaClient so the whole constant can be removed
err := cleanNovaServiceFromNovaDb(ctx, h, instance.Spec.KeystoneAuthURL, | ||
instance.Spec.ServiceUser, authPassword, defaultRequestTimeout, l, "nova-conductor") |
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 think we can express that the authURL and the user name is coming from the same instance with some refactoring and shrink the parameter list.
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/24ab078f910d428bb75e62abdf90fa15 ✔️ nova-operator-content-provider SUCCESS in 2h 39m 16s |
I cherry-pick commit |
196a029
to
79401a4
Compare
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gibizer, mrkisaolamb 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 |
455707a
into
openstack-k8s-operators:main
No description provided.