Skip to content

Commit

Permalink
Maintenance mode: check if domain is updated via API
Browse files Browse the repository at this point in the history
  • Loading branch information
zzaakiirr committed Aug 30, 2024
1 parent 02c8a17 commit 5ea8095
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/core/maintenance_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
end

progress.puts
Expand Down

0 comments on commit 5ea8095

Please sign in to comment.