-
Notifications
You must be signed in to change notification settings - Fork 4.9k
[FEATURE REQ] ContainerRepository.GetAllTagProperties is missing #49183
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
Comments
Hello @brianwp3000. I'm an AI assistant for the azure-sdk-for-net repository. I have some suggestions that you can try out while the team gets back to you.
The team will get back to you shortly, hopefully this helps in the meantime. |
Hi @brianwp3000. Thanks for reaching out and we regret that you're experiencing difficulties. You'll want to use RegistryArtifact.GetAllTagProperties. That method calls ContainerRegistryRestClient.GetTags, which invokes the ContainerRegistry_GetTags, which is the REST API that you've linked. |
Hi @brianwp3000. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
/unresolve Sorry if i wasn't clear--the RegistryArtifact.GetAllTagProperties method is not the same as getting all the tags for a repository. If you look at the example in the docs, you can see that RegistryArtifact.GetAllTagProperties only lists the tags that point to a specific artifact within a repository--it does not list all the tags in the repository. |
Hi @brianwp3000. Thank you for the additional context. Forgive me if I'm missing a nuance, but looking at the implementation, I do not think that the Starting with the example: // Get the service endpoint from the environment
Uri endpoint = new Uri(Environment.GetEnvironmentVariable("REGISTRY_ENDPOINT"));
// Create a new ContainerRegistryClient for anonymous access
ContainerRegistryClient client = new ContainerRegistryClient(endpoint);
// Obtain a RegistryArtifact object to get access to image operations
RegistryArtifact image = client.GetArtifact("library/hello-world", "latest");
// List the set of tags on the hello_world image tagged as "latest"
Pageable<ArtifactTagProperties> tags = image.GetAllTagProperties(); Tracing the code, what I'm seeing is:
If there's a nuance or detail that I'm overlooking, I'd appreciate your insight. |
Hi @brianwp3000. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
In the source code for So you're right that calling |
@brianwp3000: Thanks, that was my disconnect. I did indeed overlook it being passed via query parameter, as I was too focused on the URL being formed. Thanks for your patience breaking that down. We're now in agreement that what you're looking for isn't accessible. I'll mark this as a feature request and move to the backlog for future consideration. ACR has not been a very active library, so I'm not confident that you'll see this added in the short term. In the meantime, to get you unblocked, creating a custom policy would give you access to the raw request URL before it is sent and allow you to strip out the unwanted query string parameter. One implementation would look something like: Policypublic class GetRidOfDigestRequestPolicy: HttpPipelineSynchronousPolicy
{
public override void OnSendingRequest(HttpMessage message)
{
if (message.Request.Uri.Path.EndsWith("_tags"))
{
var query = HttpUtility.ParseQueryString(message.Request.Uri.Query);
query.Remove("digest");
message.Request.Uri.Query = query.ToString();
}
}
} Setting the policy for the clientvar options = new ContainerRegistryClientOptions();
options.AddPolicy(new CustomRequestPolicy(), HttpPipelinePosition.PerCall);
var client = new ContainerRegistryClient(endpoint, options); |
Library name
Azure.Containers.ContainerRegistry
Please describe the feature.
RegistryArtifact.GetAllTagProperties already allows users to list all the tags for a given registry artifact, but that is not the same as listing all the tags for a given repository.
Listing the tags for a repository is possible with the REST api (see https://learn.microsoft.com/en-us/rest/api/containerregistry/tag/get-list) and is already present in the internal sdk (see ContainerRegistryRestClient.GetTags), but there is no way to do this using the public sdk. A GetAllTagProperties method on the ContainerRepository class would make sense to fix this.
I was in the process of replacing our project's handwritten wrapper over the ACR REST api with the Azure.Container.ContainerRegistry package when I found this disparity, and it's currently a hard blocker on that work.
The text was updated successfully, but these errors were encountered: