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

Add ACR delete tag methods #19680

Merged
8 commits merged into from
Mar 22, 2021
Merged

Add ACR delete tag methods #19680

8 commits merged into from
Mar 22, 2021

Conversation

annelo-msft
Copy link
Member

@annelo-msft annelo-msft commented Mar 22, 2021

  • Add delete tag methods to ContainerRepositoryClient
  • Use Track 1 mgmt plane ACR client library to import images for delete tests
  • Refactor client tests so that tests setting read/write attributes to false are marked NonParallelizable

Addresses tag delete in #19547

// Assert

// The delete takes some time, so if we call GetTagProperties() without a delay, we get a 200 response.
await Task.Delay(5000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Search and Key Vault, we have our own DelayAsync that effectively goes something like this:

protected async ValueTask DelayAsync(TimeSpan? duration = null)
{
  duration ??= TimeSpan.FromSeconds(5);
  if (TestMode == RecordingTestMode.Playback)
  {
    return ValueTask.Completed;
  }
  else
  {
    await Task.Delay(duration);
  }
}

This way, you don't waste time during playback.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, Heath, thanks for the pointer!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, take a look at Search or Key Vault's. It's a bit more robust (involved) than this sample, but this shows the gist of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...effectively, you can optionally set a delay, or for retries (something else maybe to add, but separate) a polling interval with default. Both should probably take a CancellationToken, not that we use them much (but occasionally).

@ghost
Copy link

ghost commented Mar 22, 2021

Hello @annelo-msft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@annelo-msft
Copy link
Member Author

azp run net - core - ci

@@ -5,6 +5,7 @@
using System.Collections.Specialized;
using System.Threading;
using System.Web;

Copy link
Member

@JoshLove-msft JoshLove-msft Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm does the "azp" command not work for container registry, "/azp run net - containerregistry - ci"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need a slash '/azp run net - core - ci'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@annelo-msft
Copy link
Member Author

/azp run net - core - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ghost ghost merged commit 04f5e80 into Azure:master Mar 22, 2021
Mohit-Chakraborty pushed a commit to Mohit-Chakraborty/azure-sdk-for-net that referenced this pull request Mar 23, 2021
- Add delete tag methods to ContainerRepositoryClient
- Use Track 1 mgmt plane ACR client library to import images for delete tests
- Refactor client tests so that tests setting read/write attributes to false are marked NonParallelizable

Addresses tag delete in Azure#19547
This pull request was closed.
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

Successfully merging this pull request may close these issues.

5 participants