katello 4.3.0.rc4 → 4.4.0.rc2
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/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/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 +10 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +42 -14
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +7 -0
- 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/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/errata_mail.rb +4 -5
- data/app/lib/actions/katello/repository/filtered_index_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +2 -2
- data/app/lib/actions/pulp3/abstract.rb +1 -1
- data/app/lib/actions/pulp3/abstract_async_task.rb +1 -1
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +14 -4
- data/app/lib/actions/pulp3/content_view_version/create_import_history.rb +1 -2
- 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/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/reclaim_space.rb +3 -10
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -0
- 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/util/deduplication_migrator.rb +105 -0
- data/app/lib/katello/util/pulpcore_content_filters.rb +2 -1
- data/app/models/katello/candlepin/repository_mapper.rb +3 -2
- data/app/models/katello/cdn_configuration.rb +38 -6
- data/app/models/katello/concerns/audit_comment_extensions.rb +17 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +34 -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 +2 -1
- 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 +3 -2
- data/app/models/katello/content_view_version_import_history.rb +4 -4
- 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/host_available_module_stream.rb +10 -0
- data/app/models/katello/hostgroup/content_facet.rb +2 -2
- data/app/models/katello/installed_package.rb +1 -0
- data/app/models/katello/product.rb +1 -1
- data/app/models/katello/product_content.rb +2 -2
- data/app/models/katello/repository.rb +13 -12
- data/app/models/katello/root_repository.rb +65 -16
- data/app/models/katello/rpm.rb +8 -2
- data/app/models/setting/content.rb +15 -5
- 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/yum.rb +4 -0
- 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 +19 -11
- 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 +23 -16
- data/app/services/katello/pulp3/repository.rb +31 -10
- 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 +15 -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 +1 -31
- 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/job_templates/remove_packages_by_search_query.erb +19 -0
- data/app/views/foreman/job_templates/update_packages_by_search_query.erb +19 -0
- data/app/views/katello/api/v2/cdn_configurations/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +8 -4
- data/app/views/katello/api/v2/environments/show.json.rabl +9 -0
- data/app/views/katello/api/v2/host_module_streams/base.json.rabl +1 -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 +1 -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/20210119162528_delete_puppet_and_ostree_repos.rb +2 -0
- data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +11 -2
- 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/migrate/20220209205137_expand_sync_timeout_settings.rb +23 -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/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/errata/apply-errata.controller.js +10 -3
- 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/repositories/details/repository-details-info.controller.js +29 -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.controller.js +8 -3
- 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 +29 -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/discovery/discovery.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.routes.js +4 -3
- data/lib/katello/engine.rb +4 -0
- data/lib/katello/permission_creator.rb +1 -1
- data/lib/katello/permissions/host_permissions.rb +3 -1
- data/lib/katello/plugin.rb +9 -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 +4 -6
- 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.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/webpack/__mocks__/foremanReact/{redux/actions/toasts.js → components/ToastsList/index.js} +3 -2
- data/webpack/components/ActionableDetail.js +35 -21
- 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 +44 -86
- data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +3 -3
- data/webpack/components/Errata/index.js +95 -29
- data/webpack/components/ErratumTypeLabel.js +16 -16
- data/webpack/components/MultiSelect/index.js +2 -2
- data/webpack/components/Packages/index.js +1 -1
- data/webpack/components/RoutedTabs/index.js +2 -1
- data/webpack/components/Search/Search.js +5 -2
- data/webpack/components/Search/__tests__/search.test.js +2 -3
- data/webpack/components/Select/Select.js +1 -1
- data/webpack/components/SelectOrg/SelectOrgReducer.js +15 -15
- data/webpack/components/SelectOrg/SetOrganization.js +2 -2
- data/webpack/components/Table/PageControls.js +3 -6
- data/webpack/components/Table/TableHooks.js +47 -7
- data/webpack/components/Table/TableWrapper.js +25 -7
- data/webpack/components/TypeAhead/TypeAhead.js +5 -1
- data/webpack/components/TypeAhead/helpers/commonPropTypes.js +1 -1
- data/webpack/components/TypeAhead/helpers/helpers.js +14 -14
- data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +1 -1
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +4 -1
- data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +2 -1
- data/webpack/components/WithOrganization/withOrganization.js +3 -3
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard.js +1 -1
- 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 +49 -2
- data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesConstants.js +14 -1
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +6 -4
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +1 -0
- 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} +3 -3
- 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/ModuleStreamsTab/ModuleStreamsActions.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsConstants.js +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsSelectors.js +19 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +241 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/__tests__/moduleStreamsTab.test.js +108 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/__tests__/modules.fixtures.json +34 -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 +357 -64
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.scss +3 -7
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +103 -4
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +6 -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 +312 -11
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +2 -2
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +26 -30
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/yumInstallablePackages.fixtures.json +72 -0
- data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +25 -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/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +4 -0
- data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -1
- data/webpack/components/extensions/RegistrationCommands/fields/LifecycleEnvironment.js +1 -1
- data/webpack/components/extensions/about/SystemStatuses.js +1 -1
- data/webpack/components/extensions/about/SystemStatusesReducer.js +10 -10
- data/webpack/components/pf3Table/components/Table.js +4 -5
- data/webpack/components/pf3Table/components/Table.test.js +0 -3
- data/webpack/components/pf3Table/components/TableBody.js +2 -2
- 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 +4 -1
- data/webpack/global_test_setup.js +1 -1
- data/webpack/index.js +7 -0
- data/webpack/redux/OrganizationProducts/OrganizationProductsReducer.js +15 -15
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +43 -43
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +43 -43
- data/webpack/redux/reducers/RedHatRepositories/sets.js +31 -31
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +26 -26
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +19 -19
- 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 +2 -2
- 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 +1 -1
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +3 -2
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignHostsForm.js +2 -2
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +6 -6
- 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 +1 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +22 -28
- data/webpack/scenes/ContentViews/Details/ContentViewDetailReducer.js +8 -8
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +5 -5
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +32 -30
- 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 +3 -0
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/ArtifactsWithNoErrata.js +8 -8
- data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +4 -4
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +6 -6
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +16 -9
- data/webpack/scenes/ContentViews/Details/Filters/CVFilterDetailType.js +46 -46
- data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +17 -17
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +17 -17
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +4 -4
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +2 -2
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +17 -11
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +17 -17
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +2 -3
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +2 -9
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +3 -5
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +2 -10
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +2 -3
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +2 -3
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +1 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +24 -3
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +11 -5
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +28 -28
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +18 -18
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignActivationKeysForm.js +3 -3
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignHostsForm.js +3 -3
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +6 -6
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -35
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +9 -8
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.scss +5 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +39 -40
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +46 -34
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +66 -49
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +5 -5
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +3 -3
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +5 -3
- data/webpack/scenes/ContentViews/Publish/CVPublishFinish.js +2 -2
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +5 -5
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +3 -3
- data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +1 -1
- data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +1 -1
- data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +18 -18
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +10 -10
- data/webpack/scenes/ContentViews/expansions/DetailsExpansion.js +2 -2
- 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/ModuleStreamDetailsReducer.js +18 -18
- 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/ModuleStreamsReducer.js +26 -26
- 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/Organizations/OrganizationReducer.js +8 -8
- 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/components/EnabledRepository/EnabledRepositoryContent.js +4 -4
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +1 -1
- data/webpack/scenes/RedHatRepositories/helpers.js +5 -5
- data/webpack/scenes/RedHatRepositories/index.js +11 -3
- data/webpack/scenes/Settings/SettingsReducer.js +14 -14
- data/webpack/scenes/Settings/Tables/TableReducer.js +23 -23
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +2 -2
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProductContent.js +15 -15
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProducts.js +1 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +34 -34
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +13 -13
- 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/{CdnConfigurationForm.scss → CdnConfigurationTab/CdnConfigurationForm.scss} +0 -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/{__tests__/CdnConfigurationForm.test.js → CdnConfigurationTab/__tests__/UpstreamServerTypeForm.test.js} +46 -17
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/index.js +97 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +11 -6
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +16 -16
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +149 -149
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +41 -41
- 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 +3 -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/Subscriptions/components/SubscriptionsTable/components/Dialogs/DeleteDialog.js +6 -6
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +12 -12
- data/webpack/scenes/Tasks/TaskActions.js +1 -1
- data/webpack/scenes/Tasks/__tests__/__snapshots__/TaskActions.test.js.snap +3 -2
- data/webpack/services/api/testHelpers.js +5 -3
- data/webpack/services/index.js +36 -36
- data/webpack/utils/helpers.js +11 -8
- metadata +98 -60
- 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
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.js +0 -185
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 294ac07f46dd213e4ebbdd13f97d387b39ef2e5859ed6224e354672f4b26f244
|
4
|
+
data.tar.gz: b08b1182252900cc7390ae257b1a9243fcdb26f00d64b1f668cc17faff4f08e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85c64b73f97252bd9f99c28071bddd97aebc83a525a5ec8559f4538180c733eca336e433e4d2f06204e6d57c5333246fc512e155c2396622daa369fd0dc0bbb4
|
7
|
+
data.tar.gz: e5d7904f19cb93eac89ff6e27b6c585e53f9419e925c4c5bedce2b30ac7a1d8df6c3e518574ad86c6607edbacc99a21360df54cef3b3ddfb94c4c38570f945a7
|
@@ -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,
|
@@ -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
|
@@ -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
|
@@ -53,7 +53,16 @@ module Katello
|
|
53
53
|
api :POST, "/repositories/bulk/reclaim_space", N_("Reclaim space from On Demand repositories")
|
54
54
|
param :ids, Array, :desc => N_("List of repository ids"), :required => true
|
55
55
|
def reclaim_space_from_repositories
|
56
|
-
|
56
|
+
if @repositories.empty?
|
57
|
+
fail _("No repositories selected.")
|
58
|
+
end
|
59
|
+
repositories = @repositories.select { |repo| repo.download_policy == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND }
|
60
|
+
if repositories.empty?
|
61
|
+
fail _("Only On Demand repositories may have space reclaimed.")
|
62
|
+
end
|
63
|
+
task = async_task(::Actions::BulkAction,
|
64
|
+
::Actions::Pulp3::Repository::ReclaimSpace,
|
65
|
+
repositories)
|
57
66
|
|
58
67
|
respond_for_async :resource => task
|
59
68
|
end
|
@@ -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
|
|
@@ -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")
|
@@ -268,7 +271,7 @@ module Katello
|
|
268
271
|
|
269
272
|
api :PUT, "/repositories/:id/republish", N_("Forces a republish of the specified repository, regenerating metadata and symlinks on the filesystem.")
|
270
273
|
param :id, :number, :desc => N_("Repository identifier"), :required => true
|
271
|
-
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
|
272
275
|
def republish
|
273
276
|
unless ::Foreman::Cast.to_bool(params[:force])
|
274
277
|
fail HttpErrors::BadRequest, _('Metadata republishing must be forced because it is a dangerous operation.')
|
@@ -324,6 +327,9 @@ module Katello
|
|
324
327
|
api :POST, "/repositories/:id/reclaim_space", N_("Reclaim space from an On Demand repository")
|
325
328
|
param :id, :number, :required => true, :desc => N_("repository ID")
|
326
329
|
def reclaim_space
|
330
|
+
if @repository.download_policy != ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
|
331
|
+
fail HttpErrors::BadRequest, _("Only On Demand repositories may have space reclaimed.")
|
332
|
+
end
|
327
333
|
task = async_task(::Actions::Pulp3::Repository::ReclaimSpace, @repository)
|
328
334
|
respond_for_async :resource => task
|
329
335
|
rescue Errors::InvalidActionOptionError => e
|
@@ -501,12 +507,12 @@ module Katello
|
|
501
507
|
|
502
508
|
# rubocop:disable Metrics/CyclomaticComplexity
|
503
509
|
def repository_params
|
504
|
-
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password,
|
510
|
+
keys = [:download_policy, :mirror_on_sync, :mirroring_policy, :sync_policy, :arch, :verify_ssl_on_sync, :upstream_password,
|
505
511
|
:upstream_username, :download_concurrency, :upstream_authentication_token,
|
506
512
|
{:os_versions => []}, :deb_releases, :deb_components, :deb_architectures, :description,
|
507
513
|
:http_proxy_policy, :http_proxy_id, :retain_package_versions_count, {:ignorable_content => []}
|
508
514
|
]
|
509
|
-
keys += [{:docker_tags_whitelist => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
|
515
|
+
keys += [{:docker_tags_whitelist => []}, {:include_tags => []}, {:exclude_tags => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
|
510
516
|
keys += [:ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token] if params[:action] == 'create' || @repository&.ansible_collection?
|
511
517
|
keys += [:label, :content_type] if params[:action] == "create"
|
512
518
|
|
@@ -525,7 +531,8 @@ module Katello
|
|
525
531
|
keys += [:url, :gpg_key_id, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :unprotected, :name,
|
526
532
|
:checksum_type]
|
527
533
|
end
|
528
|
-
params.require(:repository).permit(*keys).to_h.with_indifferent_access
|
534
|
+
to_return = params.require(:repository).permit(*keys).to_h.with_indifferent_access
|
535
|
+
handle_mirror_on_sync(to_return)
|
529
536
|
end
|
530
537
|
|
531
538
|
def get_content_credential(repo_params, content_type)
|
@@ -538,15 +545,22 @@ module Katello
|
|
538
545
|
credential_value
|
539
546
|
end
|
540
547
|
|
541
|
-
# rubocop:disable Metrics/PerceivedComplexity
|
548
|
+
# rubocop:disable Metrics/PerceivedComplexity,Metrics/MethodLength
|
542
549
|
def construct_repo_from_params(repo_params) # rubocop:disable Metrics/AbcSize
|
543
550
|
root = @product.add_repo(repo_params.slice(:label, :name, :description, :url, :content_type, :arch, :unprotected,
|
544
551
|
:gpg_key, :ssl_ca_cert, :ssl_client_cert, :ssl_client_key,
|
545
552
|
:checksum_type, :download_policy, :http_proxy_policy).to_h.with_indifferent_access)
|
546
553
|
root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
547
|
-
|
548
|
-
|
554
|
+
if root.docker?
|
555
|
+
if repo_params[:docker_tags_whitelist].present?
|
556
|
+
root.include_tags = repo_params.fetch(:docker_tags_whitelist, [])
|
557
|
+
else
|
558
|
+
root.include_tags = repo_params.fetch(:include_tags, [])
|
559
|
+
end
|
560
|
+
end
|
561
|
+
root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source']) if root.docker?
|
549
562
|
root.verify_ssl_on_sync = ::Foreman::Cast.to_bool(repo_params[:verify_ssl_on_sync]) if repo_params.key?(:verify_ssl_on_sync)
|
563
|
+
root.mirroring_policy = repo_params[:mirroring_policy] || Katello::RootRepository::MIRRORING_POLICY_CONTENT
|
550
564
|
root.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
|
551
565
|
root.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
|
552
566
|
root.upstream_authentication_token = repo_params[:upstream_authentication_token] if repo_params.key?(:upstream_authentication_token)
|
@@ -575,7 +589,20 @@ module Katello
|
|
575
589
|
|
576
590
|
root
|
577
591
|
end
|
578
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
592
|
+
# rubocop:enable Metrics/CyclomaticComplexity,Metrics/MethodLength
|
593
|
+
|
594
|
+
def handle_mirror_on_sync(repo_params)
|
595
|
+
if !repo_params.key?(:mirroring_policy) && repo_params.key?(:mirror_on_sync)
|
596
|
+
::Foreman::Deprecation.api_deprecation_warning("mirror_on_sync is deprecated in favor of mirroring_policy. It will be removed in Katello 4.6.")
|
597
|
+
if ::Foreman::Cast.to_bool(repo_params[:mirror_on_sync])
|
598
|
+
repo_params[:mirroring_policy] = Katello::RootRepository::MIRRORING_POLICY_CONTENT
|
599
|
+
else
|
600
|
+
repo_params[:mirroring_policy] = Katello::RootRepository::MIRRORING_POLICY_ADDITIVE
|
601
|
+
end
|
602
|
+
end
|
603
|
+
repo_params.delete(:mirror_on_sync)
|
604
|
+
repo_params
|
605
|
+
end
|
579
606
|
|
580
607
|
def error_on_rh_product
|
581
608
|
fail HttpErrors::BadRequest, _("Red Hat products cannot be manipulated.") if @product.redhat?
|
@@ -633,7 +660,8 @@ module Katello
|
|
633
660
|
|
634
661
|
def generic_remote_options_hash(repo_params)
|
635
662
|
generic_remote_options = {}
|
636
|
-
|
663
|
+
content_type = @repository&.content_type || repo_params[:content_type]
|
664
|
+
RepositoryTypeManager.generic_remote_options(content_type: content_type).each do |option|
|
637
665
|
generic_remote_options[option.name] = repo_params[option.name]
|
638
666
|
end
|
639
667
|
generic_remote_options
|
@@ -652,7 +680,7 @@ module Katello
|
|
652
680
|
def check_import_parameters
|
653
681
|
@repository.repository_type&.import_attributes&.each do |import_attribute|
|
654
682
|
if import_attribute.required && params[import_attribute.api_param].blank?
|
655
|
-
fail HttpErrors::UnprocessableEntity, _(
|
683
|
+
fail HttpErrors::UnprocessableEntity, _('%s is required') % import_attribute.api_param
|
656
684
|
end
|
657
685
|
end
|
658
686
|
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
|
@@ -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
|
|
@@ -9,6 +9,8 @@ module Katello
|
|
9
9
|
case params[:action]
|
10
10
|
when 'content_hosts'
|
11
11
|
'view'
|
12
|
+
when 'change_content_source'
|
13
|
+
'edit'
|
12
14
|
else
|
13
15
|
super
|
14
16
|
end
|
@@ -68,6 +70,36 @@ module Katello
|
|
68
70
|
end
|
69
71
|
end
|
70
72
|
end
|
73
|
+
|
74
|
+
def change_content_source_data
|
75
|
+
hosts = ::Host.where(id: params[:host_ids])
|
76
|
+
content_hosts_ids = []
|
77
|
+
hosts_without_content = []
|
78
|
+
|
79
|
+
hosts.each do |host|
|
80
|
+
if host.content_facet
|
81
|
+
content_hosts_ids << host.id
|
82
|
+
else
|
83
|
+
hosts_without_content << host.name
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
environments = KTEnvironment.readable.where(organization: Organization.current).includes([:organization, :env_priors, :priors]).order(:name)
|
88
|
+
content_sources = SmartProxy.authorized(:view_smart_proxies).with_content.includes([:smart_proxy_features])
|
89
|
+
|
90
|
+
if Katello.with_remote_execution?
|
91
|
+
template_id = JobTemplate.find_by(name: 'Change content source')&.id
|
92
|
+
job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts_ids) if template_id
|
93
|
+
end
|
94
|
+
|
95
|
+
render json: {
|
96
|
+
content_hosts_ids: content_hosts_ids,
|
97
|
+
hosts_without_content: hosts_without_content,
|
98
|
+
environments: environments,
|
99
|
+
content_sources: content_sources,
|
100
|
+
job_invocation_path: job_invocation_path
|
101
|
+
}
|
102
|
+
end
|
71
103
|
end
|
72
104
|
end
|
73
105
|
end
|
@@ -47,11 +47,12 @@ module Katello
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def inputs
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
case feature_name
|
51
|
+
when 'katello_errata_install'
|
52
|
+
{ :errata => errata_inputs }
|
53
|
+
when 'katello_service_restart'
|
53
54
|
{ :helper => params[:name] }
|
54
|
-
|
55
|
+
when 'katello_module_stream_action'
|
55
56
|
fail HttpErrors::NotFound, _('module streams not found') if params[:module_spec].blank?
|
56
57
|
fail HttpErrors::NotFound, _('actions not found') if params[:module_stream_action].blank?
|
57
58
|
inputs = { :module_spec => params[:module_spec], :action => params[:module_stream_action] }
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Types
|
2
|
+
class HostCollection < BaseObject
|
3
|
+
description "A collection of hosts"
|
4
|
+
model_class ::Katello::HostCollection
|
5
|
+
|
6
|
+
global_id_field :id
|
7
|
+
timestamps
|
8
|
+
field :name, String
|
9
|
+
field :description, String
|
10
|
+
field :max_hosts, Integer
|
11
|
+
field :unlimited_hosts, Boolean
|
12
|
+
has_many :hosts, Types::Host
|
13
|
+
|
14
|
+
def self.graphql_definition
|
15
|
+
super.tap { |type| type.instance_variable_set(:@name, 'Katello::HostCollection') }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Katello
|
2
|
+
module ContentSourceHelper
|
3
|
+
def missing_content_source(host)
|
4
|
+
<<~CMD
|
5
|
+
echo "Host [#{host.name}] doesn't have an assigned content source!"
|
6
|
+
exit 1
|
7
|
+
CMD
|
8
|
+
end
|
9
|
+
|
10
|
+
def prepare_ssl_cert(ca_cert)
|
11
|
+
<<~CMD
|
12
|
+
# Prepare SSL certificate
|
13
|
+
|
14
|
+
KATELLO_SERVER_CA_CERT=/etc/rhsm/ca/katello-server-ca.pem
|
15
|
+
SSL_CA_CERT=$(mktemp)
|
16
|
+
cat << EOF > $SSL_CA_CERT
|
17
|
+
#{ca_cert}
|
18
|
+
EOF
|
19
|
+
|
20
|
+
mkdir -p /etc/rhsm/ca
|
21
|
+
cp -f $SSL_CA_CERT $KATELLO_SERVER_CA_CERT
|
22
|
+
chmod 644 $KATELLO_SERVER_CA_CERT
|
23
|
+
|
24
|
+
CMD
|
25
|
+
end
|
26
|
+
|
27
|
+
def configure_subman(content_source)
|
28
|
+
<<~CMD
|
29
|
+
# Configure subscription-manager
|
30
|
+
RHSM_CFG=/etc/rhsm/rhsm.conf
|
31
|
+
|
32
|
+
test -f $RHSM_CFG.bak || cp $RHSM_CFG $RHSM_CFG.bak
|
33
|
+
|
34
|
+
subscription-manager config \
|
35
|
+
--server.hostname="#{content_source.rhsm_url.host}" \
|
36
|
+
--server.port="#{content_source.rhsm_url.port}" \
|
37
|
+
--server.prefix="#{content_source.rhsm_url.path}" \
|
38
|
+
--rhsm.repo_ca_cert="$KATELLO_SERVER_CA_CERT" \
|
39
|
+
--rhsm.baseurl="#{content_source.pulp_content_url}"
|
40
|
+
CMD
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|