goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.94k stars 4.74k forks source link

Not able to set all repos as immutable and excluding some repos #19490

Open jessehu opened 11 months ago

jessehu commented 11 months ago

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

Expected behavior and actual behavior: It's not able to deny all tags as immutable with some exception tags.

Steps to reproduce the problem:

图片

With the above rules, all tags are immutable, the 2nd excluding rule does not take effect.

Versions: Please specify the versions of following systems.

Additional context:

wy65701436 commented 11 months ago

Thanks @jessehu

It is an by designed behavior, as mentioned at https://goharbor.io/docs/2.8.0/working-with-projects/working-with-images/create-tag-immutability-rules/. Immutability rules use OR logic, so if you set multiple rules and a tag is matched by any of those rules, it is marked as immutable.

jessehu commented 11 months ago

So how to archieve the goal for set all repos as immutable and excluding some repos ? This should be a common use case.

wy65701436 commented 11 months ago

You can set specific rules to protect the repositories or tags that you want to safeguard.

By using the OR logic, you ensure that the immutable repositories remain unaffected by other rules. Like, if admin A wants to protect repo A, but admin B has excluded repo A without admin A's knowledge, employing the OR logic prevents any interference with repo A.