Skip to content

Commit 9ce16c5

Browse files
committed
TUN-9800: Fix docker hub push step
1 parent 29e8d93 commit 9ce16c5

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

.ci/release.gitlab-ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ include:
1616
- release-cloudflared-to-r2
1717
commentImageRefs: false
1818
runner: vm-linux-x86-4cpu-8gb
19-
DOCKER_USER_BRANCH: svcgithubdockerhubcloudflar045
20-
DOCKER_PASSWORD_BRANCH: gitlab/cloudflare/tun/cloudflared/_dev/dockerhub/svc_password/data
19+
# Based on if the CI reference is protected or not the CI component will
20+
# either use _BRANCH or _PROD, therefore, to prevent the pipelines from failing
21+
# we simply set both to the same value.
22+
DOCKER_USER_BRANCH: &docker-hub-user svcgithubdockerhubcloudflar045
23+
DOCKER_PASSWORD_BRANCH: &docker-hub-password gitlab/cloudflare/tun/cloudflared/_dev/dockerhub/svc_password/data
24+
DOCKER_USER_PROD: *docker-hub-user
25+
DOCKER_PASSWORD_PROD: *docker-hub-password
2126
EXTRA_DIB_ARGS: --overwrite
2227

2328
.default-release-job: &release-job-defaults

component-tests/test_tunnel.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,20 @@ def test_tunnel_no_ingress(self, tmp_path, component_tests_config):
3333
LOGGER.debug(config)
3434
with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1"], cfd_args=["run"], new_process=True):
3535
wait_tunnel_ready(require_min_connections=1)
36-
resp = send_request(config.get_url()+"/")
37-
assert resp.status_code == 503, "Expected cloudflared to return 503 for all requests with no ingress defined"
38-
resp = send_request(config.get_url()+"/test")
39-
assert resp.status_code == 503, "Expected cloudflared to return 503 for all requests with no ingress defined"
36+
expected_status_code = 503
37+
resp = send_request(config.get_url()+"/", expected_status_code)
38+
assert resp.status_code == expected_status_code, "Expected cloudflared to return 503 for all requests with no ingress defined"
39+
resp = send_request(config.get_url()+"/test", expected_status_code)
40+
assert resp.status_code == expected_status_code, "Expected cloudflared to return 503 for all requests with no ingress defined"
4041

42+
def retry_if_result_none(result):
43+
'''
44+
Returns True if the result is None, indicating that the function should be retried.
45+
'''
46+
return result is None
4147

42-
@retry(stop_max_attempt_number=MAX_RETRIES, wait_fixed=BACKOFF_SECS * 1000)
43-
def send_request(url, headers={}):
48+
@retry(retry_on_result=retry_if_result_none, stop_max_attempt_number=MAX_RETRIES, wait_fixed=BACKOFF_SECS * 1000)
49+
def send_request(url, expected_status_code=200):
4450
with requests.Session() as s:
45-
return s.get(url, timeout=BACKOFF_SECS, headers=headers)
51+
resp = s.get(url, timeout=BACKOFF_SECS)
52+
return resp if resp.status_code == expected_status_code else None

0 commit comments

Comments
 (0)