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

Stop stripping curly braces from tag retention policies #20806

Open
sebhoss opened this issue Aug 3, 2024 · 4 comments
Open

Stop stripping curly braces from tag retention policies #20806

sebhoss opened this issue Aug 3, 2024 · 4 comments
Assignees

Comments

@sebhoss
Copy link

sebhoss commented Aug 3, 2024

If you are reporting a problem, please make sure the following information are provided:

Expected behavior and actual behavior:

I'm trying to implement a somewhat semver compatible tag retention policy. I've tried the one from #12877 (comment) but removed the v in front since our versions do not use such a prefix. The Harbor UI then stripped the curly braces in front and end of the expression.

Steps to reproduce the problem:

  1. Paste {[0-9],[0-9][0-9],[0-9][0-9][0-9],[0-9][0-9][0-9][0-9]}.{[0-9],[0-9][0-9],[0-9][0-9][0-9],[0-9][0-9][0-9][0-9]}.{[0-9],[0-9][0-9],[0-9][0-9][0-9],[0-9][0-9][0-9][0-9]} into tag retention UI
  2. Observe that Harbor strips the first and last curly braces but leaves all others in there resulting in a wrong expression

Versions:
Please specify the versions of following systems.

  • harbor version: Version v2.11.0-70255684
  • docker engine version: not relevant
  • docker-compose version: not relevant

Additional context:

  • Harbor config files: You can get them by packaging harbor.yml and files in the same directory, including subdirectory.
  • Log files: You can get them by package the /var/log/harbor/ .
@zyyw
Copy link
Contributor

zyyw commented Aug 5, 2024

Screenshot 2024-08-05 at 11 06 24 AM Screenshot 2024-08-05 at 11 06 47 AM

It seems that the Harbor UI does indeed remove the first and the last curly braces from the tag retention policy, while the http request payload sent to the backend API does contains a valid tag patten. And it does select the artifacts matching the tag patten. Please check the above attached images.

@stonezdj
Copy link
Contributor

stonezdj commented Aug 5, 2024

It is a by design behavior.

@MinerYang
Copy link
Contributor

MinerYang commented Aug 5, 2024

Hi @sebhoss ,

Thanks for reaching out to us and we are aware that this design would made some confusion at your side.

Since initially we are trying to simplify this {} pattern when creating rules on UI by auto stripping curly braces. However it is indeed cause some viewing trouble here when complex patterns like yours were showing. Since it is by design for a while and do not affect the filter function, we will not decide to change this behavior immediately, but will put in the backlog if there's more complaining from community hope this design get changed.

Let's keep collecting the feedback from community!

Best,
Miner

Copy link

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

@github-actions github-actions bot added the Stale label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants