diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index e99cafcc..f1532a00 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -170,30 +170,44 @@ jobs: echo '{"storage-driver":"overlay2"}' | sudo tee /etc/docker/daemon.json sudo systemctl restart docker docker version + - name: Login to Docker Hub + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_CI_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_CI_TOKEN }} + if: env.DOCKERHUB_USERNAME != '' + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 + with: + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_TOKEN }} - name: List Tailscale versions to pre-pull id: versions run: | versions=$(nix develop --command go run ./cmd/hi list-versions --set=must --exclude=head) echo "versions=${versions}" >> "$GITHUB_OUTPUT" echo "Pre-pulling: ${versions}" - - name: Pull released Tailscale images + - name: Pull Tailscale images run: | - # ghcr.io public reads are anonymous and unmetered, so no docker - # login is needed even on fork PRs without DOCKERHUB_USERNAME. - # Pull in parallel; xargs -P 0 fans out one process per tag and - # returns non-zero if any pull fails. - echo "${{ steps.versions.outputs.versions }}" \ - | tr ' ' '\n' \ - | xargs -P 0 -I{} docker pull "ghcr.io/tailscale/tailscale:{}" + # Releases come from ghcr.io (anonymous, unmetered). The + # "unstable" floating tag on ghcr.io has been stale since 2022, + # so it still needs to come from Docker Hub. xargs -P 0 fans + # out one process per tag and returns non-zero if any pull + # fails. + refs="" + for v in ${{ steps.versions.outputs.versions }}; do + if [ "${v}" = "unstable" ]; then + refs="${refs} tailscale/tailscale:${v}" + else + refs="${refs} ghcr.io/tailscale/tailscale:${v}" + fi + done + echo "${refs}" | tr ' ' '\n' | grep -v '^$' \ + | xargs -P 0 -I{} docker pull "{}" + echo "REFS=${refs}" >> "$GITHUB_ENV" - name: Save Tailscale images to tarball run: | # Single docker save with all refs: one consistent snapshot, no # parallel-daemon race. - refs="" - for v in ${{ steps.versions.outputs.versions }}; do - refs="${refs} ghcr.io/tailscale/tailscale:${v}" - done - docker save ${refs} | gzip > tailscale-released-images.tar.gz + docker save ${REFS} | gzip > tailscale-released-images.tar.gz ls -lh tailscale-released-images.tar.gz - name: Upload Tailscale released images uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 diff --git a/integration/tsic/tsic.go b/integration/tsic/tsic.go index 1c99f41a..9893f5d5 100644 --- a/integration/tsic/tsic.go +++ b/integration/tsic/tsic.go @@ -522,7 +522,10 @@ func New( } } case "unstable": - tailscaleOptions.Repository = "ghcr.io/tailscale/tailscale" + // ghcr.io/tailscale/tailscale:unstable is stale (last updated + // 2022); only tailscale/tailscale on Docker Hub publishes + // current unstable builds. + tailscaleOptions.Repository = "tailscale/tailscale" tailscaleOptions.Tag = version err = dockertestutil.PullWithAuth(pool, tailscaleOptions.Repository+":"+tailscaleOptions.Tag)