Skip to content
Snippets Groups Projects
Commit e70ef74f authored by Ian Baum's avatar Ian Baum
Browse files

Merge branch 'feat/support-registry-gc-config' into 'master'

Add config support for container registry garbage collection

Closes #8438

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7447



Merged-by: default avatarIan Baum <ibaum@gitlab.com>
Approved-by: default avatarMitchell Nielsen <mnielsen@gitlab.com>
Approved-by: default avatarIan Baum <ibaum@gitlab.com>
Reviewed-by: default avatarIan Baum <ibaum@gitlab.com>
Co-authored-by: default avatarFabio Huser <fabio.huser@siemens.com>
parents 262076d7 5746ef74
No related branches found
No related tags found
3 merge requests!128heptapod#1534: making 1.5 the oldstable,!125heptapod#1494: make 1.5 the new stable,!123Omnibus GitLab for upstream 16.10
......@@ -1023,6 +1023,25 @@
# }
# }
### Registry garbage collection
###! Docs: https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md?ref_type=heads#gc
# registry['gc'] = {
# 'disabled' => false,
# 'maxbackoff' => '24h',
# 'noidlebackoff' => false,
# 'transactiontimeout' => '10s',
# 'reviewafter' => '24h',
# 'manifests' => {
# 'disabled' => false,
# 'interval' => '5s'
# },
# 'blobs' => {
# 'disabled' => false,
# 'interval' => '5s',
# 'storagetimeout' => '5s'
# }
# }
### Registry notifications endpoints
# registry['notifications'] = [
# {
......
......@@ -37,6 +37,7 @@
default['registry']['autoredirect'] = false
default['registry']['compatibility_schema1_enabled'] = false
default['registry']['database'] = nil
default['registry']['gc'] = nil
####
# Notifications
......
......@@ -47,3 +47,6 @@
<% if @database %>
database: <%= @database.to_json %>
<% end %>
<% if @gc %>
gc: <%= @gc.to_json %>
<% end %>
......@@ -173,6 +173,32 @@
end
end
context 'when the registry garbage collector configuration is present' do
let(:gc_config) do
{ "disabled" => false,
"maxbackoff" => "24h",
"noidlebackoff" => false,
"transactiontimeout" => "10s",
"reviewafter" => "24h",
"manifests" => {
"disabled" => false,
"interval" => "5s"
},
"blobs" => {
"disabled" => false,
"interval" => "5s",
"storagetimeout" => "5s"
} }
end
before { stub_gitlab_rb(registry: { gc: gc_config }) }
it 'creates registry config with gc' do
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(%r(^gc: {"disabled":false))
end
end
context 'when a log formatter is specified' do
before { stub_gitlab_rb(registry: { log_formatter: 'json' }) }
......
......@@ -63,6 +63,7 @@
expect(content).not_to match(/^compatibility:/)
expect(content).not_to match(/^middleware:/)
expect(content).not_to match(/^database:/)
expect(content).not_to match(/^gc:/)
end
)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment