katello 4.3.0.rc2.1 → 4.4.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/assets/javascripts/katello/common/vendor.js +0 -1
- data/app/controllers/katello/api/v2/api_controller.rb +13 -4
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +11 -3
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -1
- data/app/controllers/katello/api/v2/content_views_controller.rb +46 -0
- data/app/controllers/katello/api/v2/generic_content_units_controller.rb +10 -4
- data/app/controllers/katello/api/v2/host_packages_controller.rb +21 -1
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +30 -1
- data/app/controllers/katello/api/v2/organizations_controller.rb +10 -6
- data/app/controllers/katello/api/v2/packages_controller.rb +4 -0
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +8 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +74 -17
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +7 -0
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -9
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +3 -0
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +32 -0
- data/app/controllers/katello/remote_execution_controller.rb +5 -4
- data/app/graphql/types/host_collection.rb +18 -0
- data/app/helpers/katello/content_source_helper.rb +43 -0
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +4 -0
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
- data/app/lib/actions/katello/cdn_configuration/update.rb +5 -7
- data/app/lib/actions/katello/content_view/publish.rb +5 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +17 -3
- data/app/lib/actions/katello/repository/discover.rb +1 -14
- data/app/lib/actions/katello/repository/filtered_index_content.rb +1 -1
- data/app/lib/actions/katello/repository/import_upload.rb +12 -2
- data/app/lib/actions/pulp3/abstract_async_task.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +5 -4
- data/app/lib/actions/pulp3/capsule_content/reclaim_space.rb +25 -0
- data/app/lib/actions/pulp3/content_view_version/import.rb +7 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +7 -5
- data/app/lib/actions/pulp3/orchestration/repository/import_repository_upload.rb +36 -0
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +1 -1
- data/app/lib/actions/pulp3/repository/commit_upload.rb +3 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/import_upload.rb +4 -2
- data/app/lib/actions/pulp3/repository/reclaim_space.rb +25 -0
- data/app/lib/actions/pulp3/repository/save_artifact.rb +13 -8
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +11 -0
- data/app/lib/katello/errors.rb +3 -3
- data/app/lib/katello/logging.rb +6 -1
- data/app/lib/katello/repo_discovery.rb +27 -19
- data/app/lib/katello/resources/cdn/katello_cdn.rb +41 -3
- data/app/lib/katello/resources/cdn.rb +4 -2
- data/app/lib/katello/resources/registry.rb +1 -1
- data/app/lib/katello/util/deduplication_migrator.rb +105 -0
- data/app/models/katello/candlepin/repository_mapper.rb +2 -2
- data/app/models/katello/cdn_configuration.rb +38 -6
- data/app/models/katello/concerns/host_managed_extensions.rb +24 -2
- data/app/models/katello/concerns/organization_extensions.rb +5 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +59 -173
- data/app/models/katello/concerns/remote_execution_proxy_selector_extensions.rb +11 -0
- data/app/models/katello/concerns/smart_proxy_extensions.rb +17 -9
- data/app/models/katello/content_view.rb +4 -4
- data/app/models/katello/content_view_filter.rb +1 -1
- data/app/models/katello/content_view_history.rb +1 -1
- data/app/models/katello/content_view_version.rb +6 -2
- data/app/models/katello/content_view_version_export_history.rb +1 -1
- data/app/models/katello/deb.rb +1 -3
- data/app/models/katello/docker_meta_tag.rb +1 -1
- data/app/models/katello/erratum.rb +0 -15
- data/app/models/katello/glue/provider.rb +1 -1
- data/app/models/katello/glue/pulp/repos.rb +3 -1
- data/app/models/katello/host/content_facet.rb +2 -27
- data/app/models/katello/host/info_provider.rb +9 -0
- data/app/models/katello/host/subscription_facet.rb +2 -2
- data/app/models/katello/hostgroup/content_facet.rb +2 -2
- data/app/models/katello/product.rb +1 -1
- data/app/models/katello/product_content.rb +2 -2
- data/app/models/katello/pulp3/repository_reference.rb +7 -0
- data/app/models/katello/repository.rb +13 -12
- data/app/models/katello/root_repository.rb +51 -15
- data/app/models/katello/rpm.rb +8 -2
- data/app/models/setting/content.rb +7 -10
- data/app/services/cert/rhsm_client.rb +1 -5
- data/app/services/katello/component_view_presenter.rb +1 -1
- data/app/services/katello/content_unit_indexer.rb +166 -0
- data/app/services/katello/organization_creator.rb +23 -8
- data/app/services/katello/pulp/repository/docker.rb +1 -1
- data/app/services/katello/pulp/repository/yum.rb +0 -54
- data/app/services/katello/pulp/repository.rb +0 -6
- data/app/services/katello/pulp3/ansible_collection.rb +26 -10
- data/app/services/katello/pulp3/api/apt.rb +7 -0
- data/app/services/katello/pulp3/api/core.rb +16 -2
- data/app/services/katello/pulp3/content.rb +4 -2
- data/app/services/katello/pulp3/content_view_version/import.rb +11 -2
- data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +1 -1
- data/app/services/katello/pulp3/deb.rb +10 -9
- data/app/services/katello/pulp3/docker_manifest.rb +6 -5
- data/app/services/katello/pulp3/docker_manifest_list.rb +23 -6
- data/app/services/katello/pulp3/docker_tag.rb +16 -7
- data/app/services/katello/pulp3/erratum.rb +51 -56
- data/app/services/katello/pulp3/file_unit.rb +9 -6
- data/app/services/katello/pulp3/generic_content_unit.rb +11 -12
- data/app/services/katello/pulp3/module_stream.rb +76 -30
- data/app/services/katello/pulp3/package_group.rb +5 -5
- data/app/services/katello/pulp3/pulp_content_unit.rb +21 -7
- data/app/services/katello/pulp3/repository/apt.rb +5 -3
- data/app/services/katello/pulp3/repository/docker.rb +14 -7
- data/app/services/katello/pulp3/repository/generic.rb +1 -1
- data/app/services/katello/pulp3/repository/yum.rb +12 -12
- data/app/services/katello/pulp3/repository.rb +37 -13
- data/app/services/katello/pulp3/repository_mirror.rb +18 -4
- data/app/services/katello/pulp3/rpm.rb +13 -13
- data/app/services/katello/pulp3/srpm.rb +10 -9
- data/app/services/katello/registration_manager.rb +1 -1
- data/app/services/katello/repository_type.rb +16 -4
- data/app/services/katello/repository_type_manager.rb +1 -1
- data/app/services/katello/ui_notifications/subscriptions/manifest_expired_warning.rb +1 -1
- data/app/services/katello/upstream_connection_checker.rb +2 -2
- data/app/views/foreman/job_templates/change_content_source.erb +12 -0
- data/app/views/foreman/job_templates/install_errata.erb +6 -9
- data/app/views/foreman/job_templates/install_errata_by_search_query.erb +26 -0
- data/app/views/foreman/job_templates/install_packages_by_search_query.erb +19 -0
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +10 -4
- data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +12 -0
- data/app/views/foreman/smart_proxies/show.html.erb +4 -2
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +2 -0
- data/app/views/katello/api/v2/cdn_configurations/show.json.rabl +1 -1
- data/app/views/katello/api/v2/environments/show.json.rabl +9 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +3 -1
- data/app/views/katello/layouts/react.html.erb +0 -1
- data/app/views/katello/sync_management/_repo.html.erb +36 -25
- data/config/initializers/monkeys.rb +0 -1
- data/config/routes/api/v2.rb +6 -0
- data/config/routes/overrides.rb +3 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
- data/db/migrate/20180612164926_add_content_org_id.rb +2 -2
- data/db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb +2 -0
- data/db/migrate/20211129200124_remove_dependency_solving_algorithm_setting.rb +5 -0
- data/db/migrate/20211201154845_add_unique_indexes.rb +20 -0
- data/db/migrate/20211202172358_add_repository_mirroring_policy.rb +26 -0
- data/db/migrate/20211208034230_add_content_view_and_lifecycle_environment.rb +6 -0
- data/db/migrate/20211220185935_clean_duplicate_content_units.rb +144 -0
- data/db/migrate/20220110223754_update_disconnected_settings.rb +20 -0
- data/db/migrate/20220120163252_fix_docker_download_policy.rb +11 -0
- data/db/migrate/20220124191056_add_type_to_cdn_configuration.rb +22 -0
- data/db/migrate/20220127120843_fix_debian_download_policy.rb +11 -0
- data/db/migrate/20220204171908_rename_docker_tags_whitelist_and_add_exclude_tags.rb +8 -0
- data/db/migrate/20220207140355_change_deb_attributes_size_limit.rb +7 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/views/bastion/layouts/application.html.erb +0 -1
- data/engines/bastion/app/views/bastion/layouts/assets.html.erb +0 -1
- 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 +21 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/sync-state.service.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-traces-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +26 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +212 -152
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +14 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +25 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +2 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-reclaim-space-modal.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +24 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details-reclaim-space-modal.html +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +13 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +49 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/mirroring-policy.service.js +30 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +24 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +48 -23
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/product-repositories-reclaim-space-modal.controller.js +35 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories-reclaim-space-modal.html +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +7 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.routes.js +4 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.controller.js +35 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.factory.js +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.module.js +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.routes.js +16 -0
- data/lib/katello/engine.rb +4 -0
- data/lib/katello/permission_creator.rb +4 -4
- data/lib/katello/permissions/host_permissions.rb +3 -1
- data/lib/katello/plugin.rb +11 -1
- data/lib/katello/repository_types/deb.rb +0 -1
- data/lib/katello/repository_types/docker.rb +4 -4
- data/lib/katello/repository_types/file.rb +0 -1
- data/lib/katello/repository_types/ostree.rb +7 -1
- data/lib/katello/repository_types/python.rb +5 -1
- data/lib/katello/repository_types/yum.rb +2 -9
- data/lib/katello/tasks/content_view_import_only.rake +34 -0
- data/lib/katello/tasks/import_applicability.rake +1 -1
- data/lib/katello/tasks/jenkins.rake +0 -2
- data/lib/katello/tasks/repository.rake +4 -1
- data/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake +25 -0
- data/lib/katello/tasks/upgrades/4.4/publish_import_cvvs.rake +17 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +8 -7
- data/locale/bn/katello.po +1402 -650
- data/locale/cs/katello.po +1217 -96
- data/locale/de/katello.po +2359 -1347
- data/locale/en/katello.po +1216 -94
- data/locale/es/katello.po +2201 -1172
- data/locale/fr/katello.po +2601 -1615
- data/locale/gu/katello.po +1564 -814
- data/locale/hi/katello.po +1563 -810
- data/locale/it/katello.po +1311 -282
- data/locale/ja/katello.po +2534 -1518
- data/locale/katello.pot +3430 -1326
- data/locale/kn/katello.po +1564 -812
- data/locale/ko/katello.po +1441 -409
- data/locale/mr/katello.po +1564 -776
- data/locale/or/katello.po +1565 -813
- data/locale/pa/katello.po +1559 -792
- data/locale/pt/katello.po +1314 -277
- data/locale/pt_BR/katello.po +2226 -1181
- data/locale/ru/katello.po +1587 -563
- data/locale/ta/katello.po +1373 -619
- data/locale/te/katello.po +1564 -810
- data/locale/zh_CN/katello.po +2936 -1890
- data/locale/zh_TW/katello.po +1508 -606
- data/package.json +1 -0
- data/webpack/__mocks__/foremanReact/{redux/actions/toasts.js → components/ToastsList/index.js} +3 -2
- data/webpack/components/ActionableDetail.js +35 -21
- data/webpack/components/AddedStatusLabel.js +2 -1
- data/webpack/components/Content/Details/ContentDetails.js +1 -1
- data/webpack/components/Content/Details/__tests__/ContentDetailInfo.test.js +0 -2
- data/webpack/components/Content/Details/__tests__/ContentDetailRepositories.test.js +0 -2
- data/webpack/components/Content/Details/__tests__/ContentDetails.test.js +0 -2
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +1 -1
- data/webpack/components/Content/__tests__/ContentPage.test.js +0 -2
- data/webpack/components/Content/__tests__/ContentTable.test.js +0 -2
- data/webpack/components/EditableSwitch.js +8 -2
- data/webpack/components/EditableTextInput/EditableTextInput.js +95 -78
- data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +85 -3
- data/webpack/components/EditableTextInput/editableTextInput.scss +4 -0
- data/webpack/components/Errata/index.js +69 -3
- data/webpack/components/Packages/index.js +1 -1
- data/webpack/components/RoutedTabs/index.js +5 -2
- data/webpack/components/Search/Search.js +5 -2
- data/webpack/components/Search/__tests__/search.test.js +2 -3
- data/webpack/components/SelectOrg/SetOrganization.js +1 -1
- data/webpack/components/Table/EmptyStateMessage.js +4 -2
- data/webpack/components/Table/PageControls.js +3 -6
- data/webpack/components/Table/TableHooks.js +46 -7
- data/webpack/components/Table/TableWrapper.js +25 -8
- data/webpack/components/TypeAhead/TypeAhead.js +5 -1
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +4 -1
- data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +2 -1
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard.js +24 -30
- data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +108 -0
- data/webpack/components/extensions/HostDetails/Cards/__tests__/errataOverviewCard.test.js +56 -0
- data/webpack/components/extensions/HostDetails/HostDetailsActions.js +2 -0
- data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesActions.js +18 -2
- data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesConstants.js +12 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +1 -1
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/index.js +1 -0
- data/webpack/components/extensions/HostDetails/Tabs/{ErrataTab.js → ErrataTab/ErrataTab.js} +86 -75
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.scss +11 -0
- data/webpack/components/extensions/HostDetails/Tabs/{ErratumExpansionContents.js → ErrataTab/ErratumExpansionContents.js} +0 -0
- data/webpack/components/extensions/HostDetails/Tabs/{ErratumExpansionDetail.js → ErrataTab/ErratumExpansionDetail.js} +0 -0
- data/webpack/components/extensions/HostDetails/{HostErrata → Tabs/ErrataTab}/HostErrataActions.js +3 -3
- data/webpack/components/extensions/HostDetails/{HostErrata → Tabs/ErrataTab}/HostErrataConstants.js +11 -0
- data/webpack/components/extensions/HostDetails/{HostErrata → Tabs/ErrataTab}/HostErrataSelectors.js +0 -0
- data/webpack/components/extensions/HostDetails/Tabs/PackageInstallModal.js +279 -0
- data/webpack/components/extensions/HostDetails/Tabs/PackageInstallModal.scss +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.js +163 -46
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.scss +3 -7
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +27 -4
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +2 -1
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +45 -42
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.scss +3 -3
- data/webpack/components/extensions/HostDetails/Tabs/{EnableTracerEmptyState.js → TracesTab/EnableTracerEmptyState.js} +0 -0
- data/webpack/components/extensions/HostDetails/Tabs/{EnableTracerModal.js → TracesTab/EnableTracerModal.js} +3 -2
- data/webpack/components/extensions/HostDetails/Tabs/{HostTracesActions.js → TracesTab/HostTracesActions.js} +2 -2
- data/webpack/components/extensions/HostDetails/Tabs/{HostTracesConstants.js → TracesTab/HostTracesConstants.js} +0 -0
- data/webpack/components/extensions/HostDetails/Tabs/{HostTracesSelectors.js → TracesTab/HostTracesSelectors.js} +0 -0
- data/webpack/components/extensions/HostDetails/Tabs/{TracesTab.js → TracesTab/TracesTab.js} +66 -61
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.scss +11 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +17 -18
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +385 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packages.fixtures.json +1 -1
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +58 -7
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +2 -2
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +4 -4
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/yumInstallablePackages.fixtures.json +72 -0
- data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +12 -5
- data/webpack/components/extensions/HostDetails/YumInstallablePackages/YumInstallablePackagesActions.js +18 -0
- data/webpack/components/extensions/HostDetails/YumInstallablePackages/YumInstallablePackagesConstants.js +3 -0
- data/webpack/components/extensions/HostDetails/YumInstallablePackages/YumInstallablePackagesSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/hostDetailsHelpers.js +19 -0
- data/webpack/components/pf3Table/components/Table.js +2 -3
- data/webpack/components/pf3Table/components/Table.test.js +0 -3
- data/webpack/components/pf3Table/components/__snapshots__/Table.test.js.snap +9 -8
- data/webpack/containers/Application/config.js +6 -1
- data/webpack/containers/Application/overrides.scss +56 -7
- data/webpack/global_index.js +14 -6
- data/webpack/global_test_setup.js +1 -1
- data/webpack/index.js +7 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +0 -2
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +0 -2
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +0 -2
- data/webpack/scenes/Content/ContentConfig.js +55 -5
- data/webpack/scenes/Content/ContentPage.js +5 -5
- data/webpack/scenes/Content/Details/ContentDetails.js +23 -21
- data/webpack/scenes/Content/Details/ContentInfo.js +2 -2
- data/webpack/scenes/Content/Details/ContentRepositories.js +1 -1
- data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +4 -4
- data/webpack/scenes/Content/Table/ContentTable.js +1 -1
- data/webpack/scenes/Content/__tests__/contentTable.test.js +3 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +5 -4
- data/webpack/scenes/ContentViews/ContentViewsPage.js +17 -13
- data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +8 -12
- data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +1 -1
- data/webpack/scenes/ContentViews/Copy/__tests__/copyContentView.test.js +1 -1
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +1 -1
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionFinish.js +10 -4
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +11 -8
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +22 -11
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +31 -18
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +36 -31
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +29 -35
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +5 -5
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +118 -58
- data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +9 -4
- data/webpack/scenes/ContentViews/Details/DetailsContainer.js +14 -17
- data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +5 -2
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +1 -4
- data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +8 -8
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +15 -9
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +20 -16
- data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +7 -10
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +42 -45
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +5 -5
- data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +4 -4
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +2 -2
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +23 -19
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +6 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +16 -22
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +2 -3
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +9 -16
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +3 -5
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +4 -5
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +2 -10
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataDateFilterContent.test.js +1 -9
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +4 -7
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +4 -7
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +20 -7
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +5 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +27 -9
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +1 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +11 -5
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +45 -43
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +4 -4
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +31 -5
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveCVVersionWizard.js +4 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionDeleteFinish.js +14 -3
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +9 -9
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +30 -34
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +13 -10
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.scss +5 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +129 -28
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +25 -5
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js +22 -1
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +5 -4
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +5 -3
- data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +4 -4
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +3 -3
- data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +1 -1
- data/webpack/scenes/ContentViews/components/ContentViewIcon.js +6 -2
- data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +1 -1
- data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +8 -8
- data/webpack/scenes/Hosts/ChangeContentSource/actions.js +43 -0
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +87 -0
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceTemplate.js +90 -0
- data/webpack/scenes/Hosts/ChangeContentSource/components/FormField.js +43 -0
- data/webpack/scenes/Hosts/ChangeContentSource/constants.js +3 -0
- data/webpack/scenes/Hosts/ChangeContentSource/helpers.js +27 -0
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +126 -0
- data/webpack/scenes/Hosts/ChangeContentSource/selectors.js +42 -0
- data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +11 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ModuleStreamDetailProfiles.test.js +0 -1
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetails.test.js +0 -2
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +0 -2
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +0 -2
- data/webpack/scenes/Organizations/OrganizationActions.js +5 -1
- data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +31 -1
- data/webpack/scenes/RedHatRepositories/__tests__/RedHatRepositoriesPage.test.js +16 -0
- data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +11 -2
- data/webpack/scenes/RedHatRepositories/helpers.js +5 -5
- data/webpack/scenes/RedHatRepositories/index.js +11 -3
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/AirGappedTypeForm.js +81 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnConfigurationConstants.js +13 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnConfigurationForm.scss +3 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +106 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/UpstreamServerTypeForm.js +259 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/AirGappedTypeForm.test.js +44 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/CdnTypeForm.test.js +67 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/UpstreamServerTypeForm.test.js +143 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/index.js +97 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +99 -265
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +0 -29
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +0 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +0 -1
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +4 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +4 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +9 -0
- data/webpack/scenes/Tasks/TaskActions.js +5 -4
- data/webpack/scenes/Tasks/__tests__/__snapshots__/TaskActions.test.js.snap +4 -2
- data/webpack/services/api/testHelpers.js +5 -3
- data/webpack/utils/helpers.js +7 -4
- metadata +99 -53
- data/app/services/katello/pulp/deb.rb +0 -55
- data/app/services/katello/pulp/distribution.rb +0 -7
- data/app/services/katello/pulp/docker_blob.rb +0 -7
- data/app/services/katello/pulp/docker_manifest.rb +0 -13
- data/app/services/katello/pulp/docker_manifest_list.rb +0 -14
- data/app/services/katello/pulp/docker_tag.rb +0 -14
- data/app/services/katello/pulp/erratum.rb +0 -129
- data/app/services/katello/pulp/file_unit.rb +0 -21
- data/app/services/katello/pulp/module_stream.rb +0 -39
- data/app/services/katello/pulp/package_category.rb +0 -7
- data/app/services/katello/pulp/package_group.rb +0 -20
- data/app/services/katello/pulp/pulp_content_unit.rb +0 -156
- data/app/services/katello/pulp/rpm.rb +0 -57
- data/app/services/katello/pulp/srpm.rb +0 -29
- data/app/services/katello/pulp/yum_metadata_file.rb +0 -30
- data/lib/monkeys/pulp3_13_checksumfix.rb +0 -17
- data/webpack/__mocks__/foremanReact/components/Pagination/PaginationHooks.js +0 -2
- data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.scss +0 -16
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab.scss +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cffead633d7427ab354f070ad520ef1436914690ae62a83707bd51f0ff94156
|
4
|
+
data.tar.gz: 759afa6d6768f23db062327899cd38db646b99c59d5068027dcf4bdc74f47896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4d6669e6c29532fe48cb70fd014bc0fb0fd9e7ddfb29a3832e175134be2ecb40b2dbcedd458cef5303805680e28ec3d17a3ea9f250a3482403490c7dd22b3d1
|
7
|
+
data.tar.gz: 458b225423b94a7cfb95034ee9bbff4d0fceca0effcf2dfd2651bb98bf535cadc681791ccbbaca19175cd17446fffab9b1190140f07973e8b220c28239aaf398
|
@@ -126,7 +126,7 @@ module Katello
|
|
126
126
|
end
|
127
127
|
rescue ScopedSearch::QueryNotSupported, ActiveRecord::StatementInvalid => error
|
128
128
|
message = error.message
|
129
|
-
if error.
|
129
|
+
if error.instance_of? ActiveRecord::StatementInvalid
|
130
130
|
Rails.logger.error("Invalid search: #{error.message}")
|
131
131
|
message = _('Your search query was invalid. Please revise it and try again. The full error has been sent to the application logs.')
|
132
132
|
end
|
@@ -141,7 +141,7 @@ module Katello
|
|
141
141
|
protected
|
142
142
|
|
143
143
|
def scoped_search_query(query, group)
|
144
|
-
if group
|
144
|
+
if group && !query_has_group_by?(query)
|
145
145
|
query.select(group).group(group)
|
146
146
|
else
|
147
147
|
query
|
@@ -149,7 +149,12 @@ module Katello
|
|
149
149
|
end
|
150
150
|
|
151
151
|
def scoped_search_total(query, group)
|
152
|
-
scoped_search_query(query, group)
|
152
|
+
count_query = scoped_search_query(query, group)
|
153
|
+
if query_has_group_by?(count_query)
|
154
|
+
count_query.length
|
155
|
+
else
|
156
|
+
count_query.count
|
157
|
+
end
|
153
158
|
end
|
154
159
|
|
155
160
|
def scoped_search_total_selectable(query, group)
|
@@ -157,10 +162,14 @@ module Katello
|
|
157
162
|
if self.respond_to?(:total_selectable, true)
|
158
163
|
total_selectable(q)
|
159
164
|
else
|
160
|
-
q.length
|
165
|
+
group ? q.length : q.count
|
161
166
|
end
|
162
167
|
end
|
163
168
|
|
169
|
+
def query_has_group_by?(query)
|
170
|
+
query.to_sql.include?('GROUP BY')
|
171
|
+
end
|
172
|
+
|
164
173
|
def scoped_search_results(query:, subtotal: 0, total: 0, page: 0, per_page: 0, error: nil, selectable: nil)
|
165
174
|
{
|
166
175
|
:results => query,
|
@@ -4,7 +4,7 @@ module Katello
|
|
4
4
|
api_base_url "/katello/api"
|
5
5
|
end
|
6
6
|
|
7
|
-
before_action :find_capsule, :except => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment]
|
7
|
+
before_action :find_capsule, :except => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment, :reclaim_space]
|
8
8
|
before_action :find_editable_capsule, :only => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment]
|
9
9
|
before_action :find_environment, :only => [:add_lifecycle_environment, :remove_lifecycle_environment]
|
10
10
|
before_action :find_optional_organization, :only => [:sync_status]
|
@@ -86,6 +86,14 @@ module Katello
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
api :POST, '/capsules/:id/reclaim_space', N_('Reclaim space from all On Demand repositories on a smart proxy')
|
90
|
+
param :id, :number, :required => true, :desc => N_('Id of the smart proxy')
|
91
|
+
def reclaim_space
|
92
|
+
find_capsule(true)
|
93
|
+
task = async_task(::Actions::Pulp3::CapsuleContent::ReclaimSpace, @capsule)
|
94
|
+
respond_for_async :resource => task
|
95
|
+
end
|
96
|
+
|
89
97
|
protected
|
90
98
|
|
91
99
|
def respond_for_lifecycle_environments_index(environments)
|
@@ -104,9 +112,9 @@ module Katello
|
|
104
112
|
end
|
105
113
|
end
|
106
114
|
|
107
|
-
def find_capsule
|
115
|
+
def find_capsule(primary_okay = false)
|
108
116
|
@capsule = SmartProxy.unscoped.authorized(:view_capsule_content).find(params[:id])
|
109
|
-
unless @capsule&.pulp_mirror?
|
117
|
+
unless @capsule&.pulp_mirror? || primary_okay
|
110
118
|
fail _("This request may only be performed on a Smart proxy that has the Pulpcore feature with mirror=true.")
|
111
119
|
end
|
112
120
|
end
|
@@ -10,7 +10,7 @@ module Katello
|
|
10
10
|
param :repository_id, :number, :required => true, :desc => N_("repository id")
|
11
11
|
param :size, :number, :required => true, :desc => N_("Size of file to upload")
|
12
12
|
param :checksum, String, :required => false, :desc => N_("Checksum of file to upload")
|
13
|
-
param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', '
|
13
|
+
param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree_ref', 'rpm', 'srpm')")
|
14
14
|
def create
|
15
15
|
fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Ansible collections.") if @repository.ansible_collection?
|
16
16
|
content_type = params[:content_type] || ::Katello::RepositoryTypeManager.find(@repository.content_type)&.default_managed_content_type&.label
|
@@ -76,7 +76,7 @@ module Katello
|
|
76
76
|
|
77
77
|
api :PUT, "/content_view_versions/:id/republish_repositories", N_("Forces a republish of the version's repositories' metadata")
|
78
78
|
param :id, :number, :desc => N_("Content view version identifier"), :required => true
|
79
|
-
param :force, :bool, :desc => N_("Force metadata regeneration to proceed. Dangerous when repositories use
|
79
|
+
param :force, :bool, :desc => N_("Force metadata regeneration to proceed. Dangerous when repositories use the 'Complete Mirroring' mirroring policy"), :required => true
|
80
80
|
def republish_repositories
|
81
81
|
unless ::Foreman::Cast.to_bool(params[:force])
|
82
82
|
fail HttpErrors::BadRequest, _("Metadata republishing must be forced because it is a dangerous operation.")
|
@@ -163,6 +163,9 @@ module Katello
|
|
163
163
|
|
164
164
|
def find_optional_readable_content_view
|
165
165
|
@view = ContentView.readable.find_by(:id => params[:content_view_id])
|
166
|
+
if params[:content_view_id] && !@view
|
167
|
+
fail HttpErrors::NotFound, _("Couldn't find content view with id: '%s'") % params[:content_view_id]
|
168
|
+
end
|
166
169
|
end
|
167
170
|
|
168
171
|
def find_publishable_content_view
|
@@ -2,6 +2,7 @@ module Katello
|
|
2
2
|
class Api::V2::ContentViewsController < Api::V2::ApiController
|
3
3
|
include Concerns::Authorization::Api::V2::ContentViewsController
|
4
4
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
|
+
include Katello::Concerns::Api::V2::BulkExtensions
|
5
6
|
|
6
7
|
before_action :find_authorized_katello_resource, :except => [:index, :create, :copy, :auto_complete_search]
|
7
8
|
before_action :ensure_non_default, :except => [:index, :create, :copy, :auto_complete_search]
|
@@ -24,6 +25,18 @@ module Katello
|
|
24
25
|
param :import_only, :bool, :desc => N_("Designate this Content View for importing from upstream servers only. Defaults to false")
|
25
26
|
end
|
26
27
|
|
28
|
+
def_param_group :bulk_content_view_version_ids do
|
29
|
+
param :included, Hash, :desc => N_("Versions to exclusively include in the action"), :required => true, :action_aware => true do
|
30
|
+
param :search, String, :required => false, :desc => N_("Search string for versions to perform an action on")
|
31
|
+
param :ids, Array, :required => false, :desc => N_("List of versions to perform an action on")
|
32
|
+
end
|
33
|
+
param :excluded, Hash, :desc => N_("Versions to explicitly exclude in the action."\
|
34
|
+
" All other versions will be included in the action,"\
|
35
|
+
" unless an included parameter is passed as well."), :required => true, :action_aware => true do
|
36
|
+
param :ids, Array, :required => false, :desc => N_("List of versions to exclude and not run an action on")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
27
40
|
def filtered_associations
|
28
41
|
{
|
29
42
|
:component_ids => Katello::ContentViewVersion,
|
@@ -175,6 +188,39 @@ module Katello
|
|
175
188
|
respond_for_async :resource => task
|
176
189
|
end
|
177
190
|
|
191
|
+
api :PUT, "/content_views/:id/bulk_delete_versions", N_("Bulk remove versions from a content view and reassign systems and keys")
|
192
|
+
param_group :bulk_content_view_version_ids
|
193
|
+
param :id, :number, :desc => N_("content view numeric identifier"), :required => true
|
194
|
+
param :system_content_view_id, :number, :desc => N_("content view to reassign orphaned systems to")
|
195
|
+
param :system_environment_id, :number, :desc => N_("environment to reassign orphaned systems to")
|
196
|
+
param :key_content_view_id, :number, :desc => N_("content view to reassign orphaned activation keys to")
|
197
|
+
param :key_environment_id, :number, :desc => N_("environment to reassign orphaned activation keys to")
|
198
|
+
def bulk_delete_versions
|
199
|
+
params[:bulk_content_view_version_ids] ||= {}
|
200
|
+
|
201
|
+
versions = find_bulk_items(bulk_params: params[:bulk_content_view_version_ids],
|
202
|
+
model_scope: ::Katello::ContentViewVersion.where(content_view_id: @content_view.id),
|
203
|
+
key: :id)
|
204
|
+
cv_envs = ContentViewEnvironment.where(:content_view_version_id => versions.pluck(:id),
|
205
|
+
:content_view_id => @content_view.id
|
206
|
+
)
|
207
|
+
|
208
|
+
if !params[:destroy_content_view] && cv_envs.empty? && versions.empty?
|
209
|
+
fail _("There either were no environments nor versions specified or there were invalid environments/versions specified. "\
|
210
|
+
"Please check environment_ids and content_view_version_ids parameters.")
|
211
|
+
end
|
212
|
+
|
213
|
+
options = params.slice(:system_content_view_id,
|
214
|
+
:system_environment_id,
|
215
|
+
:key_content_view_id,
|
216
|
+
:key_environment_id
|
217
|
+
).reject { |_k, v| v.nil? }.to_unsafe_h
|
218
|
+
options[:content_view_versions] = versions
|
219
|
+
options[:content_view_environments] = cv_envs
|
220
|
+
task = async_task(::Actions::Katello::ContentView::Remove, @content_view, options)
|
221
|
+
respond_for_async :resource => task
|
222
|
+
end
|
223
|
+
|
178
224
|
api :PUT, "/content_views/:id/remove_filters", N_("Delete multiple filters from a content view")
|
179
225
|
param :id, :number, :desc => N_("content view numeric identifier"), :required => true
|
180
226
|
param :filter_ids, Array, of: :number, :desc => N_("filter identifiers"), :required => true
|
@@ -1,10 +1,15 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::GenericContentUnitsController < Api::V2::ApiController
|
3
|
+
resource_description do
|
4
|
+
name 'Content Units'
|
5
|
+
param :content_type, String, desc: N_("Possible values: #{Katello::RepositoryTypeManager.generic_content_types.join(", ")}"), required: true
|
6
|
+
end
|
7
|
+
apipie_concern_subst(:a_resource => N_("a content unit"), :resource_id => "content_units")
|
8
|
+
|
3
9
|
Katello::RepositoryTypeManager.generic_content_types(false).each do |type|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
end
|
10
|
+
api :GET, "/#{type.pluralize}", N_("List %s" % type.pluralize)
|
11
|
+
api :GET, "/#{type.pluralize}/:id", N_("Show %s" % type.gsub(/_/, ' '))
|
12
|
+
api :GET, "/repositories/:repository_id/#{type.pluralize}/:id", N_("Show %s" % type.gsub(/_/, ' '))
|
8
13
|
end
|
9
14
|
|
10
15
|
include Katello::Concerns::Api::V2::RepositoryContentController
|
@@ -14,6 +19,7 @@ module Katello
|
|
14
19
|
end
|
15
20
|
|
16
21
|
def resource_class
|
22
|
+
fail "Required param content_type is missing" unless params[:content_type]
|
17
23
|
::Katello::GenericContentUnit.where(content_type: params[:content_type].singularize)
|
18
24
|
end
|
19
25
|
|
@@ -2,6 +2,10 @@ module Katello
|
|
2
2
|
class Api::V2::HostPackagesController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
+
UPGRADABLE = "upgradable".freeze
|
6
|
+
UP_TO_DATE = "up-to-date".freeze
|
7
|
+
VERSION_STATUSES = [UPGRADABLE, UP_TO_DATE].freeze
|
8
|
+
|
5
9
|
before_action :require_packages_or_groups, :only => [:install, :remove]
|
6
10
|
before_action :require_packages_only, :only => [:upgrade]
|
7
11
|
before_action :find_editable_host_with_facet, :except => :index
|
@@ -21,9 +25,11 @@ module Katello
|
|
21
25
|
api :GET, "/hosts/:host_id/packages", N_("List packages installed on the host")
|
22
26
|
param :host_id, :number, :required => true, :desc => N_("ID of the host")
|
23
27
|
param :include_latest_upgradable, :boolean, :desc => N_("Also include the latest upgradable package version for each host package")
|
28
|
+
param :status, String, :desc => N_("Return only packages of a particular status (upgradable or up-to-date)"), :required => false
|
24
29
|
param_group :search, Api::V2::ApiController
|
25
30
|
add_scoped_search_description_for(Katello::InstalledPackage)
|
26
31
|
def index
|
32
|
+
validate_index_params!
|
27
33
|
collection = scoped_search(index_relation, :name, :asc, :resource_class => ::Katello::InstalledPackage)
|
28
34
|
collection[:results] = HostPackagePresenter.with_latest(collection[:results], @host) if ::Foreman::Cast.to_bool(params[:include_latest_upgradable])
|
29
35
|
respond_for_index(:collection => collection)
|
@@ -84,7 +90,15 @@ module Katello
|
|
84
90
|
end
|
85
91
|
|
86
92
|
def index_relation
|
87
|
-
@host.installed_packages
|
93
|
+
packages = @host.installed_packages
|
94
|
+
upgradable_packages = ::Katello::Rpm.installable_for_hosts([@host]).select(:name)
|
95
|
+
if params[:status].present?
|
96
|
+
packages = case params[:status]
|
97
|
+
when 'up-to-date' then packages.where.not(name: upgradable_packages)
|
98
|
+
when 'upgradable' then packages.where(name: upgradable_packages)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
packages
|
88
102
|
end
|
89
103
|
|
90
104
|
def resource_class
|
@@ -137,5 +151,11 @@ module Katello
|
|
137
151
|
group.gsub(/^@/, "")
|
138
152
|
end
|
139
153
|
end
|
154
|
+
|
155
|
+
def validate_index_params!
|
156
|
+
if params[:status].present?
|
157
|
+
fail _("Status must be one of: %s" % VERSION_STATUSES.join(', ')) unless VERSION_STATUSES.include?(params[:status])
|
158
|
+
end
|
159
|
+
end
|
140
160
|
end
|
141
161
|
end
|
@@ -3,11 +3,13 @@ module Katello
|
|
3
3
|
class Api::V2::HostsBulkActionsController < Api::V2::ApiController
|
4
4
|
include Concerns::Api::V2::BulkHostsExtensions
|
5
5
|
include Katello::Concerns::Api::V2::ContentOverridesController
|
6
|
+
include Katello::ContentSourceHelper
|
7
|
+
include ::Foreman::Renderer::Scope::Macros::Base
|
6
8
|
|
7
9
|
before_action :find_host_collections, only: [:bulk_add_host_collections, :bulk_remove_host_collections]
|
8
10
|
before_action :find_environment, only: [:environment_content_view]
|
9
11
|
before_action :find_content_view, only: [:environment_content_view]
|
10
|
-
before_action :find_editable_hosts, except: [:destroy_hosts, :resolve_traces]
|
12
|
+
before_action :find_editable_hosts, except: [:destroy_hosts, :resolve_traces, :change_content_source]
|
11
13
|
before_action :find_deletable_hosts, only: [:destroy_hosts]
|
12
14
|
before_action :find_readable_hosts, only: [:applicable_errata, :installable_errata, :available_incremental_updates]
|
13
15
|
before_action :find_errata, only: [:available_incremental_updates]
|
@@ -305,6 +307,33 @@ module Katello
|
|
305
307
|
template: '../../../api/v2/module_streams/name_streams')
|
306
308
|
end
|
307
309
|
|
310
|
+
api :PUT, "/hosts/bulk/change_content_source", N_("Update the content source for specified hosts and generate the reconfiguration script")
|
311
|
+
param :host_ids, Array, required: true, desc: N_("The ids of the hosts to alter. Hosts not managed by Katello are ignored")
|
312
|
+
param :environment_id, :number, required: true, desc: N_("The id of the lifecycle environment")
|
313
|
+
param :content_view_id, :number, required: true, desc: N_("The id of the content view")
|
314
|
+
param :content_source_id, :number, required: true, desc: N_("The id of the content source")
|
315
|
+
def change_content_source
|
316
|
+
hosts = ::Host.where(id: params[:host_ids])
|
317
|
+
throw_resource_not_found(name: 'host', id: params[:host_ids]) unless hosts.any?
|
318
|
+
|
319
|
+
lifecycle_environment = KTEnvironment.readable.find(params[:environment_id])
|
320
|
+
content_view = Katello::ContentView.readable.find(params[:content_view_id])
|
321
|
+
content_source = SmartProxy.authorized(:view_smart_proxies).find(params[:content_source_id])
|
322
|
+
template = prepare_ssl_cert(foreman_server_ca_cert) + configure_subman(content_source)
|
323
|
+
|
324
|
+
hosts.each do |host|
|
325
|
+
next unless host.content_facet
|
326
|
+
|
327
|
+
host.content_facet.lifecycle_environment = lifecycle_environment
|
328
|
+
host.content_facet.content_view = content_view
|
329
|
+
host.content_facet.content_source = content_source
|
330
|
+
|
331
|
+
host.update_candlepin_associations
|
332
|
+
end
|
333
|
+
|
334
|
+
render plain: template
|
335
|
+
end
|
336
|
+
|
308
337
|
private
|
309
338
|
|
310
339
|
def find_errata
|
@@ -134,13 +134,17 @@ module Katello
|
|
134
134
|
|
135
135
|
api :PUT, "/organizations/:id/cdn_configuration", N_("Update the CDN configuration")
|
136
136
|
param :id, String, :desc => N_("ID of the Organization"), :required => true
|
137
|
-
param :
|
138
|
-
param :
|
139
|
-
param :
|
140
|
-
param :
|
141
|
-
param :
|
137
|
+
param :type, String, :desc => N_("CDN configuration type. One of %s.") % CdnConfiguration::TYPES, :required => true
|
138
|
+
param :url, String, :desc => N_("Upstream foreman server to sync CDN content from. Relevant only for 'upstream_server' type.")
|
139
|
+
param :username, String, :desc => N_("Username for authentication. Relevant only for 'upstream_server' type.")
|
140
|
+
param :password, String, :desc => N_("Password for authentication. Relevant only for 'upstream_server' type.")
|
141
|
+
param :upstream_organization_label, String, :desc => N_("Upstream organization to sync CDN content from. Relevant only for 'upstream_server' type.")
|
142
|
+
param :upstream_content_view_label, String, :desc => N_("Upstream Content View Label, default: Default_Organization_View. Relevant only for 'upstream_server' type.")
|
143
|
+
param :upstream_lifecycle_environment_label, String, :desc => N_("Upstream Lifecycle Environment, default: Library. Relevant only for 'upstream_server' type.")
|
144
|
+
param :ssl_ca_credential_id, Integer, :desc => N_("Content Credential to use for SSL CA. Relevant only for 'upstream_server' type.")
|
142
145
|
def cdn_configuration
|
143
|
-
config_keys = [:url, :username, :password, :upstream_organization_label, :ssl_ca_credential_id
|
146
|
+
config_keys = [:url, :username, :password, :upstream_organization_label, :ssl_ca_credential_id, :type,
|
147
|
+
:upstream_lifecycle_environment_label, :upstream_content_view_label]
|
144
148
|
config_params = params.slice(*config_keys).permit!.to_h
|
145
149
|
|
146
150
|
task = sync_task(::Actions::Katello::CdnConfiguration::Update, @organization.cdn_configuration, config_params)
|
@@ -53,9 +53,13 @@ module Katello
|
|
53
53
|
def custom_index_relation(collection)
|
54
54
|
applicable = ::Foreman::Cast.to_bool(params[:packages_restrict_applicable]) || params[:host_id]
|
55
55
|
upgradable = ::Foreman::Cast.to_bool(params[:packages_restrict_upgradable])
|
56
|
+
not_installed = ::Foreman::Cast.to_bool(params[:packages_restrict_not_installed])
|
56
57
|
|
57
58
|
if upgradable
|
58
59
|
collection = collection.installable_for_hosts(@hosts)
|
60
|
+
elsif not_installed && params[:host_id]
|
61
|
+
host = @hosts.first
|
62
|
+
collection = Katello::Rpm.yum_installable_for_host(host)
|
59
63
|
elsif applicable
|
60
64
|
collection = collection.applicable_to_hosts(@hosts)
|
61
65
|
end
|
@@ -50,6 +50,14 @@ module Katello
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
api :POST, "/repositories/bulk/reclaim_space", N_("Reclaim space from On Demand repositories")
|
54
|
+
param :ids, Array, :desc => N_("List of repository ids"), :required => true
|
55
|
+
def reclaim_space_from_repositories
|
56
|
+
task = async_task(::Actions::Pulp3::Repository::ReclaimSpace, @repositories)
|
57
|
+
|
58
|
+
respond_for_async :resource => task
|
59
|
+
end
|
60
|
+
|
53
61
|
private
|
54
62
|
|
55
63
|
def find_repositories
|
@@ -7,7 +7,7 @@ module Katello
|
|
7
7
|
generic_repo_wrap_params << option.name
|
8
8
|
end
|
9
9
|
|
10
|
-
repo_wrap_params = RootRepository.attribute_names.concat([:ignore_global_proxy]) + generic_repo_wrap_params
|
10
|
+
repo_wrap_params = RootRepository.attribute_names.concat([:ignore_global_proxy, :mirror_on_sync]) + generic_repo_wrap_params
|
11
11
|
|
12
12
|
wrap_parameters :repository, :include => repo_wrap_params
|
13
13
|
|
@@ -23,7 +23,7 @@ module Katello
|
|
23
23
|
before_action :find_unauthorized_katello_resource, :only => [:gpg_key_content]
|
24
24
|
before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :sync,
|
25
25
|
:remove_content, :upload_content, :republish,
|
26
|
-
:import_uploads, :verify_checksum]
|
26
|
+
:import_uploads, :verify_checksum, :reclaim_space]
|
27
27
|
before_action :find_content, :only => :remove_content
|
28
28
|
before_action :find_organization_from_repo, :only => [:update]
|
29
29
|
before_action :error_on_rh_product, :only => [:create]
|
@@ -50,10 +50,13 @@ module Katello
|
|
50
50
|
param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP")
|
51
51
|
param :checksum_type, String, :desc => N_("Checksum of the repository, currently 'sha1' & 'sha256' are supported")
|
52
52
|
param :docker_upstream_name, String, :desc => N_("Name of the upstream docker repository")
|
53
|
-
param :docker_tags_whitelist, Array, :desc => N_("Comma-separated list of tags to sync for Container Image repository")
|
54
|
-
param :
|
53
|
+
param :docker_tags_whitelist, Array, :desc => N_("Comma-separated list of tags to sync for Container Image repository (Deprecated)"), :deprecated => true
|
54
|
+
param :include_tags, Array, :desc => N_("Comma-separated list of tags to sync for a container image repository")
|
55
|
+
param :exclude_tags, Array, :desc => N_("Comma-separated list of tags to exclude when syncing a container image repository. Default: any tag ending in \"-source\"")
|
56
|
+
param :download_policy, ["immediate", "on_demand"], :desc => N_("download policy for yum, deb, and docker repos (either 'immediate' or 'on_demand')")
|
55
57
|
param :download_concurrency, :number, :desc => N_("Used to determine download concurrency of the repository in pulp3. Use value less than 20. Defaults to 10")
|
56
|
-
param :mirror_on_sync, :bool, :desc => N_("true if this repository when synced has to be mirrored from the source and stale rpms removed")
|
58
|
+
param :mirror_on_sync, :bool, :desc => N_("true if this repository when synced has to be mirrored from the source and stale rpms removed (Deprecated)")
|
59
|
+
param :mirroring_policy, Katello::RootRepository::MIRRORING_POLICIES, :desc => N_("Policy to set for mirroring content. Must be one of %s.") % RootRepository::MIRRORING_POLICIES
|
57
60
|
param :verify_ssl_on_sync, :bool, :desc => N_("if true, Katello will verify the upstream url's SSL certifcates are signed by a trusted CA")
|
58
61
|
param :upstream_username, String, :desc => N_("Username of the upstream repository user used for authentication")
|
59
62
|
param :upstream_password, String, :desc => N_("Password of the upstream repository user used for authentication")
|
@@ -234,6 +237,10 @@ module Katello
|
|
234
237
|
fail HttpErrors::UnprocessableEntity, msg
|
235
238
|
end
|
236
239
|
|
240
|
+
if !repo_params[:url].nil? && URI(repo_params[:url]).userinfo
|
241
|
+
fail "Do not include the username/password in the URL. Use the username/password settings instead."
|
242
|
+
end
|
243
|
+
|
237
244
|
gpg_key = get_content_credential(repo_params, CONTENT_CREDENTIAL_GPG_KEY_TYPE)
|
238
245
|
ssl_ca_cert = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CA_CERT_TYPE)
|
239
246
|
ssl_client_cert = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CLIENT_CERT_TYPE)
|
@@ -264,7 +271,7 @@ module Katello
|
|
264
271
|
|
265
272
|
api :PUT, "/repositories/:id/republish", N_("Forces a republish of the specified repository, regenerating metadata and symlinks on the filesystem.")
|
266
273
|
param :id, :number, :desc => N_("Repository identifier"), :required => true
|
267
|
-
param :force, :bool, :desc => N_("Force metadata regeneration to proceed. Dangerous when repositories use
|
274
|
+
param :force, :bool, :desc => N_("Force metadata regeneration to proceed. Dangerous when repositories use the 'Complete Mirroring' mirroring policy."), :required => true
|
268
275
|
def republish
|
269
276
|
unless ::Foreman::Cast.to_bool(params[:force])
|
270
277
|
fail HttpErrors::BadRequest, _('Metadata republishing must be forced because it is a dangerous operation.')
|
@@ -317,6 +324,15 @@ module Katello
|
|
317
324
|
raise HttpErrors::BadRequest, e.message
|
318
325
|
end
|
319
326
|
|
327
|
+
api :POST, "/repositories/:id/reclaim_space", N_("Reclaim space from an On Demand repository")
|
328
|
+
param :id, :number, :required => true, :desc => N_("repository ID")
|
329
|
+
def reclaim_space
|
330
|
+
task = async_task(::Actions::Pulp3::Repository::ReclaimSpace, @repository)
|
331
|
+
respond_for_async :resource => task
|
332
|
+
rescue Errors::InvalidActionOptionError => e
|
333
|
+
raise HttpErrors::BadRequest, e.message
|
334
|
+
end
|
335
|
+
|
320
336
|
api :PUT, "/repositories/:id", N_("Update a repository")
|
321
337
|
param :id, :number, :required => true, :desc => N_("repository ID")
|
322
338
|
param :name, String, :required => false
|
@@ -324,6 +340,9 @@ module Katello
|
|
324
340
|
param_group :repo
|
325
341
|
def update
|
326
342
|
repo_params = repository_params
|
343
|
+
if !repo_params[:url].nil? && URI(repo_params[:url]).userinfo
|
344
|
+
fail "Do not include the username/password in the URL. Use the username/password settings instead."
|
345
|
+
end
|
327
346
|
|
328
347
|
if @repository.generic?
|
329
348
|
generic_remote_options = generic_remote_options_hash(repo_params)
|
@@ -421,10 +440,16 @@ module Katello
|
|
421
440
|
end
|
422
441
|
|
423
442
|
begin
|
443
|
+
upload_args = {
|
444
|
+
content_type: params[:content_type],
|
445
|
+
generate_metadata: generate_metadata,
|
446
|
+
sync_capsule: sync_capsule
|
447
|
+
}
|
448
|
+
upload_args.merge!(generic_content_type_import_upload_args)
|
449
|
+
|
424
450
|
respond_for_async(resource: send(
|
425
451
|
async ? :async_task : :sync_task,
|
426
|
-
::Actions::Katello::Repository::ImportUpload, @repository, uploads,
|
427
|
-
generate_metadata: generate_metadata, sync_capsule: sync_capsule, content_type: params[:content_type]))
|
452
|
+
::Actions::Katello::Repository::ImportUpload, @repository, uploads, upload_args))
|
428
453
|
rescue => e
|
429
454
|
raise HttpErrors::BadRequest, e.message
|
430
455
|
end
|
@@ -479,12 +504,12 @@ module Katello
|
|
479
504
|
|
480
505
|
# rubocop:disable Metrics/CyclomaticComplexity
|
481
506
|
def repository_params
|
482
|
-
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password,
|
507
|
+
keys = [:download_policy, :mirror_on_sync, :mirroring_policy, :sync_policy, :arch, :verify_ssl_on_sync, :upstream_password,
|
483
508
|
:upstream_username, :download_concurrency, :upstream_authentication_token,
|
484
509
|
{:os_versions => []}, :deb_releases, :deb_components, :deb_architectures, :description,
|
485
510
|
:http_proxy_policy, :http_proxy_id, :retain_package_versions_count, {:ignorable_content => []}
|
486
511
|
]
|
487
|
-
keys += [{:docker_tags_whitelist => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
|
512
|
+
keys += [{:docker_tags_whitelist => []}, {:include_tags => []}, {:exclude_tags => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
|
488
513
|
keys += [:ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token] if params[:action] == 'create' || @repository&.ansible_collection?
|
489
514
|
keys += [:label, :content_type] if params[:action] == "create"
|
490
515
|
|
@@ -503,7 +528,8 @@ module Katello
|
|
503
528
|
keys += [:url, :gpg_key_id, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :unprotected, :name,
|
504
529
|
:checksum_type]
|
505
530
|
end
|
506
|
-
params.require(:repository).permit(*keys).to_h.with_indifferent_access
|
531
|
+
to_return = params.require(:repository).permit(*keys).to_h.with_indifferent_access
|
532
|
+
handle_mirror_on_sync(to_return)
|
507
533
|
end
|
508
534
|
|
509
535
|
def get_content_credential(repo_params, content_type)
|
@@ -516,15 +542,22 @@ module Katello
|
|
516
542
|
credential_value
|
517
543
|
end
|
518
544
|
|
519
|
-
# rubocop:disable Metrics/PerceivedComplexity
|
545
|
+
# rubocop:disable Metrics/PerceivedComplexity,Metrics/MethodLength
|
520
546
|
def construct_repo_from_params(repo_params) # rubocop:disable Metrics/AbcSize
|
521
547
|
root = @product.add_repo(repo_params.slice(:label, :name, :description, :url, :content_type, :arch, :unprotected,
|
522
548
|
:gpg_key, :ssl_ca_cert, :ssl_client_cert, :ssl_client_key,
|
523
549
|
:checksum_type, :download_policy, :http_proxy_policy).to_h.with_indifferent_access)
|
524
550
|
root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
525
|
-
|
526
|
-
|
551
|
+
if root.docker?
|
552
|
+
if repo_params[:docker_tags_whitelist].present?
|
553
|
+
root.include_tags = repo_params.fetch(:docker_tags_whitelist, [])
|
554
|
+
else
|
555
|
+
root.include_tags = repo_params.fetch(:include_tags, [])
|
556
|
+
end
|
557
|
+
end
|
558
|
+
root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source']) if root.docker?
|
527
559
|
root.verify_ssl_on_sync = ::Foreman::Cast.to_bool(repo_params[:verify_ssl_on_sync]) if repo_params.key?(:verify_ssl_on_sync)
|
560
|
+
root.mirroring_policy = repo_params[:mirroring_policy] || Katello::RootRepository::MIRRORING_POLICY_CONTENT
|
528
561
|
root.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
|
529
562
|
root.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
|
530
563
|
root.upstream_authentication_token = repo_params[:upstream_authentication_token] if repo_params.key?(:upstream_authentication_token)
|
@@ -553,7 +586,20 @@ module Katello
|
|
553
586
|
|
554
587
|
root
|
555
588
|
end
|
556
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
589
|
+
# rubocop:enable Metrics/CyclomaticComplexity,Metrics/MethodLength
|
590
|
+
|
591
|
+
def handle_mirror_on_sync(repo_params)
|
592
|
+
if !repo_params.key?(:mirroring_policy) && repo_params.key?(:mirror_on_sync)
|
593
|
+
::Foreman::Deprecation.api_deprecation_warning("mirror_on_sync is deprecated in favor of mirroring_policy. It will be removed in Katello 4.6.")
|
594
|
+
if ::Foreman::Cast.to_bool(repo_params[:mirror_on_sync])
|
595
|
+
repo_params[:mirroring_policy] = Katello::RootRepository::MIRRORING_POLICY_CONTENT
|
596
|
+
else
|
597
|
+
repo_params[:mirroring_policy] = Katello::RootRepository::MIRRORING_POLICY_ADDITIVE
|
598
|
+
end
|
599
|
+
end
|
600
|
+
repo_params.delete(:mirror_on_sync)
|
601
|
+
repo_params
|
602
|
+
end
|
557
603
|
|
558
604
|
def error_on_rh_product
|
559
605
|
fail HttpErrors::BadRequest, _("Red Hat products cannot be manipulated.") if @product.redhat?
|
@@ -611,16 +657,27 @@ module Katello
|
|
611
657
|
|
612
658
|
def generic_remote_options_hash(repo_params)
|
613
659
|
generic_remote_options = {}
|
614
|
-
|
660
|
+
content_type = @repository&.content_type || repo_params[:content_type]
|
661
|
+
RepositoryTypeManager.generic_remote_options(content_type: content_type).each do |option|
|
615
662
|
generic_remote_options[option.name] = repo_params[option.name]
|
616
663
|
end
|
617
664
|
generic_remote_options
|
618
665
|
end
|
619
666
|
|
667
|
+
def generic_content_type_import_upload_args
|
668
|
+
args = {}
|
669
|
+
@repository.repository_type&.import_attributes&.collect do |import_attribute|
|
670
|
+
if params[import_attribute.api_param]
|
671
|
+
args[import_attribute.api_param] = params[import_attribute.api_param]
|
672
|
+
end
|
673
|
+
end
|
674
|
+
args
|
675
|
+
end
|
676
|
+
|
620
677
|
def check_import_parameters
|
621
678
|
@repository.repository_type&.import_attributes&.each do |import_attribute|
|
622
679
|
if import_attribute.required && params[import_attribute.api_param].blank?
|
623
|
-
fail HttpErrors::UnprocessableEntity, _(
|
680
|
+
fail HttpErrors::UnprocessableEntity, _('%s is required') % import_attribute.api_param
|
624
681
|
end
|
625
682
|
end
|
626
683
|
end
|
@@ -13,6 +13,7 @@ module Katello
|
|
13
13
|
before_action :find_authorized_host, :only => [:index, :auto_complete_search]
|
14
14
|
before_action :find_organization
|
15
15
|
before_action :find_product_content, :except => [:index, :auto_complete_search]
|
16
|
+
before_action :check_airgapped, :only => [:index]
|
16
17
|
|
17
18
|
resource_description do
|
18
19
|
api_version "v2"
|
@@ -209,5 +210,11 @@ module Katello
|
|
209
210
|
params[:host_id] ||= params[:id]
|
210
211
|
end
|
211
212
|
end
|
213
|
+
|
214
|
+
def check_airgapped
|
215
|
+
if @organization.cdn_configuration.airgapped?
|
216
|
+
respond_for_index(:collection => { :error => _("Repositories are not available for enablement while CDN configuration is set to Air-gapped (disconnected).") }, :status => :forbidden)
|
217
|
+
end
|
218
|
+
end
|
212
219
|
end
|
213
220
|
end
|
@@ -28,7 +28,7 @@ module Katello
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def context_urls
|
31
|
-
super.merge(rhsm_url: rhsm_url, pulp_content_url: pulp_content_url)
|
31
|
+
super.merge(rhsm_url: smart_proxy.rhsm_url, pulp_content_url: smart_proxy.pulp_content_url)
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
@@ -43,14 +43,6 @@ module Katello
|
|
43
43
|
proxy
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
47
|
-
def rhsm_url
|
48
|
-
URI(smart_proxy.rhsm_url)
|
49
|
-
end
|
50
|
-
|
51
|
-
def pulp_content_url
|
52
|
-
smart_proxy.setting(SmartProxy::PULP3_FEATURE, 'content_app_url')
|
53
|
-
end
|
54
46
|
end
|
55
47
|
end
|
56
48
|
end
|
@@ -130,6 +130,9 @@ module Katello
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def filter_by_content_view_version(version, collection)
|
133
|
+
if params[:content_type]
|
134
|
+
return collection.where(:id => version.send(controller_name, params[:content_type]))
|
135
|
+
end
|
133
136
|
collection.where(:id => version.send(controller_name))
|
134
137
|
end
|
135
138
|
|