NARKOZ / gitlab

Ruby wrapper and CLI for the GitLab REST API
https://narkoz.github.io/gitlab
BSD 2-Clause "Simplified" License
1.06k stars 394 forks source link

container expiration policy does not work #655

Closed burtsevyg closed 1 year ago

burtsevyg commented 1 year ago

Set container expiration policy for all projects:

projects.auto_paginate do |project|
  begin
    puts project.name
    Gitlab.edit_project(project.id, { container_expiration_policy_attributes: {cadence: "1d", enabled: true, keep_n: 100, older_than: "60d", name_regex: ".*"} })
  rescue Gitlab::Error::Error => error
    puts error
  end
end

but after some time (about 1 hour) configuration cleared.

burtsevyg commented 1 year ago

This happen only for repositories which doesn't have images.