TUN-9800: Fix docker hub push step
This commit is contained in:
parent
29e8d936f2
commit
9ce16c5aac
|
|
@ -16,8 +16,13 @@ include:
|
|||
- release-cloudflared-to-r2
|
||||
commentImageRefs: false
|
||||
runner: vm-linux-x86-4cpu-8gb
|
||||
DOCKER_USER_BRANCH: svcgithubdockerhubcloudflar045
|
||||
DOCKER_PASSWORD_BRANCH: gitlab/cloudflare/tun/cloudflared/_dev/dockerhub/svc_password/data
|
||||
# Based on if the CI reference is protected or not the CI component will
|
||||
# either use _BRANCH or _PROD, therefore, to prevent the pipelines from failing
|
||||
# we simply set both to the same value.
|
||||
DOCKER_USER_BRANCH: &docker-hub-user svcgithubdockerhubcloudflar045
|
||||
DOCKER_PASSWORD_BRANCH: &docker-hub-password gitlab/cloudflare/tun/cloudflared/_dev/dockerhub/svc_password/data
|
||||
DOCKER_USER_PROD: *docker-hub-user
|
||||
DOCKER_PASSWORD_PROD: *docker-hub-password
|
||||
EXTRA_DIB_ARGS: --overwrite
|
||||
|
||||
.default-release-job: &release-job-defaults
|
||||
|
|
|
|||
|
|
@ -33,13 +33,20 @@ class TestTunnel:
|
|||
LOGGER.debug(config)
|
||||
with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1"], cfd_args=["run"], new_process=True):
|
||||
wait_tunnel_ready(require_min_connections=1)
|
||||
resp = send_request(config.get_url()+"/")
|
||||
assert resp.status_code == 503, "Expected cloudflared to return 503 for all requests with no ingress defined"
|
||||
resp = send_request(config.get_url()+"/test")
|
||||
assert resp.status_code == 503, "Expected cloudflared to return 503 for all requests with no ingress defined"
|
||||
expected_status_code = 503
|
||||
resp = send_request(config.get_url()+"/", expected_status_code)
|
||||
assert resp.status_code == expected_status_code, "Expected cloudflared to return 503 for all requests with no ingress defined"
|
||||
resp = send_request(config.get_url()+"/test", expected_status_code)
|
||||
assert resp.status_code == expected_status_code, "Expected cloudflared to return 503 for all requests with no ingress defined"
|
||||
|
||||
def retry_if_result_none(result):
|
||||
'''
|
||||
Returns True if the result is None, indicating that the function should be retried.
|
||||
'''
|
||||
return result is None
|
||||
|
||||
@retry(stop_max_attempt_number=MAX_RETRIES, wait_fixed=BACKOFF_SECS * 1000)
|
||||
def send_request(url, headers={}):
|
||||
@retry(retry_on_result=retry_if_result_none, stop_max_attempt_number=MAX_RETRIES, wait_fixed=BACKOFF_SECS * 1000)
|
||||
def send_request(url, expected_status_code=200):
|
||||
with requests.Session() as s:
|
||||
return s.get(url, timeout=BACKOFF_SECS, headers=headers)
|
||||
resp = s.get(url, timeout=BACKOFF_SECS)
|
||||
return resp if resp.status_code == expected_status_code else None
|
||||
|
|
|
|||
Loading…
Reference in New Issue