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

Could not create cache rule for wildcard #789

Open
saikumarch7548 opened this issue Nov 9, 2024 · 6 comments
Open

Could not create cache rule for wildcard #789

saikumarch7548 opened this issue Nov 9, 2024 · 6 comments
Assignees
Labels
bug Feature bugs that should be fixed. feature-artifact-sync Issues related to Artifact Sync feature triaged Use after the issue is triaged

Comments

@saikumarch7548
Copy link

saikumarch7548 commented Nov 9, 2024

Describe the bug
I have an existing ACR repo and I am trying to create cache rules. static or fixed cache rule worked. It fails with an error when trying to create a wildcard cache rule, see image below

Image
Image

To Reproduce
Steps to reproduce the behavior:

  1. Choose an existing ACR repo where some repositories already existed
  2. Create static cache rule , it works as shown in first image above
  3. Create wildcard cache rule as shown in second image above, it fails, why ?

Expected behavior
Wildcard cache rule should work as expected since there are no conflicting wild card entries

Screenshots
see above for images

Additional context
I have tested the same with a new ACR without any existing repositories and it was working

@saikumarch7548 saikumarch7548 added the bug Feature bugs that should be fixed. label Nov 9, 2024
@kichalla
Copy link

@saikumarch7548 A cache rule for wildcard * as you showed above would match any 'existing' repository in the registry. Do you have any existing repository in the registry? if yes, this is by design.
Even in the case of static cache rules, if the cache rule's target repository matches an existing repository, we block it.

In your repro steps above, you mentioned Create static cache rule , it works...is the target repository of this cache rule matching any existing repository. If no, then yes the cache rule creation will proceed successfully but if yes, then it should be blocked.

@saikumarch7548
Copy link
Author

@kichalla yes I have some existing repositories in the registry , but those repositories are not related to the cache rule that I am going to create(docker.io/library). No repositories from docker.io/library existed yet

Regarding the static cache rule, target repository is not existed in the registry. Also the same case for the wildcard cache rule that I am going to create. What I have noticed is that * is working when there are no repositories in the registry yet. But cache rules should only fail when it tries to pull a repo that is already existed, but in our case here we are trying to block the creating itself. The error message is also a bit wierd

@kichalla
Copy link

@saikumarch7548 Could you please share the following information to aid in further investigation? Thank you.

  • A snapshot of existing repositories in the registry
  • A snapshot of existing cache rules in the registry
  • The new cache rule that you are trying to create and for which you are seeing an error.

@saikumarch7548
Copy link
Author

Hi @kichalla

I think its less important to share my IP in this case, since I have mentioned how to reproduce the issue and it is always reproducible. Please reproduce it yourself and let me know if you have any issues

@kichalla
Copy link

kichalla commented Nov 25, 2024

Regarding:

yes I have some existing repositories in the registry , but those repositories are not related to the cache rule that I am going to create(docker.io/library). No repositories from docker.io/library existed yet

if you have any existing repositories (for example, let say ubuntu), then a cache rule with target repository * would be a match and we block creation of this cache rule. This is by design.

Regarding

Regarding the static cache rule, target repository is not existed in the registry. Also the same case for the wildcard cache rule that I am going to create.

if you have any existing repositories (for example, let say ubuntu), then a static cache rule with target repository ubuntu would be a match and we block creation of this cache rule. This is by design as well.

Regarding your repro steps:

Steps to reproduce the behavior:
Choose an existing ACR repo where some repositories already existed
Create static cache rule , it works as shown in first image above
Create wildcard cache rule as shown in second image above, it fails, why ?

Can you give me an example of what can be those repositories as the repository paths matter in cache rule creation? as mentioned above if the target repository of a static cache rule matches an existing repository, we block the creation and similarly during creation of a wild card cache rule(i.e target repository is *), if there are existing repositories already then that means it can match any existing repository and we block it. This is by design.
Note that the names could be confusing here: By "Target repository" I mean the value for "New ACR repository namespace" field in the above UI. I am using Target Repository term here because that is the name of the switch that is used when creating a cache rule in CLI

@saikumarch7548
Copy link
Author

I had a call with @kichalla , It seems that * as a target ACR repository namespace wont be supported if there are any existing repositories already present before the cache rule is created

@kichalla agreed to update the documentation and close this issue

@toddysm toddysm added triaged Use after the issue is triaged feature-artifact-sync Issues related to Artifact Sync feature labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature bugs that should be fixed. feature-artifact-sync Issues related to Artifact Sync feature triaged Use after the issue is triaged
Projects
None yet
Development

No branches or pull requests

3 participants