Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate snapshot backups #776

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Procedures::Backup
module Snapshot
class SnapshotDeprecationMessage < ForemanMaintain::Procedure
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh -- just noticed this fun typo 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
Loading