Skip to content
Snippets Groups Projects

Fix hostname check when fetching ip address

Merged Sanad Liaquat requested to merge qa-test-shl-fix-check-in-public-ip-fetch into master
All threads resolved!
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -13,7 +13,7 @@ module IPAddress
@@ -13,7 +13,7 @@ module IPAddress
def fetch_current_ip_address
def fetch_current_ip_address
# When running on CI against a live environment such as staging.gitlab.com,
# When running on CI against a live environment such as staging.gitlab.com,
# we use the public facing IP address
# we use the public facing IP address
ip_address = if Env.running_in_ci? && !URI.parse(Scenario.gitlab_address).host.include?('test')
ip_address = if Env.running_in_ci? && !URI.parse(Scenario.gitlab_address).host.include?('.test')
response = get(PUBLIC_IP_ADDRESS_API)
response = get(PUBLIC_IP_ADDRESS_API)
raise HostUnreachableError, "#{PUBLIC_IP_ADDRESS_API} is unreachable" unless response.code == Support::API::HTTP_STATUS_OK
raise HostUnreachableError, "#{PUBLIC_IP_ADDRESS_API} is unreachable" unless response.code == Support::API::HTTP_STATUS_OK
Loading