[英]Is there a way to exclude untagged artifacts from Harbor's immutability rules?
I'm using a setting like this:我正在使用这样的设置:
However, this also makes the untagged artifact immutable.但是,这也使未标记的工件不可变。
I want to delete untagged artifacts according to the retention policy, but I can't delete them because they become immutable.我想根据保留策略删除未标记的工件,但我无法删除它们,因为它们变得不可变。
Is there a good way?有什么好办法吗?
You can see the test_tag_immutability.py
used by Harbor, and it does states that "excluding rule will not affect matching rule" (using the bmatcuk/doublestar
pattern ).您可以看到 Harbor 使用的
test_tag_immutability.py
,它确实声明“排除规则不会影响匹配规则”(使用bmatcuk/doublestar
模式)。
In your case, since the Tag immutability rule mentions that "[y]ou can add a maximum of 15 immutability rules per project", you could try and add a tag matching rule, with an empty pattern or {}
(empty sequence of characters )在您的情况下,由于标签不变性规则提到“[您]您可以为每个项目添加最多 15 个不变性规则”,您可以尝试添加一个带有空模式或
{}
的标签匹配规则(空字符序列)
This might not be supported however.但是,这可能不受支持。
The workaround would be to add an exclusion rule for tags named " untagged
".解决方法是为名为“
untagged
”的标签添加排除规则。
Any image tagged " untagged
" (or latest) would therefore be candidate to deletion.因此,任何标记为“
untagged
”(或最新)的图像都将成为删除的候选者。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.