Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing write access to registry does not throw exception #445

Open
puinenveturi opened this issue May 26, 2020 · 0 comments
Open

Missing write access to registry does not throw exception #445

puinenveturi opened this issue May 26, 2020 · 0 comments

Comments

@puinenveturi
Copy link

Long story short

  • Expected behaviour: Missing write access to a registry should raise an exception
  • Actual behaviour: Missing write access does not raise any exception, so there is no way to catch and discover it, that the push did not take place

How to reproduce

  1. Try to push to a registry where the user exists but does not have write access to a given repository
  2. Notice that there is no exception thrown
        try:
            # user exists but does not have access right to the registy under "target_path"
            registry_auth = {
                "username": cfg["docker_registry"]["username"],
                "password": cfg["docker_registry"]["password"]
            }

            await docker.images.push(
                target_path,
                tag=target_tag,
                auth=registry_auth
            )

        # this except block is not activated
        except aiodocker.exceptions.DockerError as e:
            raise Exception("docker error", str(e))

        # the logs say success, but the push did not take place
        print(f"({str(processing_id)}) Pushing Docker image is completed")

Your environment

Docker: Docker repository hosted with Nexus 3 Repository Manager. The user I have connected to the Repository did not have write access rights to the Docker repository I wanted to push to.

Python: Official python docker image (3.7) with aiodocker "version": "==0.17.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant