katello 4.2.1 → 4.3.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/katello.common.js +0 -67
- data/app/assets/javascripts/katello/common/katello.js +0 -27
- data/app/assets/javascripts/katello/common/vendor.js +0 -1
- data/app/assets/stylesheets/katello/katello.scss +0 -1
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +10 -2
- data/app/controllers/katello/api/v2/api_controller.rb +35 -9
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +16 -2
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +22 -1
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +65 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +5 -1
- data/app/controllers/katello/api/v2/content_views_controller.rb +13 -6
- data/app/controllers/katello/api/v2/debs_controller.rb +74 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +13 -10
- data/app/controllers/katello/api/v2/file_units_controller.rb +1 -0
- data/app/controllers/katello/api/v2/generic_content_units_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_errata_controller.rb +46 -5
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +2 -1
- data/app/controllers/katello/api/v2/module_streams_controller.rb +4 -0
- data/app/controllers/katello/api/v2/organizations_controller.rb +22 -7
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +36 -19
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +0 -8
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +5 -1
- data/app/controllers/katello/concerns/api/v2/bulk_extensions.rb +40 -0
- data/app/controllers/katello/concerns/api/v2/host_errata_extensions.rb +4 -31
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb +2 -6
- data/app/helpers/katello/katello_url_helper.rb +1 -1
- data/app/lib/actions/candlepin/abstract_async_task.rb +6 -3
- data/app/lib/actions/candlepin/async_hypervisors.rb +12 -8
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +10 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -3
- data/app/lib/actions/katello/cdn_configuration/update.rb +38 -0
- data/app/lib/actions/katello/content_view/remove.rb +18 -7
- data/app/lib/actions/katello/content_view_version/destroy.rb +2 -2
- data/app/lib/actions/katello/content_view_version/republish_repositories.rb +1 -1
- data/app/lib/actions/katello/repository/clone_contents.rb +1 -2
- data/app/lib/actions/katello/repository/destroy.rb +21 -5
- data/app/lib/actions/katello/repository/fetch_pxe_files.rb +1 -1
- data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
- data/app/lib/actions/katello/repository/import_upload.rb +1 -1
- data/app/lib/actions/katello/repository/index_content.rb +19 -6
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -0
- data/app/lib/actions/katello/repository/multi_clone_contents.rb +1 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +3 -7
- data/app/lib/actions/katello/repository_set/scan_cdn.rb +0 -4
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +1 -1
- data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +1 -1
- data/app/lib/actions/pulp/repository/clear.rb +1 -1
- data/app/lib/actions/pulp3/abstract_async_task.rb +10 -1
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +13 -18
- data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +1 -11
- data/app/lib/actions/pulp3/content_view_version/create_export_history.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +25 -42
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +8 -1
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +3 -3
- data/app/lib/actions/pulp3/repository/commit_upload.rb +1 -1
- data/app/lib/actions/pulp3/repository/import_upload.rb +8 -4
- data/app/lib/actions/pulp3/repository/multi_copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/multi_copy_units.rb +1 -1
- data/app/lib/actions/pulp3/repository/presenters/abstract_sync_presenter.rb +18 -0
- data/app/lib/actions/pulp3/repository/presenters/content_unit_presenter.rb +7 -2
- data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +6 -1
- data/app/lib/actions/pulp3/repository/save_artifact.rb +14 -4
- data/app/lib/katello/errors.rb +2 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +0 -20
- data/app/lib/katello/resources/candlepin/proxy.rb +8 -2
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +2 -0
- data/app/lib/katello/resources/cdn/katello_cdn.rb +68 -0
- data/app/lib/katello/resources/cdn.rb +61 -29
- data/app/lib/katello/util/cdn_var_substitutor.rb +15 -9
- data/app/lib/katello/util/package.rb +22 -0
- data/app/lib/katello/util/path_with_substitutions.rb +12 -14
- data/app/models/katello/activation_key.rb +10 -0
- data/app/models/katello/ansible_collection.rb +1 -1
- data/app/models/katello/authorization/repository.rb +4 -4
- data/app/models/katello/candlepin/repository_mapper.rb +5 -1
- data/app/models/katello/cdn_configuration.rb +32 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +40 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +28 -2
- data/app/models/katello/concerns/hostgroup_extensions.rb +1 -1
- data/app/models/katello/concerns/organization_extensions.rb +3 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +15 -5
- data/app/models/katello/concerns/remote_execution_provider_extensions.rb +9 -0
- data/app/models/katello/concerns/setting_extensions.rb +1 -1
- data/app/models/katello/concerns/smart_proxy_extensions.rb +4 -3
- data/app/models/katello/content_credential.rb +4 -0
- data/app/models/katello/content_facet_applicable_deb.rb +7 -0
- data/app/models/katello/content_view.rb +24 -1
- data/app/models/katello/content_view_component.rb +4 -0
- data/app/models/katello/content_view_erratum_filter.rb +2 -0
- data/app/models/katello/content_view_filter.rb +1 -1
- data/app/models/katello/content_view_package_filter_rule.rb +2 -1
- data/app/models/katello/content_view_version.rb +30 -1
- data/app/models/katello/deb.rb +71 -0
- data/app/models/katello/erratum.rb +13 -1
- data/app/models/katello/generic_content_unit.rb +3 -1
- data/app/models/katello/glue/pulp/repos.rb +2 -2
- data/app/models/katello/host/content_facet.rb +23 -2
- data/app/models/katello/host/subscription_facet.rb +1 -1
- data/app/models/katello/host_tracer.rb +21 -2
- data/app/models/katello/installed_deb.rb +1 -1
- data/app/models/katello/module_stream.rb +4 -0
- data/app/models/katello/ping.rb +20 -4
- data/app/models/katello/product.rb +7 -5
- data/app/models/katello/provider.rb +1 -24
- data/app/models/katello/repository.rb +37 -10
- data/app/models/katello/root_repository.rb +28 -14
- data/app/models/setting/content.rb +8 -13
- data/app/services/katello/applicability/applicable_content_helper.rb +20 -0
- data/app/services/katello/organization_creator.rb +8 -0
- data/app/services/katello/pulp3/api/ansible_collection.rb +0 -40
- data/app/services/katello/pulp3/api/apt.rb +0 -47
- data/app/services/katello/pulp3/api/content_guard.rb +1 -1
- data/app/services/katello/pulp3/api/core.rb +28 -23
- data/app/services/katello/pulp3/api/docker.rb +0 -50
- data/app/services/katello/pulp3/api/file.rb +0 -48
- data/app/services/katello/pulp3/api/generic.rb +1 -44
- data/app/services/katello/pulp3/api/yum.rb +4 -44
- data/app/services/katello/pulp3/generic_content_unit.rb +8 -4
- data/app/services/katello/pulp3/repository/ansible_collection.rb +4 -0
- data/app/services/katello/pulp3/repository/apt.rb +3 -3
- data/app/services/katello/pulp3/repository/generic.rb +10 -65
- data/app/services/katello/pulp3/repository/yum.rb +10 -0
- data/app/services/katello/pulp3/repository.rb +47 -21
- data/app/services/katello/pulp3/repository_mirror.rb +30 -11
- data/app/services/katello/pulp3/rpm.rb +2 -32
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +7 -8
- data/app/services/katello/pulp3/smart_proxy_repository.rb +1 -1
- data/app/services/katello/registration_manager.rb +2 -0
- data/app/services/katello/repository_type.rb +103 -15
- data/app/services/katello/repository_type_manager.rb +14 -8
- data/app/services/katello/ui_notifications/subscriptions/manifest_expired_warning.rb +1 -1
- data/app/services/katello/upstream_connection_checker.rb +1 -0
- data/app/views/foreman/job_templates/resolve_traces.erb +25 -0
- data/app/views/foreman/job_templates/resolve_traces_-_katello_ansible_default.erb +28 -0
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -1
- data/app/views/katello/api/v2/common/_metadata.json.rabl +1 -0
- data/app/views/katello/api/v2/content_facet/base.json.rabl +3 -1
- data/app/views/katello/api/v2/content_facet/show.json.rabl +2 -1
- data/app/views/katello/api/v2/content_view_components/show.json.rabl +4 -0
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +7 -0
- data/app/views/katello/api/v2/content_views/base.json.rabl +12 -8
- data/app/views/katello/api/v2/content_views/index.json.rabl +1 -0
- data/app/views/katello/api/v2/content_views/permissions.rabl +8 -0
- data/app/views/katello/api/v2/debs/base.json.rabl +5 -0
- data/app/views/katello/api/v2/errata/index.json.rabl +4 -0
- data/app/views/katello/api/v2/generic_content_units/base.json.rabl +2 -0
- data/app/views/katello/api/v2/generic_content_units/show.json.rabl +7 -0
- data/app/views/katello/api/v2/host_tracer/base.json.rabl +1 -0
- data/app/views/katello/api/v2/module_streams/index.json.rabl +4 -0
- data/app/views/katello/api/v2/organizations/cdn_configuration.rabl +1 -0
- data/app/views/katello/api/v2/organizations/show.json.rabl +7 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +10 -17
- data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +2 -6
- data/config/routes/api/v2.rb +13 -0
- data/config/routes/overrides.rb +2 -0
- data/config/routes.rb +14 -2
- data/db/migrate/20140110000001_update_environments_add_katello_id.rb +1 -3
- data/db/migrate/20140610154745_content_view_puppet_environment_id.rb +0 -35
- data/db/migrate/20190802112101_add_applicable_debs.rb +16 -0
- data/db/migrate/20210201163238_migrate_background_download_policy_to_migrate.rb +2 -2
- data/db/migrate/20210909140337_add_last_indexed_to_repos.rb +5 -0
- data/db/migrate/20210910190324_move_background_settings_to_immediate.rb +25 -0
- data/db/migrate/20211006161617_add_filename_to_katello_generic_content_units.rb +5 -0
- data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +30 -0
- data/db/migrate/20211025181315_add_additional_metadata_to_katello_generic_content_units.rb +5 -0
- data/engines/bastion/README.md +15 -0
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +2 -2
- data/engines/bastion/config/routes.rb +2 -0
- data/engines/bastion/vendor/assets/javascripts/bastion/angular/angular.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-sanitize/angular-sanitize.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/registration.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-applicable.controller.js +44 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-debs-applicable.html +70 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-debs.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +25 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.controller.js +22 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.routes.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb.controller.js +22 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +36 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/views/debs.html +31 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/generic-content/generic-content.factory.js +21 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/generic-content/generic-content.module.js +17 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +30 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +1 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +32 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +15 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +32 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +28 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-generic-content.html +57 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +46 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +57 -27
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +16 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +30 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
- data/lib/katello/engine.rb +0 -1
- data/lib/katello/permission_creator.rb +4 -3
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/permissions/organization_permissions.rb +2 -1
- data/lib/katello/plugin.rb +15 -11
- data/lib/katello/repository_types/ansible_collection.rb +13 -1
- data/lib/katello/repository_types/deb.rb +13 -0
- data/lib/katello/repository_types/docker.rb +13 -1
- data/lib/katello/repository_types/file.rb +13 -0
- data/lib/katello/repository_types/ostree.rb +48 -4
- data/lib/katello/repository_types/python.rb +26 -12
- data/lib/katello/repository_types/yum.rb +16 -1
- data/lib/katello/tasks/repository.rake +3 -12
- data/lib/katello/tasks/reset.rake +4 -5
- data/lib/katello/version.rb +1 -1
- data/package.json +3 -2
- data/webpack/__mocks__/react-intl/index.js +4 -0
- data/webpack/components/ActionableDetail.js +23 -3
- data/webpack/components/AddedStatusLabel.js +1 -1
- data/webpack/components/Bookmark/AddBookmarkModal.js +96 -0
- data/webpack/components/Bookmark/Bookmark.scss +28 -0
- data/webpack/components/Bookmark/BookmarkActions.js +24 -0
- data/webpack/components/Bookmark/BookmarkConstants.js +3 -0
- data/webpack/components/Bookmark/BookmarkSelectors.js +15 -0
- data/webpack/components/Bookmark/index.js +94 -0
- data/webpack/components/EditableSwitch.js +6 -1
- data/webpack/components/EditableTextInput/EditableTextInput.js +41 -13
- data/webpack/components/Errata/index.js +69 -0
- data/webpack/components/ErratumTypeLabel.js +31 -0
- data/webpack/components/Loading.js +5 -2
- data/webpack/components/RoutedTabs/__tests__/RoutedTabs.test.js +5 -11
- data/webpack/components/RoutedTabs/index.js +77 -2
- data/webpack/components/Search/Search.js +67 -80
- data/webpack/components/Search/__tests__/search.test.js +8 -26
- data/webpack/components/SelectAllCheckbox/SelectAllCheckbox.scss +3 -0
- data/webpack/components/SelectAllCheckbox/index.js +126 -0
- data/webpack/components/SelectableDropdown/SelectableDropdown.js +7 -2
- data/webpack/components/Table/EmptyStateMessage.js +38 -17
- data/webpack/components/Table/MainTable.js +49 -10
- data/webpack/components/Table/MainTable.scss +11 -0
- data/webpack/components/Table/PageControls.js +45 -0
- data/webpack/components/Table/TableHooks.js +230 -0
- data/webpack/components/Table/TableWrapper.js +221 -50
- data/webpack/components/Table/helpers.js +17 -0
- data/webpack/components/TypeAhead/TypeAhead.js +74 -58
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +25 -10
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +9 -8
- data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +2 -2
- data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +32 -22
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard.js +101 -0
- data/webpack/components/extensions/HostDetails/Cards/__tests__/contentViewDetailsCard.test.js +53 -0
- data/webpack/components/extensions/HostDetails/HostErrata/HostErrataActions.js +47 -0
- data/webpack/components/extensions/HostDetails/HostErrata/HostErrataConstants.js +32 -0
- data/webpack/components/extensions/HostDetails/HostErrata/HostErrataSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/EmptyPage.js +19 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +17 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +7 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/helpers.js +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/index.js +40 -0
- data/webpack/components/extensions/HostDetails/Tabs/EnableTracerEmptyState.js +42 -0
- data/webpack/components/extensions/HostDetails/Tabs/EnableTracerModal.js +118 -0
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.js +347 -0
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.scss +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/ErratumExpansionContents.js +60 -0
- data/webpack/components/extensions/HostDetails/Tabs/ErratumExpansionDetail.js +69 -0
- data/webpack/components/extensions/HostDetails/Tabs/HostTracesActions.js +19 -0
- data/webpack/components/extensions/HostDetails/Tabs/HostTracesConstants.js +2 -0
- data/webpack/components/extensions/HostDetails/Tabs/HostTracesSelectors.js +19 -0
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +56 -0
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +5 -0
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab.js +188 -0
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab.scss +12 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errata.fixtures.json +67 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +785 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/resolveTraces.fixtures.json +35 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracerEmptyTraceResults.fixtures.json +7 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracerEnableJobInvocation.fixtures.json +35 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/traces.fixtures.json +44 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +386 -0
- data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +20 -0
- data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -1
- data/webpack/components/extensions/RegistrationCommands/index.js +1 -1
- data/webpack/components/pf3Table/components/Table.js +1 -1
- data/webpack/components/pf3Table/components/__snapshots__/Table.test.js.snap +3 -3
- data/webpack/containers/Application/Routes.js +3 -3
- data/webpack/containers/Application/config.js +21 -6
- data/webpack/containers/Application/overrides.scss +34 -3
- data/webpack/{fills_index.js → global_index.js} +11 -2
- data/webpack/global_test_setup.js +6 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +4 -4
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +1 -1
- data/webpack/scenes/Content/ContentActions.js +31 -0
- data/webpack/scenes/Content/ContentConfig.js +138 -0
- data/webpack/scenes/Content/ContentConstants.js +7 -0
- data/webpack/scenes/Content/ContentPage.js +89 -0
- data/webpack/scenes/Content/ContentSelectors.js +43 -0
- data/webpack/scenes/Content/Details/ContentCounts.js +42 -0
- data/webpack/scenes/Content/Details/ContentDetails.js +66 -0
- data/webpack/scenes/Content/Details/ContentInfo.js +60 -0
- data/webpack/scenes/Content/Details/ContentRepositories.js +78 -0
- data/webpack/scenes/Content/Details/__tests__/ansibleCollectionDetails.fixtures.json +20 -0
- data/webpack/scenes/Content/Details/__tests__/ansibleCollectionRepositoryDetails.fixtures.json +71 -0
- data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +152 -0
- data/webpack/scenes/Content/Details/__tests__/pythonPackageDetails.fixtures.json +20 -0
- data/webpack/scenes/Content/Details/__tests__/pythonPackageRepositoryDetails.fixtures.json +71 -0
- data/webpack/scenes/Content/Details/index.js +4 -0
- data/webpack/scenes/Content/Table/ContentTable.js +90 -0
- data/webpack/scenes/Content/Table/index.js +3 -0
- data/webpack/scenes/Content/__tests__/ansibleCollections.fixtures.json +50 -0
- data/webpack/scenes/Content/__tests__/contentTable.test.js +89 -0
- data/webpack/scenes/Content/__tests__/contentTypes.fixtures.json +66 -0
- data/webpack/scenes/Content/__tests__/pythonPackages.fixtures.json +30 -0
- data/webpack/scenes/Content/index.js +4 -0
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +5 -6
- data/webpack/scenes/ContentViews/ContentViewsActions.js +13 -8
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +31 -4
- data/webpack/scenes/ContentViews/ContentViewsPage.js +4 -0
- data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +19 -7
- data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +7 -5
- data/webpack/scenes/ContentViews/Copy/__tests__/copyContentView.test.js +1 -1
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +7 -3
- data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +1 -2
- data/webpack/scenes/ContentViews/Delete/CVDeleteContext.js +4 -0
- data/webpack/scenes/ContentViews/Delete/ContentViewDeleteWizard.js +170 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeleteEnvironmentsSelection.js +108 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionFinish.js +69 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignActivationKeysForm.js +121 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignHostsForm.js +120 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js +62 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVEnvironmentSelectionForm.scss +4 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/CvData.fixtures.json +259 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +155 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +241 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/cvDetails.fixtures.json +248 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/cvVersionsData.fixtures.json +865 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/envPathData.fixtures.json +424 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +15 -7
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +123 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +1 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +8 -5
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +109 -51
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +21 -6
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +80 -16
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +248 -3
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +141 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +36 -54
- data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +20 -4
- data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +63 -38
- data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterAdd.test.js +3 -4
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositorySelection.js +65 -0
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +260 -0
- data/webpack/scenes/ContentViews/Details/Filters/ArtifactsWithNoErrata.js +54 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +202 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +291 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +441 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVFilterDetailType.js +62 -3
- data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +302 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +186 -23
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +144 -19
- data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +2 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +44 -13
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +81 -17
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +43 -43
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +96 -0
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContent.fixtures.json +166 -0
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +90 -0
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +33 -0
- data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +91 -0
- data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +237 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.fixtures.json +42 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +265 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +218 -11
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +517 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/allFilterErrata.fixtures.json +122 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/allFilterModulesStreams.fixtures.json +60 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewErrataByDateDetails.fixtures.json +359 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +88 -102
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +34 -9
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.fixtures.json +148 -132
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +25 -7
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvAllRepos.fixtures.json +150 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataDateFilterContent.test.js +74 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +404 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErratumFilterDetails.fixtures.json +89 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailModuleAffectedRepos.fixtures.json +383 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailWithAffectedRepos.fixtures.json +375 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterFixutre.fixture.json +282 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +392 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilterDetails.fixtures.json +97 -0
- data/webpack/scenes/ContentViews/Details/Filters/index.js +26 -0
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +68 -79
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -2
- data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +163 -0
- data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromoteSelectors.js +16 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +9 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +88 -74
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +8 -9
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +3 -3
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +30 -9
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +9 -5
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +2 -2
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +132 -14
- data/webpack/scenes/ContentViews/Details/Versions/Delete/DeleteContext.js +4 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveCVVersionWizard.js +176 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +127 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignActivationKeysForm.js +131 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignHostsForm.js +128 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionDeleteFinish.js +94 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js +67 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedActivationKeys.fixture.json +53 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +153 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvDropDownOptionsResponse.fixture.json +192 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +313 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemoveResponse.fixture.json +74 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/versionRemoveEnvPaths.fixtures.json +352 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/versionsResponseData.fixtures.json +583 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +96 -0
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +97 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +332 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +128 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.scss +44 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +66 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +125 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +115 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionAnsibleCollections.fixtures.json +449 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionComponent.fixtures.json +753 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDebPackages.fixtures.json +58 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.fixtures.json +158 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +289 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsCounts.fixtures.json +73 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js +44 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDockerTags.fixtures.json +3024 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionErrata.fixtures.json +201 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionFiles.fixtures.json +22 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionModuleStreams.fixtures.json +196 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRepositories.fixtures.json +1000 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRpmPackageGroups.fixtures.json +44 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRpmPackages.fixtures.json +394 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +4 -4
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +95 -26
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +2 -2
- data/webpack/scenes/ContentViews/Details/Versions/index.js +25 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +20 -16
- data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +3 -5
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +106 -64
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +25 -4
- data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +1 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +4 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +29 -36
- data/webpack/scenes/ContentViews/__tests__/mockDetails.fixtures.json +10 -0
- data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +117 -0
- data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +59 -0
- data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +4 -3
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +30 -11
- data/webpack/scenes/ContentViews/components/TaskPresenter/TaskPresenter.js +1 -1
- data/webpack/scenes/ContentViews/expansions/DetailsExpansion.js +38 -1
- data/webpack/scenes/ContentViews/expansions/RelatedCompositeContentViewsModal.js +79 -0
- data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +107 -0
- data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +59 -0
- data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsResponse.fixtures.json +116 -0
- data/webpack/scenes/ContentViews/expansions/__tests__/relatedCompositeCvs.fixtures.json +4 -0
- data/webpack/scenes/ContentViews/helpers.js +1 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +4 -3
- data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +17 -9
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +3 -3
- data/webpack/test-utils/nockWrapper.js +20 -3
- data/webpack/utils/helpers.js +16 -2
- data/webpack/utils/useDebounce.js +20 -0
- metadata +232 -54
- data/app/assets/javascripts/katello/widgets/tabs.js +0 -13
- data/app/assets/stylesheets/katello/widgets/tabs.scss +0 -69
- data/app/lib/actions/katello/provider/update.rb +0 -38
- data/webpack/components/RoutedTabs/RoutedTabs.js +0 -90
- data/webpack/components/Search/Search.test.js +0 -23
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +0 -21
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab.js +0 -42
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +0 -145
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionPackages.js +0 -0
@@ -20,6 +20,9 @@ module Katello
|
|
20
20
|
has_many :content_facet_repositories, :class_name => "Katello::ContentFacetRepository", :dependent => :destroy, :inverse_of => :content_facet
|
21
21
|
has_many :bound_repositories, :through => :content_facet_repositories, :class_name => "Katello::Repository", :source => :repository
|
22
22
|
|
23
|
+
has_many :content_facet_applicable_debs, :class_name => "Katello::ContentFacetApplicableDeb", :dependent => :delete_all, :inverse_of => :content_facet
|
24
|
+
has_many :applicable_debs, :through => :content_facet_applicable_debs, :class_name => "Katello::Deb", :source => :deb
|
25
|
+
|
23
26
|
has_many :content_facet_applicable_rpms, :class_name => "Katello::ContentFacetApplicableRpm", :dependent => :delete_all, :inverse_of => :content_facet
|
24
27
|
has_many :applicable_rpms, :through => :content_facet_applicable_rpms, :class_name => "Katello::Rpm", :source => :rpm
|
25
28
|
|
@@ -65,6 +68,10 @@ module Katello
|
|
65
68
|
Erratum.installable_for_content_facet(self, env, content_view)
|
66
69
|
end
|
67
70
|
|
71
|
+
def installable_debs(env = nil, content_view = nil)
|
72
|
+
Deb.installable_for_content_facet(self, env, content_view)
|
73
|
+
end
|
74
|
+
|
68
75
|
def installable_rpms(env = nil, content_view = nil)
|
69
76
|
Rpm.installable_for_content_facet(self, env, content_view)
|
70
77
|
end
|
@@ -95,6 +102,7 @@ module Katello
|
|
95
102
|
repo.library_instance_id.nil? ? repo.id : repo.library_instance_id
|
96
103
|
end
|
97
104
|
|
105
|
+
::Katello::Applicability::ApplicableContentHelper.new(self, ::Katello::Deb, bound_repos).calculate_and_import
|
98
106
|
::Katello::Applicability::ApplicableContentHelper.new(self, ::Katello::Rpm, bound_repos).calculate_and_import
|
99
107
|
::Katello::Applicability::ApplicableContentHelper.new(self, ::Katello::Erratum, bound_repos).calculate_and_import
|
100
108
|
::Katello::Applicability::ApplicableContentHelper.new(self, ::Katello::ModuleStream, bound_repos).calculate_and_import
|
@@ -105,6 +113,7 @@ module Katello
|
|
105
113
|
def import_applicability(partial = false)
|
106
114
|
import_module_stream_applicability(partial)
|
107
115
|
import_errata_applicability(partial)
|
116
|
+
import_deb_applicability(partial)
|
108
117
|
import_rpm_applicability(partial)
|
109
118
|
update_applicability_counts
|
110
119
|
end
|
@@ -114,6 +123,8 @@ module Katello
|
|
114
123
|
:installable_security_errata_count => self.installable_errata.security.count,
|
115
124
|
:installable_bugfix_errata_count => self.installable_errata.bugfix.count,
|
116
125
|
:installable_enhancement_errata_count => self.installable_errata.enhancement.count,
|
126
|
+
:applicable_deb_count => self.content_facet_applicable_debs.count,
|
127
|
+
:upgradable_deb_count => self.installable_debs.count,
|
117
128
|
:applicable_rpm_count => self.content_facet_applicable_rpms.count,
|
118
129
|
:upgradable_rpm_count => self.installable_rpms.count,
|
119
130
|
:applicable_module_stream_count => self.content_facet_applicable_module_streams.count,
|
@@ -122,6 +133,10 @@ module Katello
|
|
122
133
|
self.save!(:validate => false)
|
123
134
|
end
|
124
135
|
|
136
|
+
def import_deb_applicability(partial)
|
137
|
+
ApplicableContentHelper.new(Deb, self).import(partial)
|
138
|
+
end
|
139
|
+
|
125
140
|
def import_rpm_applicability(partial)
|
126
141
|
ApplicableContentHelper.new(Rpm, self).import(partial)
|
127
142
|
end
|
@@ -180,6 +195,10 @@ module Katello
|
|
180
195
|
joins_installable_relation(Katello::Erratum, Katello::ContentFacetErratum)
|
181
196
|
end
|
182
197
|
|
198
|
+
def self.joins_installable_debs
|
199
|
+
joins_installable_relation(Katello::Deb, Katello::ContentFacetApplicableDeb)
|
200
|
+
end
|
201
|
+
|
183
202
|
def self.joins_installable_rpms
|
184
203
|
joins_installable_relation(Katello::Rpm, Katello::ContentFacetApplicableRpm)
|
185
204
|
end
|
@@ -243,6 +262,8 @@ module Katello
|
|
243
262
|
property :uuid, String, desc: 'Returns UUID of the facet'
|
244
263
|
property :applicable_module_stream_count, Integer, desc: 'Returns applicable Module Stream count'
|
245
264
|
property :upgradable_module_stream_count, Integer, desc: 'Returns upgradable Module Stream count'
|
265
|
+
property :applicable_deb_count, Integer, desc: 'Returns applicable DEB count'
|
266
|
+
property :upgradable_deb_count, Integer, desc: 'Returns upgradable DEB count'
|
246
267
|
property :applicable_rpm_count, Integer, desc: 'Returns applicable RPM count'
|
247
268
|
property :upgradable_rpm_count, Integer, desc: 'Returns upgradable RPM count'
|
248
269
|
property :content_source, 'SmartProxy', desc: 'Returns Smart Proxy object as the content source'
|
@@ -254,9 +275,9 @@ module Katello
|
|
254
275
|
prop_group :katello_idname_props, Katello::Model, meta: { resource: 'lifecycle_environment' }
|
255
276
|
end
|
256
277
|
class Jail < ::Safemode::Jail
|
257
|
-
allow :applicable_module_stream_count, :applicable_rpm_count, :content_source, :content_source_id, :content_source_name, :content_view_id,
|
278
|
+
allow :applicable_deb_count, :applicable_module_stream_count, :applicable_rpm_count, :content_source, :content_source_id, :content_source_name, :content_view_id,
|
258
279
|
:content_view_name, :errata_counts, :id, :kickstart_repository, :kickstart_repository_id, :kickstart_repository_name,
|
259
|
-
:lifecycle_environment_id, :lifecycle_environment_name, :upgradable_module_stream_count, :upgradable_rpm_count, :uuid
|
280
|
+
:lifecycle_environment_id, :lifecycle_environment_name, :upgradable_deb_count, :upgradable_module_stream_count, :upgradable_rpm_count, :uuid
|
260
281
|
end
|
261
282
|
end
|
262
283
|
end
|
@@ -57,7 +57,7 @@ module Katello
|
|
57
57
|
self.dmi_uuid = consumer_params['facts']['dmi.system.uuid']
|
58
58
|
end
|
59
59
|
|
60
|
-
self.autoheal = consumer_params['autoheal'] unless consumer_params['autoheal'].
|
60
|
+
self.autoheal = consumer_params['autoheal'] unless consumer_params['autoheal'].nil?
|
61
61
|
self.service_level = consumer_params['serviceLevel'] unless consumer_params['serviceLevel'].nil?
|
62
62
|
self.registered_at = consumer_params['created'] unless consumer_params['created'].blank?
|
63
63
|
self.last_checkin = consumer_params['lastCheckin'] unless consumer_params['lastCheckin'].blank?
|
@@ -10,11 +10,30 @@ module Katello
|
|
10
10
|
validates :app_type, :length => {:maximum => 255}, :presence => true
|
11
11
|
|
12
12
|
scoped_search :on => :application, :complete_value => true
|
13
|
-
scoped_search :on => :app_type
|
14
|
-
scoped_search :on => :helper
|
13
|
+
scoped_search :on => :app_type, :complete_value => true
|
14
|
+
scoped_search :on => :helper, :complete_value => true
|
15
15
|
|
16
16
|
def reboot_required?
|
17
17
|
self.app_type == 'static'
|
18
18
|
end
|
19
|
+
|
20
|
+
def restart_command
|
21
|
+
case self.app_type
|
22
|
+
when 'static'
|
23
|
+
'reboot'
|
24
|
+
when 'session'
|
25
|
+
nil
|
26
|
+
else
|
27
|
+
self.helper
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.helpers_for(traces)
|
32
|
+
if traces.any?(&:reboot_required?)
|
33
|
+
['reboot']
|
34
|
+
else
|
35
|
+
traces.map(&:restart_command).compact.uniq
|
36
|
+
end
|
37
|
+
end
|
19
38
|
end
|
20
39
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Katello
|
2
2
|
class InstalledDeb < Katello::Model
|
3
|
-
has_many :hosts, :through => :host_installed_debs, :class_name => "::Host"
|
4
3
|
has_many :host_installed_debs, :class_name => "Katello::HostInstalledDeb", :dependent => :destroy, :inverse_of => :installed_deb
|
4
|
+
has_many :hosts, :through => :host_installed_debs, :class_name => "::Host"
|
5
5
|
|
6
6
|
scoped_search :on => :name, :complete_value => true
|
7
7
|
scoped_search :on => :version
|
@@ -71,6 +71,10 @@ module Katello
|
|
71
71
|
{:name => name, :stream => stream, :version => version, :context => context, :arch => arch}.compact
|
72
72
|
end
|
73
73
|
|
74
|
+
def content_view_filters
|
75
|
+
Katello::ContentViewModuleStreamFilterRule.where(module_stream_id: self.id).eager_load(:filter).map(&:filter)
|
76
|
+
end
|
77
|
+
|
74
78
|
def self.find_by_host_name(_key, operator, value)
|
75
79
|
conditions = sanitize_sql_for_conditions(["#{::Host::Managed.table_name}.name #{operator} ?", value_to_sql(operator, value)])
|
76
80
|
hosts = ::Host::Managed.authorized("view_hosts").where(conditions).select(:id)
|
data/app/models/katello/ping.rb
CHANGED
@@ -8,7 +8,7 @@ module Katello
|
|
8
8
|
def services(capsule_id = nil)
|
9
9
|
proxy = fetch_proxy(capsule_id)
|
10
10
|
services = [:candlepin, :candlepin_auth, :foreman_tasks, :katello_events, :candlepin_events]
|
11
|
-
services += [:pulp3] if proxy&.pulp3_enabled?
|
11
|
+
services += [:pulp3, :pulp3_content] if proxy&.pulp3_enabled?
|
12
12
|
services += [:katello_agent] if ::Katello.with_katello_agent?
|
13
13
|
if proxy.nil? || proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE) || proxy.has_feature?(SmartProxy::PULP_FEATURE)
|
14
14
|
services += [:pulp, :pulp_auth]
|
@@ -77,6 +77,12 @@ module Katello
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
def ping_pulp3_content_without_auth(service_result, capsule_id)
|
81
|
+
exception_watch(service_result) do
|
82
|
+
Katello::Ping.pulp3_content_without_auth(fetch_proxy(capsule_id).pulp3_url)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
80
86
|
def ping_pulp_without_auth(service_result, capsule_id)
|
81
87
|
exception_watch(service_result) do
|
82
88
|
Katello::Ping.pulp_without_auth(pulp_url(capsule_id))
|
@@ -195,10 +201,17 @@ module Katello
|
|
195
201
|
end
|
196
202
|
|
197
203
|
workers = json["online_workers"] || []
|
204
|
+
fail _("No pulpcore workers are running at %s.") % url if workers.empty?
|
198
205
|
|
199
|
-
|
200
|
-
|
201
|
-
|
206
|
+
json
|
207
|
+
end
|
208
|
+
|
209
|
+
def pulp3_content_without_auth(url)
|
210
|
+
json = backend_status(url, :pulp)
|
211
|
+
fail _("Pulp does not appear to be running at %s.") % url if json.empty?
|
212
|
+
|
213
|
+
content_apps = json["online_content_apps"] || []
|
214
|
+
fail _("No pulpcore content apps are running at %s.") % url if content_apps.empty?
|
202
215
|
|
203
216
|
json
|
204
217
|
end
|
@@ -220,12 +233,14 @@ module Katello
|
|
220
233
|
end
|
221
234
|
end
|
222
235
|
|
236
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
223
237
|
def ping_services_for_capsule(services, capsule_id)
|
224
238
|
services ||= self.services(capsule_id)
|
225
239
|
result = {}
|
226
240
|
services.each { |service| result[service] = {} }
|
227
241
|
|
228
242
|
ping_pulp3_without_auth(result[:pulp3], capsule_id) if result.include?(:pulp3)
|
243
|
+
ping_pulp3_content_without_auth(result[:pulp3_content], capsule_id) if result.include?(:pulp3_content)
|
229
244
|
ping_pulp_without_auth(result[:pulp], capsule_id) if result.include?(:pulp)
|
230
245
|
ping_candlepin_without_auth(result[:candlepin]) if result.include?(:candlepin)
|
231
246
|
|
@@ -241,6 +256,7 @@ module Katello
|
|
241
256
|
result[:status] = result[:services].each_value.any? { |v| v[:status] == FAIL_RETURN_CODE } ? FAIL_RETURN_CODE : OK_RETURN_CODE
|
242
257
|
result
|
243
258
|
end
|
259
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
244
260
|
|
245
261
|
def fetch_proxy(capsule_id)
|
246
262
|
capsule_id ? SmartProxy.unscoped.find(capsule_id) : SmartProxy.pulp_primary
|
@@ -106,7 +106,7 @@ module Katello
|
|
106
106
|
!self.provider.redhat_provider? || self.repositories.present?
|
107
107
|
end
|
108
108
|
|
109
|
-
delegate :library, to: :organization
|
109
|
+
delegate :cdn_configuration, :library, to: :organization
|
110
110
|
|
111
111
|
def plan_name
|
112
112
|
return sync_plan.name if sync_plan
|
@@ -214,10 +214,12 @@ module Katello
|
|
214
214
|
end
|
215
215
|
|
216
216
|
def cdn_resource
|
217
|
-
return
|
218
|
-
|
219
|
-
|
220
|
-
|
217
|
+
return if self.certificate.nil?
|
218
|
+
|
219
|
+
@cdn_resource ||= ::Katello::Resources::CDN::CdnResource.create(
|
220
|
+
product: self,
|
221
|
+
cdn_configuration: self.organization.cdn_configuration
|
222
|
+
)
|
221
223
|
end
|
222
224
|
|
223
225
|
def total_package_count(env, view)
|
@@ -21,22 +21,13 @@ module Katello
|
|
21
21
|
validate :constraint_redhat_update
|
22
22
|
validate :only_one_rhn_provider
|
23
23
|
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
24
|
-
validates_with Validators::KatelloUrlFormatValidator, :if => :redhat_provider?,
|
25
|
-
:attributes => [:repository_url]
|
26
24
|
|
27
25
|
before_destroy :prevent_redhat_deletion
|
28
|
-
before_validation :sanitize_repository_url
|
29
26
|
|
30
27
|
scope :redhat, -> { where(:provider_type => REDHAT) }
|
31
28
|
scope :custom, -> { where(:provider_type => CUSTOM) }
|
32
29
|
scope :anonymous, -> { where(:provider_type => ANONYMOUS) }
|
33
30
|
|
34
|
-
def self.create_anonymous!(organization)
|
35
|
-
create!(:name => SecureRandom.uuid, :description => nil,
|
36
|
-
:organization => organization, :provider_type => ANONYMOUS,
|
37
|
-
:repository_url => nil)
|
38
|
-
end
|
39
|
-
|
40
31
|
def only_one_rhn_provider
|
41
32
|
# validate only when new record is added (skip explicit valid? calls)
|
42
33
|
if new_record? && provider_type == REDHAT && count_providers(REDHAT) != 0
|
@@ -56,7 +47,7 @@ module Katello
|
|
56
47
|
|
57
48
|
def constraint_redhat_update
|
58
49
|
if !new_record? && redhat_provider?
|
59
|
-
allowed_changes = %w(
|
50
|
+
allowed_changes = %w(task_status_id)
|
60
51
|
not_allowed_changes = changes.keys - allowed_changes
|
61
52
|
unless not_allowed_changes.empty?
|
62
53
|
errors.add(:base, _("the following attributes can not be updated for the Red Hat provider: [ %s ]") % not_allowed_changes.join(", "))
|
@@ -117,19 +108,5 @@ module Katello
|
|
117
108
|
def related_resources
|
118
109
|
self.organization
|
119
110
|
end
|
120
|
-
|
121
|
-
protected
|
122
|
-
|
123
|
-
def sanitize_repository_url
|
124
|
-
sanitize_url(:repository_url, SETTINGS[:katello][:redhat_repository_url])
|
125
|
-
end
|
126
|
-
|
127
|
-
def sanitize_url(attrib, default_value)
|
128
|
-
if redhat_provider? && self.send(attrib).blank?
|
129
|
-
self.send("#{attrib}=", default_value)
|
130
|
-
end
|
131
|
-
|
132
|
-
self.send(attrib)&.strip!
|
133
|
-
end
|
134
111
|
end
|
135
112
|
end
|
@@ -123,9 +123,9 @@ module Katello
|
|
123
123
|
before_validation :set_container_repository_name, :if => :docker?
|
124
124
|
|
125
125
|
scope :has_url, -> { joins(:root).where.not("#{RootRepository.table_name}.url" => nil) }
|
126
|
-
scope :on_demand, -> { joins(:root).where("#{RootRepository.table_name}.download_policy" => ::
|
127
|
-
scope :immediate, -> { joins(:root).where("#{RootRepository.table_name}.download_policy" => ::
|
128
|
-
scope :non_immediate, -> { joins(:root).where.not("#{RootRepository.table_name}.download_policy" => ::
|
126
|
+
scope :on_demand, -> { joins(:root).where("#{RootRepository.table_name}.download_policy" => ::Katello::RootRepository::DOWNLOAD_ON_DEMAND) }
|
127
|
+
scope :immediate, -> { joins(:root).where("#{RootRepository.table_name}.download_policy" => ::Katello::RootRepository::DOWNLOAD_IMMEDIATE) }
|
128
|
+
scope :non_immediate, -> { joins(:root).where.not("#{RootRepository.table_name}.download_policy" => ::Katello::RootRepository::DOWNLOAD_IMMEDIATE) }
|
129
129
|
scope :in_default_view, -> { joins(:content_view_version => :content_view).where("#{Katello::ContentView.table_name}.default" => true) }
|
130
130
|
scope :in_non_default_view, -> { joins(:content_view_version => :content_view).where("#{Katello::ContentView.table_name}.default" => false) }
|
131
131
|
scope :deb_type, -> { with_type(DEB_TYPE) }
|
@@ -148,6 +148,7 @@ module Katello
|
|
148
148
|
end
|
149
149
|
scope :redhat, -> { joins(:product => :provider).where("#{Provider.table_name}.provider_type": Provider::REDHAT) }
|
150
150
|
scope :custom, -> { joins(:product => :provider).where.not("#{Provider.table_name}.provider_type": Provider::REDHAT) }
|
151
|
+
scope :library, -> { where(library_instance_id: nil) }
|
151
152
|
|
152
153
|
scoped_search :on => :name, :relation => :root, :complete_value => true
|
153
154
|
scoped_search :rename => :product, :on => :name, :relation => :product, :complete_value => true
|
@@ -190,6 +191,10 @@ module Katello
|
|
190
191
|
joins(:root).where("#{RootRepository.table_name}.content_type" => content_type)
|
191
192
|
end
|
192
193
|
|
194
|
+
def self.for_products(products)
|
195
|
+
joins(:root).where("#{Katello::RootRepository.table_name}.product_id" => products)
|
196
|
+
end
|
197
|
+
|
193
198
|
def to_label
|
194
199
|
name
|
195
200
|
end
|
@@ -289,6 +294,10 @@ module Katello
|
|
289
294
|
::Katello::Resources::CDN::CdnResource.ca_file if ::Katello::Resources::CDN::CdnResource.redhat_cdn?(url)
|
290
295
|
end
|
291
296
|
|
297
|
+
def using_mirrored_metadata?
|
298
|
+
self.yum? && self.library_instance? && self.mirror_on_sync
|
299
|
+
end
|
300
|
+
|
292
301
|
def archive?
|
293
302
|
self.environment.nil?
|
294
303
|
end
|
@@ -298,11 +307,11 @@ module Katello
|
|
298
307
|
end
|
299
308
|
|
300
309
|
def on_demand?
|
301
|
-
root.download_policy ==
|
310
|
+
root.download_policy == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
|
302
311
|
end
|
303
312
|
|
304
313
|
def immediate?
|
305
|
-
root.download_policy == ::
|
314
|
+
root.download_policy == ::Katello::RootRepository::DOWNLOAD_ON_IMMEDIATE
|
306
315
|
end
|
307
316
|
|
308
317
|
def yum_gpg_key_url
|
@@ -316,6 +325,26 @@ module Katello
|
|
316
325
|
redhat? ? "redhat" : "custom"
|
317
326
|
end
|
318
327
|
|
328
|
+
def content_counts
|
329
|
+
content_counts = {}
|
330
|
+
RepositoryTypeManager.defined_repository_types[content_type].content_types_to_index.each do |content_type|
|
331
|
+
if content_type&.model_class::CONTENT_TYPE == DockerTag::CONTENT_TYPE
|
332
|
+
content_counts[DockerTag::CONTENT_TYPE] = docker_tags.count
|
333
|
+
elsif content_type&.model_class::CONTENT_TYPE == GenericContentUnit::CONTENT_TYPE
|
334
|
+
content_counts[content_type.content_type] = content_type&.model_class&.in_repositories(self)&.where(:content_type => content_type.content_type)&.count
|
335
|
+
else
|
336
|
+
content_counts[content_type.label] = content_type&.model_class&.in_repositories(self)&.count
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
content_counts['module_stream'] = content_counts.delete('modulemd') if content_counts.key?('modulemd')
|
341
|
+
content_counts
|
342
|
+
end
|
343
|
+
|
344
|
+
def published_in_versions
|
345
|
+
Katello::ContentViewVersion.with_repositories(self.library_instances_inverse).distinct
|
346
|
+
end
|
347
|
+
|
319
348
|
def self.errata_with_package_counts(repo)
|
320
349
|
repository_rpm = Katello::RepositoryRpm.table_name
|
321
350
|
repository_errata = Katello::RepositoryErratum.table_name
|
@@ -411,8 +440,6 @@ module Katello
|
|
411
440
|
scheme = force_http ? 'http' : 'https'
|
412
441
|
if docker?
|
413
442
|
"#{pulp_uri.host.downcase}/#{container_repository_name}"
|
414
|
-
elsif ostree?
|
415
|
-
"#{scheme}://#{pulp_uri.host.downcase}/pulp/content/web/#{relative_path}"
|
416
443
|
elsif ansible_collection?
|
417
444
|
"#{scheme}://#{pulp_uri.host.downcase}/pulp_ansible/galaxy/#{relative_path}/api/"
|
418
445
|
else
|
@@ -728,13 +755,13 @@ module Katello
|
|
728
755
|
end
|
729
756
|
|
730
757
|
# deleteable? is already taken by the authorization mixin
|
731
|
-
def destroyable?
|
758
|
+
def destroyable?(remove_from_content_view_versions = false)
|
732
759
|
if self.environment.try(:library?) && self.content_view.default?
|
733
760
|
if self.environment.organization.being_deleted?
|
734
761
|
return true
|
735
|
-
elsif self.custom? && self.deletable?
|
762
|
+
elsif self.custom? && self.deletable?(remove_from_content_view_versions)
|
736
763
|
return true
|
737
|
-
elsif !self.custom? && self.redhat_deletable?
|
764
|
+
elsif !self.custom? && self.redhat_deletable?(remove_from_content_view_versions)
|
738
765
|
return true
|
739
766
|
else
|
740
767
|
errors.add(:base, _("Repository cannot be deleted since it has already been included in a published Content View. " \
|
@@ -11,6 +11,10 @@ module Katello
|
|
11
11
|
|
12
12
|
encrypts :upstream_password, :upstream_authentication_token
|
13
13
|
|
14
|
+
DOWNLOAD_IMMEDIATE = 'immediate'.freeze
|
15
|
+
DOWNLOAD_ON_DEMAND = 'on_demand'.freeze
|
16
|
+
DOWNLOAD_POLICIES = [DOWNLOAD_IMMEDIATE, DOWNLOAD_ON_DEMAND].freeze
|
17
|
+
|
14
18
|
IGNORABLE_CONTENT_UNIT_TYPES = %w(srpm).freeze
|
15
19
|
CHECKSUM_TYPES = %w(sha1 sha256).freeze
|
16
20
|
|
@@ -24,7 +28,7 @@ module Katello
|
|
24
28
|
CONTENT_ATTRIBUTE_RESTRICTIONS = {
|
25
29
|
:ostree_upstream_sync_depth => [Repository::OSTREE_TYPE],
|
26
30
|
:ostree_upstream_sync_policy => [Repository::OSTREE_TYPE],
|
27
|
-
:download_policy => [Repository::YUM_TYPE]
|
31
|
+
:download_policy => [Repository::YUM_TYPE, Repository::DEB_TYPE]
|
28
32
|
|
29
33
|
}.freeze
|
30
34
|
|
@@ -42,6 +46,8 @@ module Katello
|
|
42
46
|
ALLOWED_OS_VERSIONS = [RHEL6, RHEL7, RHEL8].freeze
|
43
47
|
|
44
48
|
belongs_to :product, :inverse_of => :root_repositories, :class_name => "Katello::Product"
|
49
|
+
has_one :provider, :through => :product
|
50
|
+
|
45
51
|
belongs_to :gpg_key, :inverse_of => :root_repositories, :class_name => "Katello::ContentCredential"
|
46
52
|
belongs_to :ssl_ca_cert, :class_name => "Katello::ContentCredential", :inverse_of => :ssl_ca_root_repos
|
47
53
|
belongs_to :ssl_client_cert, :class_name => "Katello::ContentCredential", :inverse_of => :ssl_client_root_repos
|
@@ -66,7 +72,6 @@ module Katello
|
|
66
72
|
|
67
73
|
validate :ensure_valid_docker_attributes, :if => :docker?
|
68
74
|
validate :ensure_docker_repo_unprotected, :if => :docker?
|
69
|
-
validate :ensure_ostree_repo_protected, :if => :ostree?
|
70
75
|
validate :ensure_compatible_download_policy, :if => :yum?
|
71
76
|
validate :ensure_valid_collection_attributes, :if => :ansible_collection?
|
72
77
|
validate :ensure_valid_auth_url_token, :if => :ansible_collection?
|
@@ -76,6 +81,7 @@ module Katello
|
|
76
81
|
validate :ensure_content_attribute_restrictions
|
77
82
|
validate :ensure_valid_upstream_authorization
|
78
83
|
validate :ensure_valid_authentication_token, :if => :yum?
|
84
|
+
validate :ensure_valid_deb_constraints, :if => :deb?
|
79
85
|
validate :ensure_no_checksum_on_demand
|
80
86
|
validates :url, presence: true, if: :ostree?
|
81
87
|
validates :checksum_type, :inclusion => {:in => CHECKSUM_TYPES}, :allow_blank => true
|
@@ -89,8 +95,8 @@ module Katello
|
|
89
95
|
:message => ->(_, _) { _("is not enabled. must be one of the following: %s") % Katello::RepositoryTypeManager.enabled_repository_types.keys.join(', ') }
|
90
96
|
}
|
91
97
|
validates :download_policy, inclusion: {
|
92
|
-
:in =>
|
93
|
-
:message => _("must be one of the following: %s") %
|
98
|
+
:in => DOWNLOAD_POLICIES,
|
99
|
+
:message => _("must be one of the following: %s") % DOWNLOAD_POLICIES.join(', ')
|
94
100
|
}, if: :yum?
|
95
101
|
validates :http_proxy_policy, inclusion: {
|
96
102
|
:in => HTTP_PROXY_POLICIES,
|
@@ -113,7 +119,9 @@ module Katello
|
|
113
119
|
where(:http_proxy_id => http_proxy_id)
|
114
120
|
}
|
115
121
|
scope :orphaned, -> { where.not(id: Katello::Repository.pluck(:root_id).uniq) }
|
122
|
+
scope :redhat, -> { joins(:provider).merge(Katello::Provider.redhat) }
|
116
123
|
delegate :redhat?, :provider, :organization, to: :product
|
124
|
+
delegate :cdn_configuration, to: :organization
|
117
125
|
|
118
126
|
def library_instance
|
119
127
|
repositories.in_default_view.first
|
@@ -145,7 +153,7 @@ module Katello
|
|
145
153
|
|
146
154
|
def ensure_compatible_download_policy
|
147
155
|
if !url.blank? && URI(url).scheme == 'file' &&
|
148
|
-
|
156
|
+
download_policy == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
|
149
157
|
errors.add(:download_policy, _("Cannot sync file:// repositories with the On Demand Download Policy"))
|
150
158
|
end
|
151
159
|
end
|
@@ -175,17 +183,11 @@ module Katello
|
|
175
183
|
end
|
176
184
|
|
177
185
|
def ensure_no_checksum_on_demand
|
178
|
-
if checksum_type.present? &&
|
186
|
+
if checksum_type.present? && download_policy == DOWNLOAD_ON_DEMAND
|
179
187
|
errors.add(:checksum_type, _("Checksum type cannot be set for yum repositories with on demand download policy."))
|
180
188
|
end
|
181
189
|
end
|
182
190
|
|
183
|
-
def ensure_ostree_repo_protected
|
184
|
-
if unprotected
|
185
|
-
errors.add(:base, _("OSTree Repositories cannot be unprotected."))
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
191
|
def ensure_valid_collection_attributes
|
190
192
|
errors.add(:base, _("URL needs to have a trailing /")) if !url.blank? && url[-1] != '/'
|
191
193
|
return unless ansible_collection_requirements
|
@@ -271,6 +273,9 @@ module Katello
|
|
271
273
|
if self.upstream_username.blank? && self.upstream_password.blank?
|
272
274
|
self.upstream_username = nil
|
273
275
|
self.upstream_password = nil
|
276
|
+
if !self.url.blank? && self.url.start_with?('uln') && !self.content
|
277
|
+
errors.add(:base, N_("Upstream username and upstream password cannot be blank for ULN repositories"))
|
278
|
+
end
|
274
279
|
return
|
275
280
|
end
|
276
281
|
|
@@ -301,6 +306,15 @@ module Katello
|
|
301
306
|
end
|
302
307
|
end
|
303
308
|
|
309
|
+
def ensure_valid_deb_constraints
|
310
|
+
return if self.deb_releases.blank? && self.url.blank?
|
311
|
+
if self.deb_releases.blank?
|
312
|
+
errors.add(:base, N_("When \"Upstream URL\" is set, \"Releases/Distributions\" must also be set!"))
|
313
|
+
elsif self.url.blank? && !self.content
|
314
|
+
errors.add(:base, N_("When \"Releases/Distributions\" is set, \"Upstream URL\" must also be set!"))
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
304
318
|
def custom_content_path
|
305
319
|
parts = []
|
306
320
|
# We generate repo path only for custom product content. We add this
|
@@ -353,7 +367,7 @@ module Katello
|
|
353
367
|
end
|
354
368
|
|
355
369
|
def on_demand?
|
356
|
-
self.download_policy ==
|
370
|
+
self.download_policy == DOWNLOAD_ON_DEMAND
|
357
371
|
end
|
358
372
|
|
359
373
|
def pulp_update_needed?
|
@@ -371,7 +385,7 @@ module Katello
|
|
371
385
|
end
|
372
386
|
|
373
387
|
def repo_mapper
|
374
|
-
Katello::Candlepin::RepositoryMapper.new(self.product, self.content, self.substitutions)
|
388
|
+
@repo_mapper ||= Katello::Candlepin::RepositoryMapper.new(self.product, self.content, self.substitutions)
|
375
389
|
end
|
376
390
|
|
377
391
|
def calculate_updated_name
|
@@ -9,15 +9,10 @@ class Setting::Content < Setting
|
|
9
9
|
Hash[parameters.map { |p| [p, p] }]
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.deprecate_background(policies_hash)
|
13
|
-
policies_hash['background'] = 'background (deprecated)'
|
14
|
-
policies_hash
|
15
|
-
end
|
16
|
-
|
17
12
|
def self.default_settings
|
18
|
-
download_policies = proc {
|
13
|
+
download_policies = proc { hashify_parameters(::Katello::RootRepository::DOWNLOAD_POLICIES) }
|
19
14
|
|
20
|
-
proxy_download_policies = proc {
|
15
|
+
proxy_download_policies = proc { hashify_parameters(::SmartProxy::DOWNLOAD_POLICIES) }
|
21
16
|
dependency_solving_options = proc { hashify_parameters(['conservative', 'greedy']) }
|
22
17
|
cdn_ssl_versions = proc { hashify_parameters(Katello::Resources::CDN::SUPPORTED_SSL_VERSIONS) }
|
23
18
|
http_proxy_select = [{
|
@@ -85,7 +80,7 @@ class Setting::Content < Setting
|
|
85
80
|
false, N_('Disconnected mode')),
|
86
81
|
self.set('errata_status_installable', N_("Calculate errata host status based only on errata in a Host's Content View and Lifecycle Environment"),
|
87
82
|
false, N_('Installable errata from Content View')),
|
88
|
-
self.set('restrict_composite_view', N_("If
|
83
|
+
self.set('restrict_composite_view', N_("If this is enabled, a composite content view may not be published or "\
|
89
84
|
"promoted, unless the component content view versions that it includes exist in the target environment."),
|
90
85
|
false, N_('Restrict Composite Content View promotion')),
|
91
86
|
self.set('check_services_before_actions', N_("Whether or not to check the status of backend services such as pulp and candlepin prior to performing some actions."),
|
@@ -94,11 +89,11 @@ class Setting::Content < Setting
|
|
94
89
|
100, N_('Batch size to sync repositories in.')),
|
95
90
|
self.set('foreman_proxy_content_auto_sync', N_("Whether or not to auto sync the Smart Proxies after a Content View promotion."),
|
96
91
|
true, N_('Sync Smart Proxies after Content View promotion')),
|
97
|
-
self.set('default_download_policy', N_("Default download policy for custom repositories (either 'immediate'
|
92
|
+
self.set('default_download_policy', N_("Default download policy for custom repositories (either 'immediate' or 'on_demand')"), "immediate",
|
98
93
|
N_('Default Custom Repository download policy'), nil, :collection => download_policies),
|
99
|
-
self.set('default_redhat_download_policy', N_("Default download policy for enabled Red Hat repositories (either 'immediate'
|
94
|
+
self.set('default_redhat_download_policy', N_("Default download policy for enabled Red Hat repositories (either 'immediate' or 'on_demand')"), "on_demand",
|
100
95
|
N_('Default Red Hat Repository download policy'), nil, :collection => download_policies),
|
101
|
-
self.set('default_proxy_download_policy', N_("Default download policy for Smart Proxy syncs (either 'inherit', immediate',
|
96
|
+
self.set('default_proxy_download_policy', N_("Default download policy for Smart Proxy syncs (either 'inherit', immediate', or 'on_demand')"), "on_demand",
|
102
97
|
N_('Default Smart Proxy download policy'), nil, :collection => proxy_download_policies),
|
103
98
|
self.set('pulp_docker_registry_port', N_("The port used by Pulp Crane to provide Docker Registries"),
|
104
99
|
5000, N_('Pulp Docker registry port')),
|
@@ -112,14 +107,14 @@ class Setting::Content < Setting
|
|
112
107
|
"/etc/pki/katello/certs/pulp-client.crt", N_('Pulp client cert')),
|
113
108
|
self.set('sync_connect_timeout', N_("Total timeout in seconds for connections when syncing"),
|
114
109
|
300, N_('Sync Connection Timeout')),
|
115
|
-
self.set('remote_execution_by_default', N_("If
|
110
|
+
self.set('remote_execution_by_default', N_("If this is enabled, remote execution is used instead of katello-agent for remote actions"),
|
116
111
|
false, N_('Use remote execution by default')),
|
117
112
|
self.set('unregister_delete_host', N_("When unregistering a host via subscription-manager, also delete the host record. Managed resources linked to host " \
|
118
113
|
"such as virtual machines and DNS records may also be deleted."),
|
119
114
|
false, N_('Delete Host upon unregister')),
|
120
115
|
self.set('register_hostname_fact', N_("When registering a host via subscription-manager, force use the specified fact (in the form of 'fact.fact')"),
|
121
116
|
'', N_('Subscription manager name registration fact'), nil),
|
122
|
-
self.set('register_hostname_fact_strict_match', N_('If
|
117
|
+
self.set('register_hostname_fact_strict_match', N_('If this is enabled, and register_hostname_fact is set and provided, registration will look for a new host by name only '\
|
123
118
|
'using that fact, and will skip all hostname matching'), false, N_('Subscription manager name registration fact strict matching'), nil),
|
124
119
|
self.set('default_location_subscribed_hosts',
|
125
120
|
N_('Default Location where new subscribed hosts will put upon registration'),
|
@@ -22,6 +22,8 @@ module Katello
|
|
22
22
|
def fetch_content_ids
|
23
23
|
if self.content_unit_class == ::Katello::Erratum
|
24
24
|
fetch_errata_content_ids
|
25
|
+
elsif self.content_unit_class == ::Katello::Deb
|
26
|
+
fetch_deb_content_ids
|
25
27
|
elsif self.content_unit_class == ::Katello::ModuleStream
|
26
28
|
fetch_module_stream_content_ids
|
27
29
|
else
|
@@ -59,6 +61,24 @@ module Katello
|
|
59
61
|
return Katello::ModuleStream.find_by_sql([query, { content_facet_id: content_facet.id, repo_ids: self.bound_library_instance_repos }]).map(&:id)
|
60
62
|
end
|
61
63
|
|
64
|
+
def fetch_deb_content_ids
|
65
|
+
repo_deb = ::Katello::RepositoryDeb.arel_table
|
66
|
+
deb = ::Katello::Deb.arel_table
|
67
|
+
installed_deb = Katello::InstalledDeb.arel_table
|
68
|
+
host_installed_deb = Katello::HostInstalledDeb.arel_table
|
69
|
+
deb_version_compare = Arel::Nodes::NamedFunction.new('deb_version_cmp', [deb[:version], installed_deb[:version]]).gt(0)
|
70
|
+
|
71
|
+
content = deb.join(repo_deb).on(repo_deb[:deb_id].eq(deb[:id]))
|
72
|
+
.join(installed_deb).on(installed_deb[:name].eq(deb[:name]))
|
73
|
+
.join(host_installed_deb).on(host_installed_deb[:installed_deb_id].eq(installed_deb[:id]))
|
74
|
+
.where(deb_version_compare)
|
75
|
+
.where(host_installed_deb[:host_id].eq(self.content_facet.host.id))
|
76
|
+
.distinct
|
77
|
+
.project(deb[Arel.star])
|
78
|
+
|
79
|
+
::Katello::Deb.find_by_sql(content.to_sql).pluck(:id)
|
80
|
+
end
|
81
|
+
|
62
82
|
def fetch_rpm_content_ids
|
63
83
|
enabled_module_stream_ids = fetch_enabled_module_stream_ids
|
64
84
|
|
@@ -36,6 +36,7 @@ module Katello
|
|
36
36
|
create_content_view_environment
|
37
37
|
create_anonymous_provider
|
38
38
|
create_redhat_provider
|
39
|
+
create_cdn_configuration
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
@@ -116,5 +117,12 @@ module Katello
|
|
116
117
|
organization: @organization
|
117
118
|
).first_or_create!
|
118
119
|
end
|
120
|
+
|
121
|
+
def create_cdn_configuration
|
122
|
+
@cdn_configuration = Katello::CdnConfiguration.where(
|
123
|
+
organization: @organization,
|
124
|
+
url: ::Katello::Resources::CDN::CdnResource.redhat_cdn_url
|
125
|
+
).first_or_create!
|
126
|
+
end
|
119
127
|
end
|
120
128
|
end
|