katello 3.13.4 → 3.14.0.rc1
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 +25 -16
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +26 -21
- data/app/controllers/katello/api/v2/ansible_collections_controller.rb +6 -0
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +8 -2
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +8 -1
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -3
- data/app/controllers/katello/api/v2/katello_ping_controller.rb +24 -0
- data/app/controllers/katello/api/v2/module_streams_controller.rb +21 -0
- data/app/controllers/katello/api/v2/package_groups_controller.rb +5 -0
- data/app/controllers/katello/api/v2/packages_controller.rb +16 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +7 -4
- data/app/controllers/katello/api/v2/srpms_controller.rb +1 -1
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +5 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +7 -5
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +36 -5
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +12 -0
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +55 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +13 -64
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +40 -0
- data/app/lib/actions/katello/content_view/publish.rb +0 -3
- data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +1 -3
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +21 -0
- data/app/lib/actions/katello/repository/create.rb +8 -0
- data/app/lib/actions/katello/repository/import_upload.rb +13 -12
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -2
- data/app/lib/actions/katello/repository/update.rb +9 -0
- data/app/lib/actions/katello/repository/upload_files.rb +4 -11
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -0
- data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +16 -0
- data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +25 -0
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +34 -0
- data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +35 -0
- data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +15 -0
- data/app/lib/actions/{katello/capsule_content → pulp/orphan_cleanup}/remove_unneeded_repos.rb +2 -2
- data/app/lib/actions/pulp/repository/import_upload.rb +7 -11
- data/app/lib/actions/pulp3/abstract_async_task.rb +7 -7
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +32 -0
- data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +31 -0
- data/app/lib/actions/pulp3/capsule_content/sync.rb +26 -0
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +20 -0
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +15 -15
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +36 -0
- data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +24 -0
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +25 -0
- data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +20 -0
- data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +16 -0
- data/app/lib/actions/pulp3/repository/create_publication.rb +1 -5
- data/app/lib/actions/pulp3/repository/import_upload.rb +21 -0
- data/app/lib/actions/pulp3/repository/save_artifact.rb +19 -0
- data/app/lib/actions/pulp3/repository/save_version.rb +3 -2
- data/app/lib/actions/pulp3/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_file.rb +76 -0
- data/app/lib/katello/api/v2/rendering.rb +1 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +34 -2
- data/app/lib/katello/errors.rb +21 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +0 -9
- data/app/lib/katello/resources/candlepin/owner.rb +0 -5
- data/app/lib/katello/resources/candlepin/product.rb +2 -6
- data/app/lib/katello/resources/registry.rb +25 -10
- data/app/lib/katello/util/filter_clause_generator.rb +1 -1
- data/app/lib/katello/util/module_stream_clause_generator.rb +49 -0
- data/app/lib/katello/util/package_clause_generator.rb +1 -1
- data/app/models/katello/ansible_collection.rb +5 -8
- data/app/models/katello/ansible_collection_tag.rb +8 -0
- data/app/models/katello/ansible_tag.rb +8 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +16 -14
- data/app/models/katello/concerns/pulp_database_unit.rb +27 -4
- data/app/models/katello/concerns/search_by_repository_name.rb +4 -1
- data/app/models/katello/concerns/smart_proxy_extensions.rb +44 -20
- data/app/models/katello/content_view_docker_filter.rb +15 -2
- data/app/models/katello/content_view_filter.rb +28 -8
- data/app/models/katello/content_view_module_stream_filter.rb +14 -0
- data/app/models/katello/content_view_module_stream_filter_rule.rb +11 -0
- data/app/models/katello/content_view_package_filter.rb +18 -8
- data/app/models/katello/content_view_version.rb +7 -2
- data/app/models/katello/deb.rb +0 -8
- data/app/models/katello/docker_manifest.rb +0 -8
- data/app/models/katello/docker_manifest_list.rb +0 -8
- data/app/models/katello/docker_meta_tag.rb +38 -20
- data/app/models/katello/docker_tag.rb +22 -33
- data/app/models/katello/erratum.rb +10 -8
- data/app/models/katello/file_unit.rb +1 -13
- data/app/models/katello/glue/candlepin/owner.rb +0 -5
- data/app/models/katello/glue/candlepin/product.rb +1 -5
- data/app/models/katello/glue/pulp/repo.rb +1 -1
- data/app/models/katello/host/content_facet.rb +6 -0
- data/app/models/katello/host_collection.rb +4 -0
- data/app/models/katello/installed_package.rb +4 -0
- data/app/models/katello/module_stream.rb +1 -12
- data/app/models/katello/ostree_branch.rb +0 -7
- data/app/models/katello/package_group.rb +0 -7
- data/app/models/katello/ping.rb +10 -3
- data/app/models/katello/pool.rb +11 -1
- data/app/models/katello/puppet_module.rb +0 -7
- data/app/models/katello/repository.rb +15 -6
- data/app/models/katello/repository_docker_meta_tag.rb +7 -0
- data/app/models/katello/repository_docker_tag.rb +7 -0
- data/app/models/katello/repository_file_unit.rb +7 -0
- data/app/models/katello/rhsm_fact_name.rb +5 -1
- data/app/models/katello/rhsm_fact_parser.rb +17 -1
- data/app/models/katello/root_repository.rb +11 -6
- data/app/models/katello/rpm.rb +0 -8
- data/app/models/katello/srpm.rb +0 -8
- data/app/models/katello/upstream_pool.rb +2 -0
- data/app/models/katello/yum_metadata_file.rb +0 -4
- data/app/models/setting/content.rb +124 -128
- data/app/services/katello/candlepin/consumer.rb +0 -1
- data/app/services/katello/pulp/content.rb +11 -4
- data/app/services/katello/pulp/docker_tag.rb +0 -1
- data/app/services/katello/pulp/pulp_content_unit.rb +4 -0
- data/app/services/katello/pulp/repository.rb +53 -0
- data/app/services/katello/pulp/repository/file.rb +1 -1
- data/app/services/katello/pulp/repository/puppet.rb +8 -1
- data/app/services/katello/pulp/repository/yum.rb +42 -9
- data/app/services/katello/pulp/smart_proxy_repository.rb +13 -96
- data/app/services/katello/pulp3/ansible_collection.rb +7 -3
- data/app/services/katello/pulp3/content.rb +60 -0
- data/app/services/katello/pulp3/docker_blob.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
- data/app/services/katello/pulp3/docker_tag.rb +2 -2
- data/app/services/katello/pulp3/file_unit.rb +7 -1
- data/app/services/katello/pulp3/pulp_content_unit.rb +15 -5
- data/app/services/katello/pulp3/repository.rb +301 -24
- data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
- data/app/services/katello/pulp3/repository/docker.rb +54 -9
- data/app/services/katello/pulp3/repository/file.rb +8 -0
- data/app/services/katello/pulp3/repository/yum.rb +61 -0
- data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -0
- data/app/services/katello/repository_type_manager.rb +7 -0
- data/app/services/katello/smart_proxy_helper.rb +50 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
- data/app/views/katello/api/v2/ansible_collections/base.json.rabl +5 -0
- data/app/views/katello/api/v2/ansible_collections/show.json.rabl +7 -0
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -0
- data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_filters/base.json.rabl +5 -0
- data/app/views/katello/api/v2/content_view_filters/show.json.rabl +2 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/erratum.json.rabl +2 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/server_status.json.rabl +0 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/show.json.rabl +0 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/version.json.rabl +0 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
- data/app/views/katello/api/v2/subscriptions/permissions.rabl +11 -0
- data/config/katello.yaml.example +9 -0
- data/config/routes.rb +2 -1
- data/config/routes/api/v2.rb +2 -2
- data/db/migrate/20180920214134_create_repository_root.rb +1 -1
- data/db/migrate/20190730183518_add_docker_tag_join_table.rb +25 -0
- data/db/migrate/20190730203334_add_docker_meta_tag_join_table.rb +25 -0
- data/db/migrate/20190814025338_create_content_view_module_stream_filter_rules.rb +13 -0
- data/db/migrate/20190816162733_rename_ansible_collection_whitelist_to_requirements.rb +5 -0
- data/db/migrate/20190822144300_add_ansible_fields.rb +18 -0
- data/db/migrate/20190912210927_rename_repository_file_unit.rb +12 -0
- data/engines/bastion/README.md +2 -2
- data/engines/bastion/app/assets/javascripts/bastion/components/bst-edit.directive.js +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +20 -6
- data/engines/bastion/app/assets/javascripts/bastion/components/views/bst-modal.html +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/layouts/partials/table.html +2 -1
- data/engines/bastion/app/assets/stylesheets/bastion/overrides.scss +1 -0
- data/engines/bastion/lib/bastion.rb +1 -0
- data/engines/bastion_katello/README.md +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.factory.js +28 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.module.js +15 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-destroy-modal.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +2 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +4 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +13 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +47 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-module-stream-filter.controller.js +68 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-rule-matching-package-modal.controller.js +37 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/module-stream-list-filter.controller.js +73 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +14 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-details.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-rule-matching-package-modal.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +41 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +44 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +21 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ansible-collections.html +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/download-policy.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +24 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +29 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +8 -0
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +8 -8
- data/lib/katello/engine.rb +0 -4
- data/lib/katello/plugin.rb +19 -1
- data/lib/katello/repository_types/yum.rb +2 -0
- data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
- data/lib/katello/tasks/reimport.rake +1 -1
- data/lib/katello/version.rb +1 -1
- data/package.json +9 -5
- data/webpack/__mocks__/foremanReact/common/helpers.js +4 -1
- data/webpack/__mocks__/foremanReact/components/PermissionDenied/index.js +2 -0
- data/webpack/components/Content/ContentPage.js +55 -0
- data/webpack/{scenes/ModuleStreams/ModuleStreamsTable.js → components/Content/ContentTable.js} +9 -8
- data/webpack/components/Content/Details/ContentDetailInfo.js +33 -0
- data/webpack/{scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js → components/Content/Details/ContentDetailRepositories.js} +4 -4
- data/webpack/{scenes/ModuleStreams/Details/Repositories/TableSchema.js → components/Content/Details/ContentDetailRepositoryTableSchema.js} +1 -1
- data/webpack/components/Content/Details/ContentDetails.js +70 -0
- data/webpack/components/Content/Details/__tests__/ContentDetailInfo.test.js +28 -0
- data/webpack/components/Content/Details/__tests__/ContentDetailRepositories.test.js +22 -0
- data/webpack/components/Content/Details/__tests__/ContentDetails.test.js +64 -0
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap +39 -0
- data/webpack/{scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap → components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap} +3 -9
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +137 -0
- data/webpack/components/Content/__tests__/ContentPage.test.js +36 -0
- data/webpack/components/Content/__tests__/ContentTable.test.js +40 -0
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +70 -0
- data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +33 -0
- data/webpack/components/Search/index.js +6 -7
- data/webpack/components/SelectOrg/SelectOrgAction.js +20 -22
- data/webpack/containers/Application/config.js +10 -0
- data/webpack/containers/Application/overrides.scss +5 -0
- data/webpack/move_to_foreman/common/helpers.js +1 -1
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +5 -2
- data/webpack/move_to_foreman/components/common/table/formatters/EntitlementsInlineEditFormatter.js +9 -2
- data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +2 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +3 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +1 -0
- data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +10 -10
- data/webpack/redux/actions/RedHatRepositories/__tests__/enabled.test.js +39 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +24 -24
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +23 -22
- data/webpack/redux/actions/RedHatRepositories/sets.js +17 -21
- data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/__tests__/sets.test.js +1 -1
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +42 -33
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +2 -1
- data/webpack/redux/reducers/RedHatRepositories/sets.js +2 -1
- data/webpack/redux/reducers/index.js +4 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +30 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsConstants.js +3 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsPage.js +80 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +39 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +60 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTables.scss +0 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetails.js +91 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +23 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsConstants.js +3 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +30 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionsSchema.js +35 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailInfo.test.js +16 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.fixtures.js +25 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +29 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +41 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsReducer.test.js +33 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailInfo.test.js.snap +83 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetails.test.js.snap +190 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsActions.test.js.snap +54 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsReducer.test.js.snap +50 -0
- data/webpack/scenes/AnsibleCollections/Details/index.js +17 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +25 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollections.fixtures.js +52 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsActions.test.js +48 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsReducer.test.js +46 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +27 -0
- data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionPage.test.js.snap +73 -0
- data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionsTable.test.js.snap +81 -0
- data/webpack/scenes/AnsibleCollections/index.js +17 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleDetailsSchema.js +56 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +7 -71
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +9 -11
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +5 -3
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +453 -507
- data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +10 -11
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +12 -33
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -4
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +8 -9
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +5 -3
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +83 -65
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +1 -1
- data/webpack/scenes/Organizations/OrganizationActions.js +27 -32
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +12 -12
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +1 -1
- data/webpack/scenes/Products/ProductActions.js +10 -10
- data/webpack/scenes/Products/__tests__/ProductActions.test.js +6 -6
- data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +118 -0
- data/webpack/scenes/RedHatRepositories/__tests__/RedHatRepositoriesPage.test.js +51 -0
- data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +117 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +44 -45
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/EnabledRepository.test.js +84 -5
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +46 -47
- data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
- data/webpack/scenes/RedHatRepositories/index.js +2 -101
- data/webpack/scenes/Settings/Tables/TableActions.js +42 -43
- data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +18 -18
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +10 -10
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +8 -8
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +142 -113
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +8 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +40 -40
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +24 -24
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -199
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +52 -46
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +21 -2
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +64 -42
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +21 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +20 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -15
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +12 -13
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -14
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +21 -23
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +35 -1
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +13 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +7 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +18 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +5 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +26 -5
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +9 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +27 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +5 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Dialogs/UpdateDialog.js +9 -9
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +8 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -23
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +0 -135
- data/webpack/scenes/Subscriptions/index.js +2 -0
- data/webpack/scenes/Tasks/TaskActions.js +36 -31
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +35 -47
- metadata +146 -67
- data/app/controllers/katello/api/v2/ping_controller.rb +0 -24
- data/app/lib/actions/katello/capsule_content/create_repos.rb +0 -30
- data/app/lib/actions/katello/capsule_content/remove_orphans.rb +0 -21
- data/app/lib/actions/pulp/repository/refresh_needed.rb +0 -37
- data/app/lib/katello/resources/candlepin/owner_info.rb +0 -18
- data/app/models/katello/glue/candlepin/owner_info.rb +0 -41
- data/app/models/katello/repository_file.rb +0 -7
- data/app/overrides/add_subscription_status.rb +0 -6
- data/app/views/overrides/hosts/_subscription_link.html.erb +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-events.controller.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -58
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-product-details.controller.js +0 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-products.controller.js +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +0 -120
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-products.html +0 -54
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/grouped.filter.js +0 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-details.controller.js +0 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-history.controller.js +0 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +0 -261
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest.controller.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +0 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +0 -46
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -92
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +0 -33
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-start-date.directive.js +0 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-type.directive.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptionAttachAmountFilter.filter.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.controller.js +0 -73
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +0 -110
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-type.html +0 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions-delete-bulk.html +0 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +0 -63
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +0 -52
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +0 -16
@@ -13,27 +13,27 @@ module Actions
|
|
13
13
|
if filter_ids.present? || rpm_filenames.present? || source_repositories.length > 1
|
14
14
|
sequence do
|
15
15
|
if filter_ids.present? || rpm_filenames.present?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
copy_action = plan_action(Actions::Pulp3::Repository::CopyContent,
|
17
|
+
source_repositories.first, smart_proxy, target_repo,
|
18
|
+
filter_ids: filter_ids, solve_dependencies: solve_dependencies,
|
19
|
+
rpm_filenames: rpm_filenames)
|
20
|
+
|
21
|
+
plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, copy_action.output[:pulp_tasks])
|
20
22
|
else
|
21
23
|
#if we are not filtering, copy the version to the cv repository, and the units for each additional repo
|
22
24
|
action = plan_action(Actions::Pulp3::Repository::CopyVersion, source_repositories.first, smart_proxy, target_repo)
|
23
25
|
plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, action.output[:pulp_tasks])
|
24
|
-
|
25
|
-
|
26
|
+
copy_actions = []
|
27
|
+
#since we're creating a new version from the first repo, start copying at the 2nd
|
28
|
+
source_repositories[1..-1].each do |source_repo|
|
29
|
+
copy_actions << plan_action(Actions::Pulp3::Repository::CopyContent,
|
30
|
+
source_repo, smart_proxy, target_repo,
|
31
|
+
filter_ids: filter_ids, solve_dependencies: solve_dependencies,
|
32
|
+
rpm_filenames: rpm_filenames)
|
33
|
+
end
|
26
34
|
|
27
|
-
|
28
|
-
source_repositories[start_copying_from..-1].each do |source_repo|
|
29
|
-
copy_actions << plan_action(Actions::Pulp3::Repository::CopyContent,
|
30
|
-
source_repo, smart_proxy, target_repo,
|
31
|
-
filter_ids: filter_ids,
|
32
|
-
solve_dependencies: solve_dependencies,
|
33
|
-
rpm_filenames: rpm_filenames)
|
35
|
+
plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, copy_actions.last.output[:pulp_tasks])
|
34
36
|
end
|
35
|
-
|
36
|
-
plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, copy_actions.last.output[:pulp_tasks])
|
37
37
|
end
|
38
38
|
else
|
39
39
|
plan_self(source_version_repo_id: source_repositories.first.id,
|
@@ -6,7 +6,9 @@ module Actions
|
|
6
6
|
def plan(repository, smart_proxy)
|
7
7
|
sequence do
|
8
8
|
plan_action(Actions::Pulp3::Repository::Create, repository, smart_proxy)
|
9
|
-
|
9
|
+
if repository.content_view.default? || !smart_proxy.pulp_master?
|
10
|
+
plan_action(Actions::Pulp3::Repository::CreateRemote, repository, smart_proxy)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Orchestration
|
4
|
+
module Repository
|
5
|
+
class ImportUpload < Pulp3::AbstractAsyncTask
|
6
|
+
def plan(repository, smart_proxy, args)
|
7
|
+
file = {:filename => args.dig(:unit_key, :name)}
|
8
|
+
content_unit_href = args.dig(:unit_key, :content_unit_id)
|
9
|
+
sequence do
|
10
|
+
if !content_unit_href
|
11
|
+
action_output = plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :upload_href => "/pulp/api/v3/uploads/" + args.dig(:upload_id) + "/", :sha256 => args.dig(:unit_key, :checksum)).output
|
12
|
+
artifact_action_output = plan_action(Pulp3::Repository::SaveArtifact, file, repository, smart_proxy, action_output[:pulp_tasks], args.dig(:unit_type_id)).output
|
13
|
+
content_unit_href = artifact_action_output[:pulp_tasks]
|
14
|
+
else
|
15
|
+
plan_self(:skip => true)
|
16
|
+
end
|
17
|
+
action_output = plan_action(Pulp3::Repository::ImportUpload, content_unit_href, repository, smart_proxy).output
|
18
|
+
plan_action(Pulp3::Repository::SaveVersion, repository, action_output[:pulp_tasks]).output
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def invoke_external_task
|
23
|
+
if input[:skip]
|
24
|
+
output[:pulp_tasks] = nil
|
25
|
+
else
|
26
|
+
repo = ::Katello::Repository.find(input[:repository_id])
|
27
|
+
repo_backend_service = repo.backend_service(smart_proxy)
|
28
|
+
uploads_api = repo_backend_service.uploads_api
|
29
|
+
output[:pulp_tasks] = [uploads_api.commit(input[:upload_href], sha256: input[:sha256])]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Orchestration
|
4
|
+
module Repository
|
5
|
+
class RefreshRepos < Pulp3::AbstractAsyncTask
|
6
|
+
include ::Actions::Katello::CapsuleContent::RefreshRepos
|
7
|
+
input_format do
|
8
|
+
param :smart_proxy_id
|
9
|
+
param :environment_id
|
10
|
+
param :content_view_id
|
11
|
+
param :repository_id
|
12
|
+
end
|
13
|
+
def fetch_proxy_service(smart_proxy)
|
14
|
+
::Katello::Pulp3::SmartProxyRepository.new(smart_proxy)
|
15
|
+
end
|
16
|
+
|
17
|
+
def act_on_repo?(repo, smart_proxy)
|
18
|
+
smart_proxy.pulp3_support?(repo)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -8,7 +8,7 @@ module Actions
|
|
8
8
|
sequence do
|
9
9
|
action_output = plan_action(Actions::Pulp3::Repository::Sync, repository, smart_proxy, options).output
|
10
10
|
version_output = plan_action(Pulp3::Repository::SaveVersion, repository, action_output[:pulp_tasks]).output
|
11
|
-
plan_action(Pulp3::Orchestration::Repository::GenerateMetadata, repository, smart_proxy, :
|
11
|
+
plan_action(Pulp3::Orchestration::Repository::GenerateMetadata, repository, smart_proxy, :contents_changed => version_output[:contents_changed])
|
12
12
|
plan_self(:subaction_output => version_output)
|
13
13
|
end
|
14
14
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Orchestration
|
4
|
+
module Repository
|
5
|
+
class UploadContent < Pulp3::Abstract
|
6
|
+
def plan(repository, smart_proxy, file, unit_type_id)
|
7
|
+
sequence do
|
8
|
+
content_backend_service = SmartProxy.pulp_master.content_service(unit_type_id)
|
9
|
+
content_list = content_backend_service.content_api.list("digest": Digest::SHA256.hexdigest(File.read(file[:path])))
|
10
|
+
if content_list.results.empty?
|
11
|
+
upload_action_output = plan_action(Pulp3::Repository::UploadFile, repository, smart_proxy, file[:path]).output
|
12
|
+
artifact_action_output = plan_action(Pulp3::Repository::SaveArtifact, file, repository, smart_proxy, upload_action_output[:pulp_tasks], unit_type_id).output
|
13
|
+
content_unit_href = artifact_action_output[:pulp_tasks]
|
14
|
+
else
|
15
|
+
content_unit_href = content_list.results.first.pulp_href
|
16
|
+
end
|
17
|
+
action_output = plan_action(Pulp3::Repository::ImportUpload, content_unit_href, repository, smart_proxy).output
|
18
|
+
plan_action(Pulp3::Repository::SaveVersion, repository, action_output[:pulp_tasks]).output
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module OrphanCleanup
|
4
|
+
class DeleteOrphanRepositoryVersions < Pulp3::AbstractAsyncTask
|
5
|
+
def plan(smart_proxy)
|
6
|
+
plan_self(:smart_proxy_id => smart_proxy.id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
smart_proxy = SmartProxy.find(input[:smart_proxy_id])
|
11
|
+
if smart_proxy.pulp_mirror?
|
12
|
+
output[:pulp_tasks] = ::Katello::Pulp3::Repository.delete_orphan_repository_versions_for_mirror(smart_proxy)
|
13
|
+
else
|
14
|
+
output[:pulp_tasks] = ::Katello::Pulp3::Repository.delete_orphan_repository_versions(smart_proxy)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module OrphanCleanup
|
4
|
+
class RemoveUnneededRepos < Pulp3::AbstractAsyncTask
|
5
|
+
def plan(smart_proxy)
|
6
|
+
plan_self(:smart_proxy_id => smart_proxy.id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def invoke_external_task
|
10
|
+
smart_proxy_service = ::Katello::Pulp3::SmartProxyRepository.new(smart_proxy)
|
11
|
+
smart_proxy_service.delete_orphaned_repositories_for_mirror_proxies
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -12,11 +12,7 @@ module Actions
|
|
12
12
|
|
13
13
|
def invoke_external_task
|
14
14
|
repository = ::Katello::Repository.find(input[:repository_id])
|
15
|
-
|
16
|
-
output[:response] = repository.backend_service(smart_proxy).create_publication
|
17
|
-
else
|
18
|
-
[]
|
19
|
-
end
|
15
|
+
output[:response] = repository.backend_service(smart_proxy).create_publication
|
20
16
|
end
|
21
17
|
end
|
22
18
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# This action takes a content unit and a repository
|
2
|
+
# Creates a content unit based on content type and then creates a new repository version with the added content.
|
3
|
+
module Actions
|
4
|
+
module Pulp3
|
5
|
+
module Repository
|
6
|
+
class ImportUpload < Pulp3::AbstractAsyncTask
|
7
|
+
def plan(content_unit, repository, smart_proxy)
|
8
|
+
plan_self(:content_unit => content_unit, :repository_id => repository.id, :smart_proxy_id => smart_proxy.id)
|
9
|
+
end
|
10
|
+
|
11
|
+
def invoke_external_task
|
12
|
+
content_unit = input[:content_unit]
|
13
|
+
content_unit_href = content_unit.is_a?(String) ? content_unit : content_unit.last[:created_resources].first
|
14
|
+
repo = ::Katello::Repository.find(input[:repository_id])
|
15
|
+
repo_backend_service = repo.backend_service(smart_proxy)
|
16
|
+
output[:pulp_tasks] = repo_backend_service.add_content(content_unit_href)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Repository
|
4
|
+
class SaveArtifact < Pulp3::AbstractAsyncTask
|
5
|
+
def plan(file, repository, smart_proxy, tasks, unit_type_id, options = {})
|
6
|
+
options[:file_name] = file[:filename]
|
7
|
+
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :tasks => tasks, :unit_type_id => unit_type_id, :options => options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def invoke_external_task
|
11
|
+
artifact_href = input[:tasks].last[:created_resources].first
|
12
|
+
content_type = input[:unit_type_id]
|
13
|
+
content_backend_service = SmartProxy.pulp_master.content_service(content_type)
|
14
|
+
output[:pulp_tasks] = [content_backend_service.content_api.create(input[:options][:file_name], artifact: artifact_href)]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -10,9 +10,10 @@ module Actions
|
|
10
10
|
version_href = input[:tasks].last[:created_resources].first
|
11
11
|
repo = ::Katello::Repository.find(input[:repository_id])
|
12
12
|
repo_version = repo.backend_service(::SmartProxy.pulp_master).lookup_version version_href
|
13
|
-
|
13
|
+
|
14
|
+
content_summary = repo_version.content_summary
|
14
15
|
first_version = (repo_version.number == 1)
|
15
|
-
output[:contents_changed] = first_version || !(content_summary.
|
16
|
+
output[:contents_changed] = first_version || !(content_summary.added.empty? && content_summary.removed.empty?)
|
16
17
|
if version_href && output[:contents_changed]
|
17
18
|
repo.update_attributes(:version_href => version_href)
|
18
19
|
end
|
@@ -10,7 +10,7 @@ module Actions
|
|
10
10
|
|
11
11
|
def invoke_external_task
|
12
12
|
repo = ::Katello::Repository.find(input[:repo_id])
|
13
|
-
output[:pulp_tasks] = repo.backend_service(::SmartProxy.find(input[:smart_proxy_id])).sync
|
13
|
+
output[:pulp_tasks] = repo.backend_service(::SmartProxy.unscoped.find(input[:smart_proxy_id])).sync
|
14
14
|
end
|
15
15
|
|
16
16
|
def external_task=(tasks)
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp3
|
3
|
+
module Repository
|
4
|
+
class UploadFile < Pulp3::AbstractAsyncTask
|
5
|
+
def plan(repository, smart_proxy, file)
|
6
|
+
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :file => file)
|
7
|
+
end
|
8
|
+
|
9
|
+
def invoke_external_task
|
10
|
+
repo = ::Katello::Repository.find(input[:repository_id])
|
11
|
+
repo_backend_service = repo.backend_service(smart_proxy)
|
12
|
+
upload_class = repo_backend_service.upload_class
|
13
|
+
uploads_api = repo_backend_service.uploads_api
|
14
|
+
offset = 0
|
15
|
+
response = nil
|
16
|
+
File.open(input[:file], "rb") do |file|
|
17
|
+
total_size = File.size(file)
|
18
|
+
upload_href = uploads_api.create(upload_class.new(size: total_size)).pulp_href
|
19
|
+
sha256 = Digest::SHA256.hexdigest(File.read(file))
|
20
|
+
until file.eof?
|
21
|
+
chunk = file.read(upload_chunk_size)
|
22
|
+
begin
|
23
|
+
filechunk = Tempfile.new('filechunk', :encoding => 'ascii-8bit')
|
24
|
+
filechunk.write(chunk)
|
25
|
+
filechunk.flush
|
26
|
+
actual_chunk_size = File.size(filechunk)
|
27
|
+
response = uploads_api.update(upload_href, content_range(offset, offset + actual_chunk_size - 1, total_size), filechunk)
|
28
|
+
offset += actual_chunk_size - 1
|
29
|
+
ensure
|
30
|
+
filechunk.close
|
31
|
+
filechunk.unlink
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
if response
|
36
|
+
upload_href = response.pulp_href
|
37
|
+
output[:pulp_tasks] = [uploads_api.commit(upload_href, sha256: sha256)]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def external_task=(tasks)
|
43
|
+
super
|
44
|
+
end
|
45
|
+
|
46
|
+
def finalize
|
47
|
+
check_error_details
|
48
|
+
end
|
49
|
+
|
50
|
+
def check_error_details
|
51
|
+
output[:pulp_tasks].each do |pulp_task|
|
52
|
+
error_details = pulp_task.try(:[], "error")
|
53
|
+
if error_details && !error_details.nil?
|
54
|
+
fail _("An error occurred during the sync \n%{error_message}") % {:error_message => error_details}
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def upload_chunk_size
|
62
|
+
SETTINGS[:katello][:pulp][:upload_chunk_size]
|
63
|
+
end
|
64
|
+
|
65
|
+
def checksum(file)
|
66
|
+
Digest::SHA256.hexdigest(File.read(file))
|
67
|
+
end
|
68
|
+
|
69
|
+
def content_range(start, finish, total)
|
70
|
+
finish = finish > total ? total : finish
|
71
|
+
"bytes #{start}-#{finish}/#{total}"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -43,8 +43,7 @@ module Katello
|
|
43
43
|
|
44
44
|
render :template => "katello/api/v2/#{resource_name}/#{action}",
|
45
45
|
:status => status,
|
46
|
-
:locals =>
|
47
|
-
:root_name => options[:root_name] },
|
46
|
+
:locals => options.slice(:object_name, :root_name, :locals),
|
48
47
|
:layout => "katello/api/v2/layouts/#{options[:layout]}"
|
49
48
|
end
|
50
49
|
|
@@ -6,7 +6,8 @@ module Katello
|
|
6
6
|
module Overrides
|
7
7
|
def allowed_helpers
|
8
8
|
super + [:errata, :host_subscriptions, :host_applicable_errata_ids, :host_applicable_errata_filtered,
|
9
|
-
:host_latest_applicable_rpm_version, :load_pools, :load_errata_applications
|
9
|
+
:host_latest_applicable_rpm_version, :load_pools, :load_errata_applications, :host_content_facet,
|
10
|
+
:host_sla, :host_products, :sub_name, :sub_sku, :registered_through]
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
@@ -22,6 +23,32 @@ module Katello
|
|
22
23
|
host.subscriptions
|
23
24
|
end
|
24
25
|
|
26
|
+
def host_content_facet(host)
|
27
|
+
host.content_facet
|
28
|
+
end
|
29
|
+
|
30
|
+
def host_sla(host)
|
31
|
+
host_subscription_facet(host)&.service_level
|
32
|
+
end
|
33
|
+
|
34
|
+
def host_products(host)
|
35
|
+
host_subscription_facet(host)&.installed_products
|
36
|
+
end
|
37
|
+
|
38
|
+
def sub_name(pool)
|
39
|
+
return unless pool
|
40
|
+
pool.subscription&.name
|
41
|
+
end
|
42
|
+
|
43
|
+
def sub_sku(pool)
|
44
|
+
return unless pool
|
45
|
+
pool.subscription&.cp_id
|
46
|
+
end
|
47
|
+
|
48
|
+
def registered_through(host)
|
49
|
+
host_subscription_facet(host)&.registered_through
|
50
|
+
end
|
51
|
+
|
25
52
|
def host_applicable_errata_ids(host)
|
26
53
|
host.applicable_errata.map(&:errata_id)
|
27
54
|
end
|
@@ -39,9 +66,10 @@ module Katello
|
|
39
66
|
end
|
40
67
|
|
41
68
|
# rubocop:disable Metrics/MethodLength
|
42
|
-
def load_errata_applications(filter_errata_type:
|
69
|
+
def load_errata_applications(filter_errata_type: nil, include_last_reboot: 'yes', since: nil, up_to: nil, status: nil)
|
43
70
|
result = []
|
44
71
|
|
72
|
+
filter_errata_type = filter_errata_type.presence || 'all'
|
45
73
|
search_up_to = up_to.present? ? "ended_at < \"#{up_to}\"" : nil
|
46
74
|
search_since = since.present? ? "ended_at > \"#{since}\"" : nil
|
47
75
|
search_result = status.present? ? "result = #{status}" : nil
|
@@ -107,6 +135,10 @@ module Katello
|
|
107
135
|
|
108
136
|
private
|
109
137
|
|
138
|
+
def host_subscription_facet(host)
|
139
|
+
host.subscription_facet
|
140
|
+
end
|
141
|
+
|
110
142
|
def parse_errata(task)
|
111
143
|
@_tasks_errata_cache[task.id] ||= if task.input['errata'].present?
|
112
144
|
# katello agent errata
|
data/app/lib/katello/errors.rb
CHANGED
@@ -100,6 +100,21 @@ module Katello
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
+
class Pulp3Error < StandardError
|
104
|
+
def self.from_task(task)
|
105
|
+
if task[:state] == 'canceled'
|
106
|
+
self.new(_("Task canceled"))
|
107
|
+
elsif task[:state] == 'failed'
|
108
|
+
message = if task[:error][:description].blank?
|
109
|
+
_("Pulp task error")
|
110
|
+
else
|
111
|
+
task[:error][:description]
|
112
|
+
end
|
113
|
+
self.new(message)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
103
118
|
class PulpError < StandardError
|
104
119
|
def self.from_task(task)
|
105
120
|
if %w(error canceled).include?(task[:state])
|
@@ -125,5 +140,11 @@ module Katello
|
|
125
140
|
end
|
126
141
|
|
127
142
|
class UpstreamEntitlementGone < StandardError; end
|
143
|
+
|
144
|
+
class ContainerRegistryNotConfigured < StandardError
|
145
|
+
def message
|
146
|
+
_("No URL found for a container registry. Please check the configuration.")
|
147
|
+
end
|
148
|
+
end
|
128
149
|
end
|
129
150
|
end
|