Sha256: bd5fc5990e3f037ef79613996820591cdecad3d10140b4f054b80fa590ba825d

Contents?: true

Size: 1.08 KB

Versions: 31

Compression:

Stored size: 1.08 KB

Contents

module Actions
  module Katello
    module ContentViewVersion
      class Destroy < Actions::Base
        def plan(version, options = {})
          version.validate_destroyable!(skip_environment_check: options[:skip_environment_check])

          destroy_env_content = !options.fetch(:skip_destroy_env_content, false)
          repos = destroy_env_content ? version.repositories : version.archived_repos
          docker_cleanup = false

          sequence do
            concurrence do
              repos.each do |repo|
                repo_options = options.clone
                repo_options[:docker_cleanup] = false
                plan_action(Repository::Destroy, repo, repo_options)
                docker_cleanup ||= repo.docker?
              end
            end
          end

          plan_self(:id => version.id, :docker_cleanup => docker_cleanup)
        end

        def finalize
          version = ::Katello::ContentViewVersion.find_by(id: input[:id])
          version&.destroy!
          ::Katello::DockerMetaTag.cleanup_tags if input[:docker_cleanup]
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
katello-4.16.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.15.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.16.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.16.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.3 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.15.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.15.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.15.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.0.rc3 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.0.rc1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.14.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.13.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.13.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.12.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.13.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.12.0 app/lib/actions/katello/content_view_version/destroy.rb