File tree Expand file tree Collapse file tree 5 files changed +50
-0
lines changed
gitlab-cookbooks/registry
cookbooks/registry/recipes Expand file tree Collapse file tree 5 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -1023,6 +1023,25 @@ external_url 'GENERATED_EXTERNAL_URL'
1023
1023
# }
1024
1024
# }
1025
1025
1026
+ ### Registry garbage collection
1027
+ ###! Docs: https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md?ref_type=heads#gc
1028
+ # registry['gc'] = {
1029
+ # 'disabled' => false,
1030
+ # 'maxbackoff' => '24h',
1031
+ # 'noidlebackoff' => false,
1032
+ # 'transactiontimeout' => '10s',
1033
+ # 'reviewafter' => '24h',
1034
+ # 'manifests' => {
1035
+ # 'disabled' => false,
1036
+ # 'interval' => '5s'
1037
+ # },
1038
+ # 'blobs' => {
1039
+ # 'disabled' => false,
1040
+ # 'interval' => '5s',
1041
+ # 'storagetimeout' => '5s'
1042
+ # }
1043
+ # }
1044
+
1026
1045
### Registry notifications endpoints
1027
1046
# registry['notifications'] = [
1028
1047
# {
Original file line number Diff line number Diff line change 37
37
default [ 'registry' ] [ 'autoredirect' ] = false
38
38
default [ 'registry' ] [ 'compatibility_schema1_enabled' ] = false
39
39
default [ 'registry' ] [ 'database' ] = nil
40
+ default [ 'registry' ] [ 'gc' ] = nil
40
41
41
42
####
42
43
# Notifications
Original file line number Diff line number Diff line change @@ -47,3 +47,6 @@ notifications:
47
47
<% if @database %>
48
48
database: <%= @database.to_json %>
49
49
<% end %>
50
+ <% if @gc %>
51
+ gc: <%= @gc.to_json %>
52
+ <% end %>
Original file line number Diff line number Diff line change 173
173
end
174
174
end
175
175
176
+ context 'when the registry garbage collector configuration is present' do
177
+ let ( :gc_config ) do
178
+ { "disabled" => false ,
179
+ "maxbackoff" => "24h" ,
180
+ "noidlebackoff" => false ,
181
+ "transactiontimeout" => "10s" ,
182
+ "reviewafter" => "24h" ,
183
+ "manifests" => {
184
+ "disabled" => false ,
185
+ "interval" => "5s"
186
+ } ,
187
+ "blobs" => {
188
+ "disabled" => false ,
189
+ "interval" => "5s" ,
190
+ "storagetimeout" => "5s"
191
+ } }
192
+ end
193
+
194
+ before { stub_gitlab_rb ( registry : { gc : gc_config } ) }
195
+
196
+ it 'creates registry config with gc' do
197
+ expect ( chef_run ) . to render_file ( '/var/opt/gitlab/registry/config.yml' )
198
+ . with_content ( %r(^gc: {"disabled":false) )
199
+ end
200
+ end
201
+
176
202
context 'when a log formatter is specified' do
177
203
before { stub_gitlab_rb ( registry : { log_formatter : 'json' } ) }
178
204
Original file line number Diff line number Diff line change 63
63
expect ( content ) . not_to match ( /^compatibility:/ )
64
64
expect ( content ) . not_to match ( /^middleware:/ )
65
65
expect ( content ) . not_to match ( /^database:/ )
66
+ expect ( content ) . not_to match ( /^gc:/ )
66
67
end
67
68
)
68
69
end
You can’t perform that action at this time.
0 commit comments