diff --git a/doc/settings/backups.md b/doc/settings/backups.md index 768e94e4183d6ea57aff677013c01d32280a930f_ZG9jL3NldHRpbmdzL2JhY2t1cHMubWQ=..a40bd8dceaa662810d34a0d12f77158d21a52d1d_ZG9jL3NldHRpbmdzL2JhY2t1cHMubWQ= 100644 --- a/doc/settings/backups.md +++ b/doc/settings/backups.md @@ -84,9 +84,8 @@ You can provide the parameter `--no-delete-old-backups` if you want to keep all existing backups. WARNING: -If no parameter is provided the current default is `--no-delete-old-backups`. In GitLab 14.0 the default setting -will be `--delete-old-backups` - meaning that we will begin removing older configuration backups by default, -according to your `backup_keep_time` setting. +If no parameter is provided the default is `--delete-old-backups`, which will delete any backups +older than the current time minus the `backup_keep_time`, if `backup_keep_time` is greater than 0. ### Separate configuration backups from application data diff --git a/files/gitlab-ctl-commands/lib/gitlab_ctl/backup.rb b/files/gitlab-ctl-commands/lib/gitlab_ctl/backup.rb index 768e94e4183d6ea57aff677013c01d32280a930f_ZmlsZXMvZ2l0bGFiLWN0bC1jb21tYW5kcy9saWIvZ2l0bGFiX2N0bC9iYWNrdXAucmI=..a40bd8dceaa662810d34a0d12f77158d21a52d1d_ZmlsZXMvZ2l0bGFiLWN0bC1jb21tYW5kcy9saWIvZ2l0bGFiX2N0bC9iYWNrdXAucmI= 100644 --- a/files/gitlab-ctl-commands/lib/gitlab_ctl/backup.rb +++ b/files/gitlab-ctl-commands/lib/gitlab_ctl/backup.rb @@ -30,8 +30,7 @@ end def wants_pruned - # in 14.0, change default to `true` - @delete_old_backups.nil? ? false : @delete_old_backups + @delete_old_backups.nil? ? true : @delete_old_backups end def removable_archives @@ -64,9 +63,6 @@ end def prune - # warn users that 14.0 will delete old backups by default - warn_breaking_change if backup_keep_time.positive? - if wants_pruned && backup_keep_time.positive? remove_backups else @@ -102,13 +98,6 @@ puts "Configuration backup archive complete: #{archive_path}" end - def warn_breaking_change - warn("WARNING: In GitLab 14.0 we will begin removing all configuration"\ - " backups older than your"\ - "gitlab_rails['backup_keep_time'] setting"\ - " (currently set to: #{backup_keep_time})") - end - def remove_backups # delete old backups removed_count = 0 diff --git a/spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb b/spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb index 768e94e4183d6ea57aff677013c01d32280a930f_c3BlYy9naXRsYWItY3RsLWNvbW1hbmRzL2xpYi9naXRsYWJfY3RsX2JhY2t1cF9zcGVjLnJi..a40bd8dceaa662810d34a0d12f77158d21a52d1d_c3BlYy9naXRsYWItY3RsLWNvbW1hbmRzL2xpYi9naXRsYWJfY3RsX2JhY2t1cF9zcGVjLnJi 100644 --- a/spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb +++ b/spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb @@ -60,5 +60,5 @@ allow(GitlabCtl::Util).to receive(:get_node_attributes).and_return({}) end - it 'should not attempt to delete old backups' do + it 'should default to deleting old backups' do backup = GitlabCtl::Backup.new @@ -64,6 +64,5 @@ backup = GitlabCtl::Backup.new - expect(backup).to receive(:wants_pruned).and_return(false) - backup.prune + expect(backup.wants_pruned).to eq(true) end context 'when the backup path is readable by non-root' do @@ -200,10 +199,6 @@ allow(Dir).to receive(:glob).and_return(all_backup_files) end - it 'should warn the user of the coming breaking change' do - expect { @backup.prune }.to output(a_string_matching(warning_message)).to_stderr - end - it 'should identify the correct files to remove' do removed = past_valid_backup_files.map do |x| File.join(backup_dir_path, x) @@ -255,10 +250,6 @@ allow(Dir).to receive(:glob).and_return(future_valid_backup_files) end - it 'should warn the user of the coming breaking change' do - expect { @backup.prune }.to output(a_string_matching(warning_message)).to_stderr - end - it 'should find no files to remove' do allow_any_instance_of(Kernel).to receive(:warn) expect(@backup.removable_archives.length).to equal(0)