goharbor / harbor

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

Update all retention policies of all project #20978

Open wy65701436 opened 10 hours ago

wy65701436 commented 10 hours ago

Discussed in https://github.com/goharbor/harbor/discussions/20972

Originally posted by **s4ndalHat** September 27, 2024 Hello everyone, Recently, we migrated our harbor instances across different cluster, and after migration, all scheduled retention policies stopped wotking.. I've looked at some issue on the repo, and the workaround is to force update the schedule of retention policies from the Harbor UI. However, having almost 100 projects, it's plenty of manual operations to do, so I'm asking if there is an easy way to do it. Harbor version: 2.0.2 installed by helm chart Kubernetes version: 1.26.3 Thank you
wy65701436 commented 10 hours ago

Hi @s4ndalHat,

I've converted this into an issue. Could you please provide more details?

I also suggest creating a sample automation script to manage this by calling the Harbor API. Additionally, please note that Harbor v2.0 is no longer supported. I recommend upgrading to the latest version or at least v2.10+.

s4ndalHat commented 3 hours ago

Hi @wy65701436 ,

By force update, i mean change the configured schedule "Daily" to "Weekly" then configured back to "Daily".

An update will be planned on this particular instance, but at the moment we would want to solve it first...