Compare commits

...

7 Commits

Author SHA1 Message Date
Jaime Martinez d20068712a Merge branch 'registry-add-notifications-maxretries' into 'master'
Add maxretries config for registry notifications

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

Merged-by: Jaime Martinez <jmartinez@gitlab.com>
Approved-by: Vishal Patel <vpatel@gitlab.com>
Reviewed-by: Vishal Patel <vpatel@gitlab.com>
2024-05-06 17:34:29 +00:00
Andrew Patterson 196b5a3326 Merge branch 'deps/19dfc8b-42de0a3' into 'master'
Update gitlab-org/container-registry from v3.93.0-gitlab to v4.0.0-gitlab

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

Merged-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Co-authored-by: deps <bot@dependencies.io>
2024-05-06 17:32:03 +00:00
Jaime Martinez cbf0d7f3a2
Move array deprecation to additional_deprecations 2024-05-06 12:08:58 +10:00
deps 242873ad43 Update gitlab-org/container-registry from v3.93.0-gitlab to v4.0.0-gitlab
Changelog: changed
2024-05-02 08:21:39 +00:00
Jaime Martinez eba79b0916 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Andrew Patterson <apatterson@gitlab.com>
2024-05-01 05:56:31 +00:00
Jaime Martinez 27eea52e7a
Add deprecation notice for threshold params 2024-04-18 11:46:37 +10:00
Jaime Martinez e1599c25fa
Add maxretries config for registry notifications
Changelog: added
2024-04-17 15:12:39 +10:00
6 changed files with 23 additions and 2 deletions

View File

@ -19,7 +19,7 @@
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
name 'registry'
version = Gitlab::Version.new('registry', 'v3.93.0-gitlab')
version = Gitlab::Version.new('registry', 'v4.0.0-gitlab')
default_version version.print(false)
display_version version.print(false).delete_suffix('-gitlab')

View File

@ -1048,7 +1048,8 @@ external_url 'GENERATED_EXTERNAL_URL'
# 'name' => 'test_endpoint',
# 'url' => 'https://gitlab.example.com/notify2',
# 'timeout' => '500ms',
# 'threshold' => 5,
# 'threshold' => 5, # DEPRECATED: use maxretries instead https://gitlab.com/gitlab-org/container-registry/-/issues/1243
# 'maxretries' => 5,
# 'backoff' => '1s',
# 'headers' => {
# "Authorization" => ["AUTHORIZATION_EXAMPLE_TOKEN"]
@ -1058,6 +1059,7 @@ external_url 'GENERATED_EXTERNAL_URL'
### Default registry notifications
# registry['default_notifications_timeout'] = "500ms"
# registry['default_notifications_threshold'] = 5
# registry['default_notifications_maxretries'] = 5
# registry['default_notifications_backoff'] = "1s"
# registry['default_notifications_headers'] = {}

View File

@ -137,6 +137,7 @@ module Registry
# Use the registry defaults configured by the user but use the defaults from gitlab if they were not set
user_configuration['default_notifications_timeout'] ||= gitlab_configuration['default_notifications_timeout']
user_configuration['default_notifications_threshold'] ||= gitlab_configuration['default_notifications_threshold']
user_configuration['default_notifications_maxretries'] ||= gitlab_configuration['default_notifications_maxretries']
user_configuration['default_notifications_backoff'] ||= gitlab_configuration['default_notifications_backoff']
user_configuration['default_notifications_headers'] ||= gitlab_configuration['default_notifications_headers']
@ -144,6 +145,7 @@ module Registry
# Get the values from default if they are not set
endpoint['timeout'] ||= user_configuration['default_notifications_timeout']
endpoint['threshold'] ||= user_configuration['default_notifications_threshold']
endpoint['maxretries'] ||= user_configuration['default_notifications_maxretries']
endpoint['backoff'] ||= user_configuration['default_notifications_backoff']
# And merge the default headers with the ones specific to this endpoint

View File

@ -361,6 +361,12 @@ module Gitlab
deprecation: '16.10',
removal: '17.0',
note: "`omnibus_gitconfig` will be removed in GitLab 17.0. For details and migration instructions, please see: https://docs.gitlab.com/ee/update/versions/gitlab_16_changes.html#gitlabomnibus_gitconfig-deprecation"
},
{
config_keys: %w(registry default_notifications_threshold),
deprecation: '17.0',
removal: '18.0',
note: "Starting with GitLab 18.0, `registry['default_notifications_threshold'] will be removed. Please use `default_notifications_maxretries` instead https://gitlab.com/gitlab-org/container-registry/-/issues/1243."
}
]
@ -606,6 +612,13 @@ module Gitlab
EOS
messages += deprecate_only_if_value(incoming_version, existing_config, type, ['monitoring', 'grafana'], 'enable', true, '16.0', '16.3', note: grafana_note)
notifications_threshold_note = <<~EOS
Starting with GitLab 18.0, `registry['notifications']['endpoint']['threshold'] will be removed.
Please use `maxretries` instead https://gitlab.com/gitlab-org/container-registry/-/issues/1243.
EOS
messages += deprecate_only_if_value(incoming_version, existing_config, type, ['registry', 'notifications'],'endpoint','threshold',17.0, 18.0, note: notifications_threshold_note)
messages
end

View File

@ -45,5 +45,6 @@ default['registry']['gc'] = nil
default['registry']['notifications'] = nil
default['registry']['default_notifications_timeout'] = "500ms"
default['registry']['default_notifications_threshold'] = 5
default['registry']['default_notifications_maxretries'] = 5
default['registry']['default_notifications_backoff'] = "1s"
default['registry']['default_notifications_headers'] = {}

View File

@ -378,6 +378,7 @@ RSpec.describe 'registry' do
],
default_notifications_timeout: '5000ms',
default_notifications_threshold: 10,
default_notifications_maxretries: 5,
default_notifications_backoff: '50s',
default_notifications_headers: {
"Authorization" => %w(AUTHORIZATION_EXAMPLE_TOKEN1 AUTHORIZATION_EXAMPLE_TOKEN2)
@ -395,6 +396,8 @@ RSpec.describe 'registry' do
.with_content(/"timeout":"5000ms"/)
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(/"threshold":10/)
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(/"maxretries":5/)
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(/"backoff":"50s"/)
end