question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ContainerRegistryClient update methods do nothing

See original GitHub issue
  • Package Name: azure-containerregistryclient
  • Package Version: 1.0.0b7
  • Operating System: MacOS Monterey 12.1 on M1
  • Python Version: 3.8

Describe the bug

azure.containerregistry.ContainerRegistryClient has 3 update methods, none of which work. The get/list methods work fine.

To Reproduce

Suppose a repository with the name myrepo exists with the tag mytag at https://myacr.azurecr.io.

Let’s attempt to update the last updated time of some objects. NB this fails on any field e.g. name, but last updated time is common to all 3 and easy to understand.

from azure.containerregistry import ContainerRegistryClient, RepositoryProperties, ArtifactTagProperties, ArtifactManifestProperties
from datetime import datetime

client = ContainerRegistryClient("https://myacr.azurecr.io", DefaultAzureCredential(), audience="https://management.azure.com")
now = datetime.now()

# All 3 of these calls run without any exception raised, but nothing changes in ACR
client.update_repository_properties('myrepo', RepositoryProperties(last_updated_on=now, can_delete=True, can_read=True, can_list=True, can_write=True))
client.update_tag_properties('myrepo', 'mytag', ArtifactTagProperties(last_updated_on=now, can_delete=True, can_read=True, can_list=True, can_write=True))
client.update_manifest_properties('myrepo', 'mytag', ArtifactManifestProperties(last_updated_on=now, can_delete=True, can_read=True, can_list=True, can_write=True))

Nothing changes on ACR, even though these calls ran without errors.

I don’t believe this is a permissions issue, because various other calls e.g. client.get_repository_properties('myrepo') work fine and return correct values.

Interestingly, errors are raised as expected when e.g. setting a non-existent repo or tag name.

Expected behavior

The properties of the selected object change, or an exception is raised explaining what is wrong.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
annatischcommented, Jan 26, 2022

Thanks @theoturner! I have opened a PR to get these docstrings improved for clarity. I think the intention of the name update_properties was to allow the methods to grow should more updatable settings become available.

1reaction
theoturnercommented, Jan 25, 2022

Thank you for the fast replies. An update to the docstring is great, though the functions should probably be named update_object_permissions to avoid confusion.

For future reference, to update actual properties delete the old repo/tag and create a new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot network issues with registry - Azure Container ...
Symptoms, causes, and resolution of common problems when accessing an Azure container registry in a virtual network or behind a firewall.
Read more >
Configuring a registry - Docker Documentation
Configuring a registry. The Registry configuration is based on a YAML file, detailed below. While it comes with sane default values out of...
Read more >
Authentication methods | Container Registry documentation
This page describes how to configure a third-party client to authenticate with Container Registry. Google Cloud services that integrate with Container ...
Read more >
GitLab Container Registry administration
There are two ways you can configure the Registry's external domain. Either: Use the existing GitLab domain. The Registry listens on a port...
Read more >
Private registry authentication - Amazon ECR
These clients use standard AWS authentication methods. Even though you can use the Amazon ECR API to push and pull images, you're more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found