diff --git a/playbooks/functional-test/docker.yaml b/playbooks/functional-test/docker.yaml index 80436ca..0a80066 100644 --- a/playbooks/functional-test/docker.yaml +++ b/playbooks/functional-test/docker.yaml @@ -73,10 +73,6 @@ - name: Create a manifest with multi architecture images command: docker manifest create localhost:9000/alpine:3 localhost:9000/alpine:3-amd64 localhost:9000/alpine:3-arm64 - # NOTE(mnaser): This should fail because of the following bug: - # https://github.com/docker/cli/issues/3161 - register: result - failed_when: result.rc != 1 - name: Wipe all images from the local cache (tagged in DockerHub) command: docker rmi docker.io/library/alpine@{{ item.value }} diff --git a/zuul_registry/main.py b/zuul_registry/main.py index d88b8d4..03b3198 100644 --- a/zuul_registry/main.py +++ b/zuul_registry/main.py @@ -72,6 +72,13 @@ class Authorization(cherrypy.Tool): return store[user] == password def unauthorized(self, scope): + # NOTE(mnaser): This is to workaround the following Docker CLI bug and + # should be removed once it is fixed: + # + # https://github.com/docker/cli/issues/3161 + cherrypy.response.headers['Docker-Distribution-Api-Version'] = ( + 'registry/2.0' + ) cherrypy.response.headers['www-authenticate'] = ( 'Bearer realm="%s/auth/token",scope="%s"' % ( self.public_url, scope)