Skip to content

Commit 6ff299e

Browse files
authored
airbyte-ci: only set docker hub secrets on dagger client if they exist (#31752)
1 parent 15c3c41 commit 6ff299e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

airbyte-ci/connectors/pipelines/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ This command runs the Python tests for a airbyte-ci poetry package.
399399
## Changelog
400400
| Version | PR | Description |
401401
| ------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
402+
| 2.2.6 | [#31752](https://github.com/airbytehq/airbyte/pull/31752) | Only authenticate when secrets are available.
402403
| 2.2.5 | [#31718](https://github.com/airbytehq/airbyte/pull/31718) | Authenticate the sidecar docker daemon to DockerHub. |
403404
| 2.2.4 | [#31535](https://github.com/airbytehq/airbyte/pull/31535) | Improve gradle caching when building java connectors. |
404405
| 2.2.3 | [#31688](https://github.com/airbytehq/airbyte/pull/31688) | Fix failing `CheckBaseImageUse` step when not running on PR. |

airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/pipeline.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,17 @@ async def run_connectors_pipelines(
9090
# HACK: This is to get a long running dockerd service to be shared across all the connectors pipelines
9191
# Using the "normal" service binding leads to restart of dockerd during pipeline run that can cause corrupted docker state
9292
# See https://github.com/airbytehq/airbyte/issues/27233
93-
docker_hub_username_secret = dagger_client.set_secret("DOCKER_HUB_USERNAME", contexts[0].docker_hub_username)
94-
docker_hub_password_secret = dagger_client.set_secret("DOCKER_HUB_PASSWORD", contexts[0].docker_hub_password)
9593

96-
dockerd_service = docker.with_global_dockerd_service(dagger_client, docker_hub_username_secret, docker_hub_password_secret)
94+
docker_hub_username = contexts[0].docker_hub_username
95+
docker_hub_password = contexts[0].docker_hub_password
96+
97+
if docker_hub_username and docker_hub_password:
98+
docker_hub_username_secret = dagger_client.set_secret("DOCKER_HUB_USERNAME", docker_hub_username)
99+
docker_hub_password_secret = dagger_client.set_secret("DOCKER_HUB_PASSWORD", docker_hub_password)
100+
dockerd_service = docker.with_global_dockerd_service(dagger_client, docker_hub_username_secret, docker_hub_password_secret)
101+
else:
102+
dockerd_service = docker.with_global_dockerd_service(dagger_client)
103+
97104
async with anyio.create_task_group() as tg_main:
98105
tg_main.start_soon(dockerd_service.sync)
99106
await ( # Wait for the docker service to be ready

airbyte-ci/connectors/pipelines/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pipelines"
7-
version = "2.2.5"
7+
version = "2.2.6"
88
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
99
authors = ["Airbyte <[email protected]>"]
1010

0 commit comments

Comments
 (0)