Skip to content

Commit

Permalink
Fixes #37357 - Add container migration to upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed May 13, 2024
1 parent 258aac2 commit 1d1d5c2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
23 changes: 23 additions & 0 deletions definitions/procedures/pulpcore/container_handle_image_metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Procedures::Pulpcore
class ContainerHandleImageMetadata < ForemanMaintain::Procedure
include ForemanMaintain::Concerns::SystemService
include ForemanMaintain::Concerns::PulpCommon

metadata do
description 'Initialize and expose container image metadata in the pulpcore db'
for_feature :pulpcore
end

def run
with_spinner('Initialize and expose container image metadata in the pulpcore db') do |spinner|
necessary_services = feature(:pulpcore_database).services

feature(:service).handle_services(spinner, 'start', :only => necessary_services)

spinner.update('Adding image metadata to pulp. You can continue using the ' \
'system normally while the task runs in the background.')
execute!(pulpcore_manager('container-handle-image-data'))
end
end
end
end
3 changes: 2 additions & 1 deletion definitions/scenarios/foreman_upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def compose
Checks::ServerPing,
Checks::ServicesUp,
Checks::SystemRegistration,
Procedures::Packages::CheckForReboot
Procedures::Packages::CheckForReboot,
Procedures::Pulpcore::ContainerHandleImageMetadata
)
end
end
Expand Down
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_16.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
add_step(Procedures::Pulpcore::ContainerHandleImageMetadata)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_16.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
add_step(Procedures::Pulpcore::ContainerHandleImageMetadata)
end
end
end

0 comments on commit 1d1d5c2

Please sign in to comment.