-
Notifications
You must be signed in to change notification settings - Fork 3
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
Maintenance mode: check if domain is updated via API #229
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,9 +84,13 @@ def start_or_stop_maintenance_workload(action) | |
def switch_domain_workload(to:) | ||
step("Switching workload for domain '#{domain_data['name']}' to '#{to}'") do | ||
cp.set_domain_workload(domain_data, to) | ||
end | ||
|
||
step("Waiting for changes to take effect", retry_on_failure: true, wait: 10, max_retry_count: 3) do | ||
refetched_domain_data = cp.fetch_domain(domain_data["name"]) | ||
raise "Can't find domain" if refetched_domain_data.nil? | ||
|
||
# Give it a bit of time for the domain to update | ||
Kernel.sleep(30) | ||
cp.domain_workload_matches?(refetched_domain_data, to) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rafaelgomesxyz Is this check enough to be sure that domain was updated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The arbitrary sleep we had before wasn't really to check if the domain value was updated in the workload (after all, this should be true immediately when it first runs, no?). The sleep was for waiting for DNS changes to take effect, which can sometimes take a bit. So we'd need a different method for checking it (we'd essentially need to check if the domain is working for the switched workload). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do you have any ideas how can we check this? Maybe controlplane displays some message while workload change takes effect? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zzaakiirr A way I can think of is to make a real request to the domain and see if it's displaying the regular page or the maintenance page. I'm not sure if there's a better way to do it. |
||
end | ||
|
||
progress.puts | ||
|
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.
@borela should we be using https://github.com/shakacode/uber_task?
@zzaakiirr is this ready to merge?
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.
@justin808 I left a question for @rafaelgomesxyz, I want to get his opinion on approach I took in this PR for checking if domain was updated.
If this is the right way and Rafael approves this PR then we can merge this