Skip to content

Commit

Permalink
deprecate snapshot backups
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 9, 2023
1 parent b02a519 commit ff8d4f2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Procedures::Backup
module Snapshot
class SnapshotDeprecationMessage < ForemanMaintain::Check
metadata do
description 'Snapshot backups are deprecated'
tags :backup
end

def run
set_warn('Snapshot backups are deprecated and will be removed in a future version.')
end
end
end
end
7 changes: 7 additions & 0 deletions definitions/scenarios/backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Backup < ForemanMaintain::Scenario

def compose
check_valid_startegy
snapshot_deprecation_warning
safety_confirmation
accessibility_confirmation
prepare_directory
Expand Down Expand Up @@ -110,6 +111,12 @@ def logical_volume_confirmation
end
end

def snapshot_deprecation_warning
if strategy == :snapshot
add_step_with_context(Procedures::Backup::Snapshot::SnapshotDeprecationMessage)
end
end

def accessibility_confirmation
if [:offline, :snapshot].include?(strategy)
add_step_with_context(Procedures::Backup::AccessibilityConfirmation)
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_maintain/cli/backup_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def execute
class BackupCommand < Base
subcommand 'online', 'Keep services online during backup', OnlineBackupCommand
subcommand 'offline', 'Shut down services to preserve consistent backup', OfflineBackupCommand
subcommand 'snapshot', 'Use snapshots of the databases to create backup', SnapshotBackupCommand
subcommand 'snapshot', 'Use snapshots of the databases to create backup (DEPRECATED)', SnapshotBackupCommand
end
# rubocop:enable Metrics/LineLength
end
Expand Down

0 comments on commit ff8d4f2

Please sign in to comment.