katello 3.17.0 → 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
- data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
- data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
- data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
- data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
- data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
- data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_controller.rb +9 -9
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
- data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
- data/app/helpers/katello/katello_urls_helper.rb +5 -2
- data/app/lib/actions/candlepin/product/content_create.rb +2 -0
- data/app/lib/actions/candlepin/product/content_update.rb +2 -0
- data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +9 -9
- data/app/lib/actions/katello/content_view_version/import.rb +8 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
- data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
- data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
- data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
- data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
- data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
- data/app/lib/actions/katello/product/content_create.rb +7 -6
- data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
- data/app/lib/actions/katello/repository/import_upload.rb +4 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +3 -1
- data/app/lib/actions/katello/repository/update.rb +5 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
- data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
- data/app/lib/actions/pulp3/content_migration.rb +10 -0
- data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
- data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
- data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
- data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
- data/app/lib/actions/pulp3/import_migration.rb +6 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
- data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/delete.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
- data/app/lib/katello/resources/candlepin/owner.rb +5 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
- data/app/lib/katello/resources/registry.rb +3 -3
- data/app/models/katello/authorization/activation_key.rb +4 -0
- data/app/models/katello/authorization/content_view.rb +13 -0
- data/app/models/katello/authorization/content_view_component.rb +15 -0
- data/app/models/katello/authorization/content_view_filter.rb +15 -0
- data/app/models/katello/authorization/content_view_version.rb +25 -2
- data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
- data/app/models/katello/authorization/gpg_key.rb +12 -4
- data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
- data/app/models/katello/authorization/organization.rb +8 -0
- data/app/models/katello/authorization/sync_plan.rb +16 -0
- data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +4 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
- data/app/models/katello/content_migration_progress.rb +4 -0
- data/app/models/katello/content_view.rb +30 -4
- data/app/models/katello/content_view_component.rb +2 -0
- data/app/models/katello/content_view_filter.rb +5 -0
- data/app/models/katello/content_view_history.rb +2 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +8 -0
- data/app/models/katello/content_view_repository.rb +13 -1
- data/app/models/katello/content_view_version_export_history.rb +8 -1
- data/app/models/katello/glue/candlepin/pool.rb +9 -14
- data/app/models/katello/glue/pulp/repo.rb +8 -0
- data/app/models/katello/gpg_key.rb +1 -1
- data/app/models/katello/ping.rb +8 -3
- data/app/models/katello/repository.rb +33 -0
- data/app/models/katello/root_repository.rb +26 -1
- data/app/models/katello/smart_proxy_sync_history.rb +8 -0
- data/app/services/katello/candlepin/event_handler.rb +2 -0
- data/app/services/katello/candlepin/message_handler.rb +34 -0
- data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
- data/app/services/katello/host_status_manager.rb +9 -0
- data/app/services/katello/pulp3/api/apt.rb +57 -0
- data/app/services/katello/pulp3/api/core.rb +8 -0
- data/app/services/katello/pulp3/api/docker.rb +4 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
- data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
- data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
- data/app/services/katello/pulp3/deb.rb +38 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/migration.rb +51 -10
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
- data/app/services/katello/pulp3/repository.rb +10 -4
- data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
- data/app/services/katello/pulp3/repository/apt.rb +63 -0
- data/app/services/katello/pulp3/repository/docker.rb +9 -0
- data/app/services/katello/pulp3/repository/yum.rb +14 -9
- data/app/services/katello/pulp3/repository_mirror.rb +9 -4
- data/app/services/katello/pulp3/task.rb +4 -0
- data/app/services/katello/pulp3/task_group.rb +4 -0
- data/app/services/katello/repository_type.rb +2 -1
- data/app/services/katello/smart_proxy_helper.rb +9 -0
- data/app/views/dashboard/_subscription_widget.html.erb +0 -5
- data/app/views/foreman/hosts/_registration.html.erb +12 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/app/views/katello/layouts/react.html.erb +3 -2
- data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
- data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
- data/config/routes/api/v2.rb +24 -2
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
- data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
- data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
- data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
- data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
- data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
- data/lib/katello/engine.rb +2 -0
- data/lib/katello/permission_creator.rb +98 -69
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +10 -2
- data/lib/katello/repository_types/deb.rb +9 -1
- data/lib/katello/tasks/pulp3_migration.rake +17 -3
- data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
- data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
- data/lib/katello/tasks/reset.rake +2 -1
- data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +51 -44
- data/locale/bn/katello.po +279 -55
- data/locale/cs/katello.po +278 -51
- data/locale/de/katello.po +279 -52
- data/locale/en/katello.po +278 -49
- data/locale/es/katello.po +279 -51
- data/locale/fr/katello.po +279 -51
- data/locale/gu/katello.po +279 -55
- data/locale/hi/katello.po +279 -55
- data/locale/it/katello.po +279 -51
- data/locale/ja/katello.po +279 -52
- data/locale/katello.pot +1379 -971
- data/locale/kn/katello.po +279 -55
- data/locale/ko/katello.po +279 -51
- data/locale/mr/katello.po +279 -55
- data/locale/or/katello.po +279 -55
- data/locale/pa/katello.po +279 -55
- data/locale/pt/katello.po +278 -52
- data/locale/pt_BR/katello.po +279 -51
- data/locale/ru/katello.po +279 -51
- data/locale/ta/katello.po +279 -55
- data/locale/te/katello.po +279 -55
- data/locale/zh_CN/katello.po +279 -51
- data/locale/zh_TW/katello.po +279 -52
- data/webpack/components/ActionableDetail.js +2 -1
- data/webpack/components/Search/Search.js +1 -1
- data/webpack/components/Table/MainTable.js +6 -2
- data/webpack/components/Table/TableWrapper.js +46 -9
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
- data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
- data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
- metadata +74 -13
- data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -14,7 +14,7 @@ module Actions
|
|
14
14
|
content_view.repository_references.each do |repository_reference|
|
15
15
|
repo = repository_reference.root_repository.library_instance
|
16
16
|
#force pulp3 in case we've done migrations, but haven't switched over yet
|
17
|
-
tasks << repo.backend_service(smart_proxy, true).
|
17
|
+
tasks << repo.backend_service(smart_proxy, true).delete_repository(repository_reference)
|
18
18
|
end
|
19
19
|
content_view.repository_references.destroy_all
|
20
20
|
|
@@ -6,13 +6,17 @@ module Actions
|
|
6
6
|
param :smart_proxy_id, Integer
|
7
7
|
param :content_view_version_id, Integer
|
8
8
|
param :path, String
|
9
|
+
param :metadata, Hash
|
9
10
|
end
|
10
11
|
|
11
12
|
def run
|
12
13
|
cvv = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
|
13
|
-
output[:importer_data] = ::Katello::Pulp3::ContentViewVersion::Import.new(
|
14
|
-
|
15
|
-
|
14
|
+
output[:importer_data] = ::Katello::Pulp3::ContentViewVersion::Import.new(
|
15
|
+
smart_proxy: smart_proxy,
|
16
|
+
content_view_version: cvv,
|
17
|
+
path: input[:path],
|
18
|
+
metadata: input[:metadata]
|
19
|
+
).create_importer
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
@@ -4,14 +4,20 @@ module Actions
|
|
4
4
|
class Export < Pulp3::AbstractAsyncTask
|
5
5
|
input_format do
|
6
6
|
param :content_view_version_id, Integer
|
7
|
+
param :from_content_view_version_id, Integer
|
7
8
|
param :smart_proxy_id, Integer
|
8
9
|
param :exporter_data, Hash
|
10
|
+
param :chunk_size, Integer
|
9
11
|
end
|
10
12
|
|
11
13
|
def invoke_external_task
|
12
14
|
cvv = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
|
15
|
+
from_cvv = ::Katello::ContentViewVersion.find(input[:from_content_view_version_id]) unless input[:from_content_view_version_id].blank?
|
13
16
|
::Katello::Pulp3::ContentViewVersion::Export.new(smart_proxy: smart_proxy,
|
14
|
-
content_view_version: cvv
|
17
|
+
content_view_version: cvv,
|
18
|
+
from_content_view_version: from_cvv)
|
19
|
+
.create_export(input[:exporter_data][:pulp_href],
|
20
|
+
chunk_size: input[:chunk_size])
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
@@ -7,13 +7,17 @@ module Actions
|
|
7
7
|
param :smart_proxy_id, Integer
|
8
8
|
param :importer_data, Hash
|
9
9
|
param :path, String
|
10
|
+
param :metadata, Hash
|
10
11
|
end
|
11
12
|
|
12
13
|
def invoke_external_task
|
13
14
|
cvv = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
|
14
|
-
output[:pulp_tasks] = ::Katello::Pulp3::ContentViewVersion::Import.new(
|
15
|
-
|
16
|
-
|
15
|
+
output[:pulp_tasks] = ::Katello::Pulp3::ContentViewVersion::Import.new(
|
16
|
+
smart_proxy: smart_proxy,
|
17
|
+
content_view_version: cvv,
|
18
|
+
path: input[:path],
|
19
|
+
metadata: input[:metadata]
|
20
|
+
).create_import(input[:importer_data][:pulp_href])
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -6,9 +6,14 @@ module Actions
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def run
|
9
|
-
|
9
|
+
task_id = ForemanTasks::Task.find_by(external_id: self.execution_plan_id)&.id
|
10
|
+
migration_service = ::Katello::Pulp3::Migration.new(SmartProxy.pulp_primary, input.merge(task_id: task_id))
|
10
11
|
migration_service.import_pulp3_content
|
11
12
|
end
|
13
|
+
|
14
|
+
def humanized_output
|
15
|
+
output[:status]
|
16
|
+
end
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb
CHANGED
@@ -9,7 +9,8 @@ module Actions
|
|
9
9
|
sequence do
|
10
10
|
copy_action = plan_action(Actions::Pulp3::Repository::CopyContent, repo, SmartProxy.pulp_primary!,
|
11
11
|
repo.library_instance,
|
12
|
-
copy_all: true
|
12
|
+
copy_all: true,
|
13
|
+
mirror: content_view_version.content_view.library_import?)
|
13
14
|
plan_action(Actions::Pulp3::Repository::SaveVersion, repo.library_instance,
|
14
15
|
tasks: copy_action.output[:pulp_tasks])
|
15
16
|
plan_action(Katello::Repository::IndexContent, id: repo.library_instance_id)
|
@@ -6,17 +6,22 @@ module Actions
|
|
6
6
|
input_format do
|
7
7
|
param :smart_proxy_id, Integer
|
8
8
|
param :content_view_version_id, Integer
|
9
|
+
param :from_content_view_version_id, Integer
|
9
10
|
param :export_history_id, Integer
|
10
11
|
param :exporter_data, Hash
|
11
12
|
param :destination_server, String
|
12
13
|
end
|
13
14
|
|
14
15
|
output_format do
|
15
|
-
param :
|
16
|
-
param :
|
16
|
+
param :exported_file_checksum, Hash
|
17
|
+
param :export_path, String
|
17
18
|
end
|
18
19
|
|
19
|
-
|
20
|
+
# rubocop:disable Metrics/MethodLength
|
21
|
+
def plan(content_view_version:, destination_server: nil,
|
22
|
+
chunk_size: nil, from_history: nil,
|
23
|
+
validate_incremental: true,
|
24
|
+
fail_on_missing_content: false)
|
20
25
|
action_subject(content_view_version)
|
21
26
|
unless File.directory?(Setting['pulpcore_export_destination'])
|
22
27
|
fail ::Foreman::Exception, N_("Unable to export. 'pulpcore_export_destination' setting is not set to a valid directory.")
|
@@ -24,6 +29,15 @@ module Actions
|
|
24
29
|
|
25
30
|
sequence do
|
26
31
|
smart_proxy = SmartProxy.pulp_primary!
|
32
|
+
from_content_view_version = from_history&.content_view_version
|
33
|
+
export_service = ::Katello::Pulp3::ContentViewVersion::Export.new(
|
34
|
+
smart_proxy: smart_proxy,
|
35
|
+
content_view_version: content_view_version,
|
36
|
+
destination_server: destination_server,
|
37
|
+
from_content_view_version: from_content_view_version)
|
38
|
+
export_service.validate!(fail_on_missing_content: fail_on_missing_content,
|
39
|
+
validate_incremental: validate_incremental)
|
40
|
+
|
27
41
|
action_output = plan_action(::Actions::Pulp3::ContentViewVersion::CreateExporter,
|
28
42
|
content_view_version_id: content_view_version.id,
|
29
43
|
smart_proxy_id: smart_proxy.id,
|
@@ -32,12 +46,14 @@ module Actions
|
|
32
46
|
plan_action(::Actions::Pulp3::ContentViewVersion::Export,
|
33
47
|
content_view_version_id: content_view_version.id,
|
34
48
|
smart_proxy_id: smart_proxy.id,
|
35
|
-
exporter_data: action_output[:exporter_data]
|
36
|
-
|
49
|
+
exporter_data: action_output[:exporter_data],
|
50
|
+
chunk_size: chunk_size,
|
51
|
+
from_content_view_version_id: from_content_view_version&.id)
|
37
52
|
|
38
53
|
plan_self(exporter_data: action_output[:exporter_data], smart_proxy_id: smart_proxy.id,
|
39
54
|
destination_server: destination_server,
|
40
|
-
content_view_version_id: content_view_version.id
|
55
|
+
content_view_version_id: content_view_version.id,
|
56
|
+
from_content_view_version_id: from_content_view_version&.id)
|
41
57
|
|
42
58
|
plan_action(::Actions::Pulp3::ContentViewVersion::DestroyExporter,
|
43
59
|
smart_proxy_id: smart_proxy.id,
|
@@ -49,18 +65,26 @@ module Actions
|
|
49
65
|
smart_proxy = ::SmartProxy.find(input[:smart_proxy_id])
|
50
66
|
api = ::Katello::Pulp3::Api::Core.new(smart_proxy)
|
51
67
|
export_data = api.export_api.list(input[:exporter_data][:pulp_href]).results.first
|
52
|
-
output[:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
path: path)
|
68
|
+
output[:exported_file_checksum] = export_data.output_file_info
|
69
|
+
file_name = output[:exported_file_checksum].first&.first
|
70
|
+
path = File.dirname(file_name.to_s)
|
71
|
+
output[:export_path] = path
|
57
72
|
cvv = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
|
73
|
+
from_cvv = ::Katello::ContentViewVersion.find(input[:from_content_view_version_id]) unless input[:from_content_view_version_id].blank?
|
58
74
|
|
59
|
-
export_metadata = ::Katello::Pulp3::ContentViewVersion::Export.new(
|
60
|
-
|
75
|
+
export_metadata = ::Katello::Pulp3::ContentViewVersion::Export.new(
|
76
|
+
content_view_version: cvv,
|
77
|
+
smart_proxy: smart_proxy,
|
78
|
+
from_content_view_version: from_cvv).generate_metadata
|
61
79
|
toc = Dir.glob("#{path}/*toc.json").first
|
62
80
|
export_metadata[:toc] = File.basename(toc) if toc
|
63
|
-
|
81
|
+
history = ::Katello::ContentViewVersionExportHistory.create!(
|
82
|
+
content_view_version_id: input[:content_view_version_id],
|
83
|
+
destination_server: input[:destination_server],
|
84
|
+
path: path,
|
85
|
+
metadata: export_metadata
|
86
|
+
)
|
87
|
+
output[:export_history_id] = history.id
|
64
88
|
end
|
65
89
|
|
66
90
|
def humanized_name
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Orchestration
|
4
|
+
module ContentViewVersion
|
5
|
+
class ExportLibrary < Actions::EntryAction
|
6
|
+
def plan(organization, destination_server: nil,
|
7
|
+
chunk_size: nil,
|
8
|
+
from_history: nil,
|
9
|
+
fail_on_missing_content: false)
|
10
|
+
action_subject(organization)
|
11
|
+
validate_repositories_immediate!(organization) if fail_on_missing_content
|
12
|
+
|
13
|
+
content_view = ::Katello::Pulp3::ContentViewVersion::Export.find_library_export_view(destination_server: destination_server,
|
14
|
+
organization: organization,
|
15
|
+
create_by_default: true)
|
16
|
+
repo_ids_in_library = organization.default_content_view_version.repositories.yum_type.immediate.pluck(:id)
|
17
|
+
content_view.update!(repository_ids: repo_ids_in_library)
|
18
|
+
|
19
|
+
sequence do
|
20
|
+
publish_action = plan_action(::Actions::Katello::ContentView::Publish, content_view, '')
|
21
|
+
export_action = plan_action(::Actions::Pulp3::Orchestration::ContentViewVersion::Export,
|
22
|
+
content_view_version: publish_action.version,
|
23
|
+
destination_server: destination_server,
|
24
|
+
chunk_size: chunk_size,
|
25
|
+
from_history: from_history,
|
26
|
+
validate_incremental: false,
|
27
|
+
fail_on_missing_content: fail_on_missing_content)
|
28
|
+
plan_self(export_action_output: export_action.output)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def run
|
33
|
+
output[:export_history_id] = input[:export_action_output][:export_history_id]
|
34
|
+
end
|
35
|
+
|
36
|
+
def humanized_name
|
37
|
+
_("Export Library")
|
38
|
+
end
|
39
|
+
|
40
|
+
def rescue_strategy
|
41
|
+
Dynflow::Action::Rescue::Skip
|
42
|
+
end
|
43
|
+
|
44
|
+
def validate_repositories_immediate!(organization)
|
45
|
+
non_immediate_repos = organization.default_content_view_version.repositories.yum_type.non_immediate
|
46
|
+
if non_immediate_repos.any?
|
47
|
+
fail _("NOTE: Unable to fully export '%{organization}' organization's library because"\
|
48
|
+
" it contains repositories without the 'immediate' download policy."\
|
49
|
+
" Update the download policy and sync affected repositories to include them in the export."\
|
50
|
+
" \n %{repos}" %
|
51
|
+
{ organization: organization.name,
|
52
|
+
repos: ::Katello::Pulp3::ContentViewVersion::Export
|
53
|
+
.generate_product_repo_strings(repositories: non_immediate_repos)})
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -3,20 +3,26 @@ module Actions
|
|
3
3
|
module Orchestration
|
4
4
|
module ContentViewVersion
|
5
5
|
class Import < Actions::EntryAction
|
6
|
-
def plan(content_view_version, path:)
|
6
|
+
def plan(content_view_version, path:, metadata:)
|
7
7
|
action_subject(content_view_version)
|
8
8
|
sequence do
|
9
9
|
smart_proxy = SmartProxy.pulp_primary!
|
10
|
-
importer_output = plan_action(
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
importer_output = plan_action(
|
11
|
+
::Actions::Pulp3::ContentViewVersion::CreateImporter,
|
12
|
+
content_view_version_id: content_view_version.id,
|
13
|
+
smart_proxy_id: smart_proxy.id,
|
14
|
+
path: path,
|
15
|
+
metadata: metadata
|
16
|
+
).output
|
14
17
|
|
15
|
-
import_output = plan_action(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
import_output = plan_action(
|
19
|
+
::Actions::Pulp3::ContentViewVersion::Import,
|
20
|
+
content_view_version_id: content_view_version.id,
|
21
|
+
smart_proxy_id: smart_proxy.id,
|
22
|
+
importer_data: importer_output[:importer_data],
|
23
|
+
path: path,
|
24
|
+
metadata: metadata
|
25
|
+
).output
|
20
26
|
|
21
27
|
plan_action(Actions::Pulp3::Repository::SaveVersions, content_view_version.importable_repositories.pluck(:id),
|
22
28
|
tasks: import_output[:pulp_tasks])
|
@@ -8,7 +8,7 @@ module Actions
|
|
8
8
|
publication_content_type = !::Katello::RepositoryTypeManager.find(repository.content_type).pulp3_skip_publication
|
9
9
|
sequence do
|
10
10
|
if options[:source_repository] && publication_content_type
|
11
|
-
plan_self(source_repository_id: options[:source_repository].id, target_repository_id: repository.id)
|
11
|
+
plan_self(source_repository_id: options[:source_repository].id, target_repository_id: repository.id, smart_proxy_id: smart_proxy.id)
|
12
12
|
elsif publication_content_type
|
13
13
|
plan_action(Actions::Pulp3::Repository::CreatePublication, repository, smart_proxy, options)
|
14
14
|
end
|
@@ -21,6 +21,9 @@ module Actions
|
|
21
21
|
#we don't have to actually generate a publication, we can reuse the old one
|
22
22
|
target_repo = ::Katello::Repository.find(input[:target_repository_id])
|
23
23
|
source_repo = ::Katello::Repository.find(input[:source_repository_id])
|
24
|
+
if (target_repo.publication_href != source_repo.publication_href && smart_proxy.pulp_primary?)
|
25
|
+
target_repo.clear_smart_proxy_sync_histories
|
26
|
+
end
|
24
27
|
target_repo.update!(publication_href: source_repo.publication_href)
|
25
28
|
end
|
26
29
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# rubocop:disable Metrics/MethodLength
|
1
2
|
module Actions
|
2
3
|
module Pulp3
|
3
4
|
module Orchestration
|
@@ -6,9 +7,19 @@ module Actions
|
|
6
7
|
def plan(repository, smart_proxy, args)
|
7
8
|
file = {:filename => args.dig(:unit_key, :name)}
|
8
9
|
content_unit_href = args.dig(:unit_key, :content_unit_id)
|
10
|
+
docker_tag = (args.dig(:unit_type_id) == "docker_tag")
|
9
11
|
sequence do
|
10
12
|
if content_unit_href
|
11
13
|
plan_self(:commit_output => [], :content_unit_href => content_unit_href)
|
14
|
+
action_output = plan_action(Pulp3::Repository::ImportUpload, content_unit_href, repository, smart_proxy).output
|
15
|
+
plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks]).output
|
16
|
+
elsif docker_tag
|
17
|
+
tag_manifest_output = plan_action(Pulp3::Repository::UploadTag,
|
18
|
+
repository,
|
19
|
+
smart_proxy,
|
20
|
+
args).output
|
21
|
+
plan_self(:commit_output => tag_manifest_output[:pulp_tasks])
|
22
|
+
plan_action(Pulp3::Repository::SaveVersion, repository, {force_fetch_version: true, tasks: tag_manifest_output[:pulp_tasks]})
|
12
23
|
else
|
13
24
|
commit_output = plan_action(Pulp3::Repository::CommitUpload,
|
14
25
|
repository,
|
@@ -24,9 +35,9 @@ module Actions
|
|
24
35
|
args.dig(:unit_type_id)).output
|
25
36
|
content_unit_href = artifact_output[:pulp_tasks]
|
26
37
|
plan_self(:commit_output => commit_output[:pulp_tasks], :artifact_output => artifact_output[:pulp_tasks])
|
38
|
+
action_output = plan_action(Pulp3::Repository::ImportUpload, content_unit_href, repository, smart_proxy).output
|
39
|
+
plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks]).output
|
27
40
|
end
|
28
|
-
action_output = plan_action(Pulp3::Repository::ImportUpload, content_unit_href, repository, smart_proxy).output
|
29
|
-
plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks]).output
|
30
41
|
end
|
31
42
|
end
|
32
43
|
|
@@ -34,8 +45,10 @@ module Actions
|
|
34
45
|
output[:pulp_tasks] = input[:commit_output]
|
35
46
|
if input[:content_unit_href]
|
36
47
|
output[:content_unit_href] = input[:content_unit_href]
|
37
|
-
|
48
|
+
elsif input[:artifact_output]
|
38
49
|
output[:content_unit_href] = input[:artifact_output].last[:created_resources].first
|
50
|
+
else
|
51
|
+
output[:content_unit_href] = nil
|
39
52
|
end
|
40
53
|
end
|
41
54
|
end
|
@@ -10,7 +10,8 @@ module Actions
|
|
10
10
|
repo = ::Katello::Repository.find(input[:repository_id])
|
11
11
|
repo_backend_service = repo.backend_service(smart_proxy)
|
12
12
|
uploads_api = repo_backend_service.core_api.uploads_api
|
13
|
-
|
13
|
+
upload_commit = repo_backend_service.core_api.upload_commit_class.new(sha256: input[:sha256])
|
14
|
+
output[:pulp_tasks] = [uploads_api.commit(input[:upload_href], upload_commit)]
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -13,7 +13,7 @@ module Actions
|
|
13
13
|
target = ::Katello::Repository.find(input[:target_repository_id] || input[:target_repository])
|
14
14
|
service = target.backend_service(smart_proxy)
|
15
15
|
output[:pulp_tasks] = if input[:copy_all]
|
16
|
-
service.copy_all(source)
|
16
|
+
service.copy_all(source, mirror: input[:mirror] || false)
|
17
17
|
else
|
18
18
|
service.copy_content_for_source(source, input)
|
19
19
|
end
|
@@ -11,7 +11,7 @@ module Actions
|
|
11
11
|
artifact_href = input[:tasks].last[:created_resources].first
|
12
12
|
content_type = input[:unit_type_id]
|
13
13
|
content_backend_service = SmartProxy.pulp_primary.content_service(content_type)
|
14
|
-
output[:pulp_tasks] = [content_backend_service.
|
14
|
+
output[:pulp_tasks] = [content_backend_service.content_api_create(relative_path: input[:options][:file_name], artifact: artifact_href)]
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -2,7 +2,7 @@ module Actions
|
|
2
2
|
module Pulp3
|
3
3
|
module Repository
|
4
4
|
class SaveVersion < Pulp3::Abstract
|
5
|
-
def plan(repository, options)
|
5
|
+
def plan(repository, options = {})
|
6
6
|
fail "Cannot accept tasks and repository_details into Save Version." if options[:tasks].present? && options[:repository_details].present?
|
7
7
|
plan_self(:repository_id => repository.id, :tasks => options[:tasks], :repository_details => options[:repository_details], :force_fetch_version => options.fetch(:force_fetch_version, false))
|
8
8
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Repository
|
4
|
+
class UploadTag < Pulp3::AbstractAsyncTask
|
5
|
+
def plan(repository, smart_proxy, args)
|
6
|
+
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :args => args)
|
7
|
+
end
|
8
|
+
|
9
|
+
def invoke_external_task
|
10
|
+
repo = ::Katello::Repository.find(input[:repository_id])
|
11
|
+
tag_name = input[:args].dig(:unit_key, :name)
|
12
|
+
manifest_digest = input[:args].dig(:unit_key, :digest)
|
13
|
+
output[:pulp_tasks] = [repo.backend_service(smart_proxy).tag_manifest(tag_name, manifest_digest)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -53,8 +53,8 @@ module Katello
|
|
53
53
|
JSON.parse(response).with_indifferent_access
|
54
54
|
end
|
55
55
|
|
56
|
-
def async_hypervisors(owner
|
57
|
-
url = "/candlepin/hypervisors/#{owner}"
|
56
|
+
def async_hypervisors(owner:, reporter_id:, raw_json:)
|
57
|
+
url = "/candlepin/hypervisors/#{owner}?reporter_id=#{reporter_id}"
|
58
58
|
headers = self.default_headers
|
59
59
|
headers['content-type'] = 'text/plain'
|
60
60
|
response = self.post(url, raw_json, headers)
|
@@ -5,6 +5,11 @@ module Katello
|
|
5
5
|
extend OwnerResource
|
6
6
|
|
7
7
|
class << self
|
8
|
+
def all
|
9
|
+
response = self.get(path, default_headers)
|
10
|
+
JSON.parse(response.body)
|
11
|
+
end
|
12
|
+
|
8
13
|
# Set the contentPrefix at creation time so that the client will get
|
9
14
|
# content only for the org it has been subscribed to
|
10
15
|
def create(key, description)
|