katello 4.18.1 → 4.19.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/locale/bn/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ca/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/cs/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +57 -108
- data/app/assets/javascripts/katello/locale/de/katello.js +58 -109
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/el/katello.js +57 -108
- data/app/assets/javascripts/katello/locale/en/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/en_US/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/es/katello.js +58 -109
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/fr/katello.js +59 -110
- data/app/assets/javascripts/katello/locale/gl/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/gu/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/hi/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/id/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/it/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ja/katello.js +59 -110
- data/app/assets/javascripts/katello/locale/ka/katello.js +58 -109
- data/app/assets/javascripts/katello/locale/kn/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ko/katello.js +59 -110
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/mr/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/or/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/pa/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/pl/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/pt/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +58 -109
- data/app/assets/javascripts/katello/locale/ro/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ru/katello.js +57 -108
- data/app/assets/javascripts/katello/locale/sl/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ta/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/te/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/tr/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/vi/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/zh/katello.js +56 -107
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +59 -110
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +57 -108
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +41 -12
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +3 -65
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_views_controller.rb +18 -3
- data/app/controllers/katello/api/v2/debs_controller.rb +21 -11
- data/app/controllers/katello/api/v2/docker_tags_controller.rb +7 -0
- data/app/controllers/katello/api/v2/flatpak_remote_repositories_controller.rb +21 -19
- data/app/controllers/katello/api/v2/host_debs_controller.rb +16 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -60
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +10 -53
- data/app/controllers/katello/api/v2/repositories_controller.rb +0 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +3 -0
- data/app/lib/actions/candlepin/activation_key/create.rb +0 -2
- data/app/lib/actions/candlepin/activation_key/update.rb +0 -2
- data/app/lib/actions/candlepin/product/content_create.rb +3 -5
- data/app/lib/actions/candlepin/product/content_update.rb +2 -3
- data/app/lib/actions/helpers/rolling_cv_repos.rb +1 -1
- data/app/lib/actions/katello/activation_key/create.rb +0 -1
- data/app/lib/actions/katello/activation_key/update.rb +0 -2
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -6
- data/app/lib/actions/katello/content_credential/update.rb +1 -1
- data/app/lib/actions/katello/content_view/add_rolling_repo_clone.rb +18 -24
- data/app/lib/actions/katello/content_view/create.rb +9 -4
- data/app/lib/actions/katello/content_view/refresh_rolling_repo.rb +6 -1
- data/app/lib/actions/katello/content_view/remove_rolling_repo_clone.rb +16 -11
- data/app/lib/actions/katello/content_view/update.rb +34 -7
- data/app/lib/actions/katello/product/content_create.rb +2 -2
- data/app/lib/actions/katello/product/content_destroy.rb +1 -1
- data/app/lib/actions/katello/repository/check_matching_content.rb +1 -1
- data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
- data/app/lib/actions/katello/repository/create.rb +1 -1
- data/app/lib/actions/katello/repository/destroy.rb +4 -4
- data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -2
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_publication.rb +3 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +45 -24
- data/app/lib/actions/pulp3/repository/save_versions.rb +2 -1
- data/app/lib/katello/resources/candlepin/activation_key.rb +3 -4
- data/app/lib/katello/resources/candlepin/upstream_job.rb +9 -1
- data/app/lib/katello/resources/candlepin.rb +4 -0
- data/app/models/katello/authorization/repository.rb +17 -4
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -7
- data/app/models/katello/content_view_deb_filter.rb +10 -0
- data/app/models/katello/content_view_deb_filter_rule.rb +7 -0
- data/app/models/katello/deb.rb +10 -10
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/glue/provider.rb +14 -3
- data/app/models/katello/host/content_facet.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +1 -7
- data/app/models/katello/product_content.rb +2 -2
- data/app/models/katello/repository.rb +4 -23
- data/app/models/katello/root_repository.rb +2 -5
- data/app/services/katello/candlepin/event_handler.rb +0 -33
- data/app/services/katello/candlepin/message_handler.rb +0 -41
- data/app/services/katello/content_unit_indexer.rb +59 -13
- data/app/services/katello/product_content_finder.rb +5 -4
- data/app/services/katello/pulp3/alternate_content_source.rb +2 -2
- data/app/services/katello/pulp3/ansible_collection.rb +1 -0
- data/app/services/katello/pulp3/api/content_guard.rb +5 -5
- data/app/services/katello/pulp3/api/core.rb +10 -0
- data/app/services/katello/pulp3/deb.rb +1 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_manifest_list.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/file_unit.rb +1 -0
- data/app/services/katello/pulp3/generic_content_unit.rb +1 -0
- data/app/services/katello/pulp3/module_stream.rb +1 -0
- data/app/services/katello/pulp3/package_group.rb +1 -0
- data/app/services/katello/pulp3/repository/apt.rb +30 -13
- data/app/services/katello/pulp3/repository.rb +59 -10
- data/app/services/katello/pulp3/rpm.rb +3 -2
- data/app/services/katello/pulp3/srpm.rb +3 -2
- data/app/services/katello/pulp3/task_group.rb +1 -1
- data/app/services/katello/registration_manager.rb +19 -17
- data/app/services/katello/repository_type_manager.rb +7 -5
- data/app/services/katello/smart_proxy_helper.rb +1 -6
- data/app/views/foreman/job_templates/upload_profile.erb +5 -0
- data/app/views/katello/api/v2/activation_keys/base.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/debs/thindex.json.rabl +6 -0
- data/app/views/katello/api/v2/docker_tags/_base.json.rabl +32 -0
- data/app/views/katello/api/v2/docker_tags/show.json.rabl +0 -5
- data/app/views/katello/api/v2/flatpak_remotes/index.json.rabl +6 -0
- data/app/views/katello/api/v2/host_debs/installed_debs.json.rabl +6 -0
- data/app/views/katello/api/v2/hosts_bulk_actions/applicable_errata.json.rabl +1 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/applicable_erratum.json.rabl +9 -0
- data/app/views/katello/api/v2/hosts_bulk_actions/installable_errata.json.rabl +1 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/{erratum.json.rabl → installable_erratum.json.rabl} +3 -3
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/config/initializers/monkeys.rb +1 -0
- data/config/routes/api/v2.rb +2 -2
- data/config/routes/overrides.rb +2 -7
- data/config/routes.rb +2 -0
- data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +1 -1
- data/db/migrate/20250912000000_add_pulp_prn_fields.rb +73 -0
- data/db/migrate/20250912000001_populate_pulp_prn_fields.rb +403 -0
- data/db/migrate/20251009142516_remove_auto_attach_from_activation_keys.rb +5 -0
- data/db/migrate/20251009142517_remove_autoheal_from_subscription_facets.rb +5 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/el.po +2 -2
- data/lib/katello/permission_creator.rb +2 -2
- data/lib/katello/permissions/host_permissions.rb +0 -6
- data/lib/katello/plugin.rb +16 -8
- data/lib/katello/tasks/jenkins.rake +1 -1
- data/lib/katello/tasks/upgrades/4.19/enable_structured_apt_for_deb.rake +87 -0
- data/lib/katello/tasks/upgrades/4.19/populate_repository_version_prns.rake +32 -0
- data/lib/katello/version.rb +1 -1
- data/lib/monkeys/fix_rpm_repository_gpgcheck.rb +38 -0
- data/locale/bn/LC_MESSAGES/katello.mo +0 -0
- data/locale/bn/katello.po +56 -107
- data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/bn_IN/katello.po +56 -107
- data/locale/ca/LC_MESSAGES/katello.mo +0 -0
- data/locale/ca/katello.po +56 -107
- data/locale/cs/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs/katello.po +56 -107
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po +57 -108
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +58 -109
- data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
- data/locale/de_AT/katello.po +56 -107
- data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
- data/locale/de_DE/katello.po +56 -107
- data/locale/el/LC_MESSAGES/katello.mo +0 -0
- data/locale/el/katello.po +58 -109
- data/locale/en/LC_MESSAGES/katello.mo +0 -0
- data/locale/en/katello.po +56 -107
- data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_GB/katello.po +56 -107
- data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_US/katello.po +56 -107
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +58 -109
- data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
- data/locale/et_EE/katello.po +56 -107
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +59 -110
- data/locale/gl/LC_MESSAGES/katello.mo +0 -0
- data/locale/gl/katello.po +56 -107
- data/locale/gu/LC_MESSAGES/katello.mo +0 -0
- data/locale/gu/katello.po +56 -107
- data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
- data/locale/he_IL/katello.po +56 -107
- data/locale/hi/LC_MESSAGES/katello.mo +0 -0
- data/locale/hi/katello.po +56 -107
- data/locale/id/LC_MESSAGES/katello.mo +0 -0
- data/locale/id/katello.po +56 -107
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +56 -107
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +59 -110
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +58 -109
- data/locale/katello.pot +676 -749
- data/locale/kn/LC_MESSAGES/katello.mo +0 -0
- data/locale/kn/katello.po +56 -107
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +59 -110
- data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/ml_IN/katello.po +56 -107
- data/locale/mr/LC_MESSAGES/katello.mo +0 -0
- data/locale/mr/katello.po +56 -107
- data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
- data/locale/nl_NL/katello.po +56 -107
- data/locale/or/LC_MESSAGES/katello.mo +0 -0
- data/locale/or/katello.po +56 -107
- data/locale/pa/LC_MESSAGES/katello.mo +0 -0
- data/locale/pa/katello.po +56 -107
- data/locale/pl/LC_MESSAGES/katello.mo +0 -0
- data/locale/pl/katello.po +56 -107
- data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
- data/locale/pl_PL/katello.po +56 -107
- data/locale/pt/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt/katello.po +56 -107
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +58 -109
- data/locale/ro/LC_MESSAGES/katello.mo +0 -0
- data/locale/ro/katello.po +56 -107
- data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
- data/locale/ro_RO/katello.po +56 -107
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +57 -108
- data/locale/sl/LC_MESSAGES/katello.mo +0 -0
- data/locale/sl/katello.po +56 -107
- data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
- data/locale/sv_SE/katello.po +56 -107
- data/locale/ta/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta/katello.po +56 -107
- data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta_IN/katello.po +56 -107
- data/locale/te/LC_MESSAGES/katello.mo +0 -0
- data/locale/te/katello.po +56 -107
- data/locale/tr/LC_MESSAGES/katello.mo +0 -0
- data/locale/tr/katello.po +56 -107
- data/locale/vi/LC_MESSAGES/katello.mo +0 -0
- data/locale/vi/katello.po +56 -107
- data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
- data/locale/vi_VN/katello.po +56 -107
- data/locale/zh/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh/katello.po +56 -107
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +59 -110
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +57 -108
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +2 -2
- data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +0 -2
- data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeEditModal.test.js +0 -2
- data/webpack/components/extensions/Hosts/ActionsBar/index.js +1 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkActionsConstants.js +7 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js +388 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/__tests__/BulkChangeHostCollectionsModal.test.js +640 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/actions.js +28 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js +71 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +1 -1
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +10 -3
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +51 -24
- data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +7 -0
- data/webpack/containers/Application/config.js +11 -1
- data/webpack/global_index.js +3 -0
- data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesConstants.js +1 -1
- data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesPage.js +7 -43
- data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImagesPage.test.js +1 -1
- data/webpack/scenes/ContainerImages/ContainerImagesPage.js +86 -0
- data/webpack/scenes/ContainerImages/LabelsAnnotationsModal.js +105 -0
- data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetails.js +218 -0
- data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsActions.js +15 -0
- data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsSelectors.js +16 -0
- data/webpack/scenes/ContainerImages/Synced/Details/__tests__/ManifestDetails.test.js +395 -0
- data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestDetails.fixtures.json +43 -0
- data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestList.fixtures.json +58 -0
- data/webpack/scenes/ContainerImages/Synced/Details/index.js +4 -0
- data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.js +359 -0
- data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.scss +21 -0
- data/webpack/scenes/ContainerImages/Synced/__tests__/LabelsAnnotationsModal.test.js +69 -0
- data/webpack/scenes/ContainerImages/Synced/__tests__/SyncedContainerImagesPage.test.js +335 -0
- data/webpack/scenes/ContainerImages/Synced/__tests__/syncedContainerImages.fixtures.json +105 -0
- data/webpack/scenes/ContainerImages/TableEmptyState.js +67 -0
- data/webpack/scenes/ContainerImages/containerImagesHelpers.js +48 -0
- data/webpack/scenes/ContainerImages/index.js +4 -0
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +29 -3
- data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -0
- data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +45 -1
- data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -1
- data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +59 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +1 -0
- data/webpack/scenes/ContentViews/Details/Filters/Rules/DebPackage/AddEditDebPackageRuleModal.js +164 -24
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVDebFilterContent.test.js +268 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterDetail.fixtures.json +95 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterRules.fixtures.json +31 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVDebFilterRules.fixtures.json +10 -0
- data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -1
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetail.test.js +15 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetails.fixtures.json +1 -0
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +9 -0
- data/webpack/scenes/FlatpakRemotes/CreateEdit/CreateFlatpakRemoteModal.js +5 -3
- data/webpack/scenes/FlatpakRemotes/CreateEdit/EditFlatpakRemotesModal.js +1 -1
- data/webpack/scenes/FlatpakRemotes/CreateEdit/FlatpakRemoteform.js +35 -3
- data/webpack/scenes/FlatpakRemotes/Details/FlatpakRemoteDetails.js +1 -1
- data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.css +3 -0
- data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.js +63 -132
- data/webpack/scenes/FlatpakRemotes/FlatpakRemotesPage.js +67 -143
- data/webpack/scenes/SmartProxy/ExpandableCvDetails.js +10 -2
- data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +13 -2
- data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +1 -0
- data/webpack/scenes/SmartProxy/SmartProxyExpandableTable.js +8 -2
- data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +67 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -2
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
- metadata +83 -55
- data/app/lib/actions/katello/host/attach_subscriptions.rb +0 -59
- data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -22
- data/app/lib/actions/katello/host/remove_subscriptions.rb +0 -50
- data/app/lib/actions/katello/organization/simple_content_access/disable.rb +0 -25
- data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -25
- data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +0 -42
- data/lib/katello/tasks/migrate_structure_content_for_deb.rake +0 -105
- data/lib/katello/tasks/upgrades/4.2/remove_checksum_values.rake +0 -17
- data/locale/action_names.rb +0 -186
- /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImages.fixtures.js +0 -0
- /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/index.js +0 -0
data/app/models/katello/deb.rb
CHANGED
|
@@ -27,16 +27,16 @@ module Katello
|
|
|
27
27
|
ContentFacetApplicableDeb
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
scope :search_version_equal, ->(ver) {
|
|
31
|
+
where("deb_version_cmp(#{::Katello::Deb.table_name}.version, ?) = 0", ver)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
scope :search_version_range, ->(min_ver, max_ver) {
|
|
35
|
+
query = all
|
|
36
|
+
query = query.where("deb_version_cmp(#{::Katello::Deb.table_name}.version, ?) >= 0", min_ver) if min_ver.present?
|
|
37
|
+
query = query.where("deb_version_cmp(#{::Katello::Deb.table_name}.version, ?) <= 0", max_ver) if max_ver.present?
|
|
34
38
|
query
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def self.search_version_equal(version)
|
|
38
|
-
Katello::Util::PackageFilter.new(self, version, Katello::Util::PackageFilter::EQUAL).results
|
|
39
|
-
end
|
|
39
|
+
}
|
|
40
40
|
|
|
41
41
|
def self.total_for_repositories(repos)
|
|
42
42
|
self.in_repositories(repos).count
|
|
@@ -96,7 +96,7 @@ module Katello
|
|
|
96
96
|
|
|
97
97
|
# Return deb packages that are not installed on a host, but could be installed
|
|
98
98
|
# the word 'installable' has a different meaning here than elsewhere
|
|
99
|
-
def self.
|
|
99
|
+
def self.deb_installable_for_host(host)
|
|
100
100
|
repos = host.content_facet.bound_repositories.pluck(:id)
|
|
101
101
|
Katello::Deb.in_repositories(repos).where.not(name: host.installed_debs.pluck(:name)).order(:name)
|
|
102
102
|
end
|
|
@@ -227,7 +227,7 @@ module Katello
|
|
|
227
227
|
property :summary, String, desc: 'Returns the errata summary, the length can very, it is usually in range of 60 to 1000 characters. It can include empty line characters.'
|
|
228
228
|
end
|
|
229
229
|
class Jail < ::Safemode::Jail
|
|
230
|
-
allow :errata_id, :errata_type, :issued, :created_at, :severity, :package_names, :cves, :reboot_suggested, :title, :summary
|
|
230
|
+
allow :errata_id, :errata_type, :issued, :updated, :created_at, :severity, :package_names, :cves, :reboot_suggested, :title, :summary
|
|
231
231
|
end
|
|
232
232
|
end
|
|
233
233
|
end
|
|
@@ -31,10 +31,21 @@ module Katello
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
module InstanceMethods
|
|
34
|
-
|
|
34
|
+
API_BASE_URL = 'https://subscription.rhsm.redhat.com'.freeze
|
|
35
|
+
SUBSCRIPTION_PATH = '/subscription'.freeze
|
|
36
|
+
CONSUMERS_PATH = '/consumers/'.freeze
|
|
37
|
+
API_URL = API_BASE_URL + SUBSCRIPTION_PATH + CONSUMERS_PATH # https://subscription.rhsm.redhat.com/subscription/consumers/
|
|
38
|
+
|
|
39
|
+
def normalize_api_url(api_url)
|
|
40
|
+
return nil if api_url.blank?
|
|
41
|
+
uri = URI.parse(api_url)
|
|
42
|
+
# only take base url; we will overwrite the path to ensure it's correct
|
|
43
|
+
uri.path = SUBSCRIPTION_PATH + CONSUMERS_PATH # https://subscription.rhsm.redhat.com/subscription/consumers/
|
|
44
|
+
uri.to_s
|
|
45
|
+
end
|
|
46
|
+
|
|
35
47
|
def api_url(upstream = {})
|
|
36
|
-
|
|
37
|
-
ENV['REDHAT_RHSM_API_URL'] || upstream['apiUrl'] || API_URL
|
|
48
|
+
ENV['REDHAT_RHSM_API_URL'] || normalize_api_url(upstream['apiUrl']) || API_URL
|
|
38
49
|
end
|
|
39
50
|
|
|
40
51
|
def sync
|
|
@@ -202,7 +202,7 @@ module Katello
|
|
|
202
202
|
# "/pulp/content/Org/Library/custom/Test_product/test2/%3Fcomp%3Dmain%26rel%3Dstable"]
|
|
203
203
|
paths.each do |path|
|
|
204
204
|
if (prefix = prefixes.find { |pre| path.start_with?(pre) })
|
|
205
|
-
# strip prefix and
|
|
205
|
+
# strip prefix and deb? content postfix before adding to relative_paths
|
|
206
206
|
relative_paths << path.sub(prefix, '').sub(%r{/?(%3F|\?).*}, '')
|
|
207
207
|
else
|
|
208
208
|
Rails.logger.warn("System #{self.host.name} (#{self.host.id}) requested binding to repo with unknown prefix. #{path}")
|
|
@@ -51,7 +51,6 @@ module Katello
|
|
|
51
51
|
self.dmi_uuid = consumer_params['facts']['dmi.system.uuid']
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
self.autoheal = consumer_params['autoheal'] unless consumer_params['autoheal'].nil?
|
|
55
54
|
self.service_level = consumer_params['serviceLevel'] unless consumer_params['serviceLevel'].nil?
|
|
56
55
|
self.registered_at = consumer_params['created'] unless consumer_params['created'].blank?
|
|
57
56
|
self.last_checkin = consumer_params['lastCheckin'] unless consumer_params['lastCheckin'].blank?
|
|
@@ -130,7 +129,6 @@ module Katello
|
|
|
130
129
|
|
|
131
130
|
def consumer_attributes
|
|
132
131
|
attrs = {
|
|
133
|
-
:autoheal => autoheal,
|
|
134
132
|
:usage => purpose_usage,
|
|
135
133
|
:role => purpose_role,
|
|
136
134
|
:serviceLevel => service_level,
|
|
@@ -257,10 +255,6 @@ module Katello
|
|
|
257
255
|
Katello::Product.joins(:subscriptions => {:pools => :subscription_facets}).where("#{Katello::Host::SubscriptionFacet.table_name}.id" => self.id).enabled.uniq
|
|
258
256
|
end
|
|
259
257
|
|
|
260
|
-
def remove_subscriptions(pools_with_quantities)
|
|
261
|
-
ForemanTasks.sync_task(Actions::Katello::Host::RemoveSubscriptions, self.host, pools_with_quantities)
|
|
262
|
-
end
|
|
263
|
-
|
|
264
258
|
def self.sanitize_name(name)
|
|
265
259
|
name.gsub('_', '-').chomp('.').downcase
|
|
266
260
|
end
|
|
@@ -274,7 +268,7 @@ module Katello
|
|
|
274
268
|
end
|
|
275
269
|
|
|
276
270
|
def backend_update_needed?
|
|
277
|
-
%w(release_version service_level
|
|
271
|
+
%w(release_version service_level purpose_role purpose_usage).each do |method|
|
|
278
272
|
if self.send("#{method}_changed?")
|
|
279
273
|
Rails.logger.debug("backend_update_needed: subscription facet #{method} changed")
|
|
280
274
|
return true
|
|
@@ -46,8 +46,8 @@ module Katello
|
|
|
46
46
|
|
|
47
47
|
def self.enabled(organization)
|
|
48
48
|
content_ids = Katello::RootRepository.in_organization(organization).where.not(content_id: nil).pluck(:content_id)
|
|
49
|
-
|
|
50
|
-
joins(:content).where("#{self.content_table_name}.cp_content_id" => content_ids +
|
|
49
|
+
deb_content_ids = Katello::Repository.in_organization(organization).library.deb_type.pluck(:content_id)
|
|
50
|
+
joins(:content).where("#{self.content_table_name}.cp_content_id" => content_ids + deb_content_ids)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def self.with_valid_subscription(organization)
|
|
@@ -170,7 +170,7 @@ module Katello
|
|
|
170
170
|
scoped_search :on => :label, :relation => :root, :complete_value => true, :only_explicit => true
|
|
171
171
|
scoped_search :on => :content_label, :ext_method => :search_by_content_label, :default_operator => :like
|
|
172
172
|
|
|
173
|
-
delegate :product, :redhat?, :custom?, :
|
|
173
|
+
delegate :product, :redhat?, :custom?, :to => :root
|
|
174
174
|
delegate :yum?, :docker?, :deb?, :file?, :ostree?, :ansible_collection?, :generic?, :to => :root
|
|
175
175
|
delegate :name, :label, :docker_upstream_name, :url, :download_concurrency, :to => :root
|
|
176
176
|
|
|
@@ -1046,32 +1046,13 @@ module Katello
|
|
|
1046
1046
|
|
|
1047
1047
|
def deb_content_url_options
|
|
1048
1048
|
return '' unless version_href
|
|
1049
|
-
return '' if backend_service(SmartProxy.pulp_primary).version_missing_structure_content?
|
|
1050
1049
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1050
|
+
backend_service = self.backend_service(SmartProxy.pulp_primary)
|
|
1051
|
+
components = backend_service.pulp_components.join(',')
|
|
1052
|
+
distributions = backend_service.pulp_distributions.join(',')
|
|
1053
1053
|
"/?comp=#{components}&rel=#{distributions}"
|
|
1054
1054
|
end
|
|
1055
1055
|
|
|
1056
|
-
def deb_pulp_components(version_href = self.version_href)
|
|
1057
|
-
return [] if version_href.blank?
|
|
1058
|
-
|
|
1059
|
-
pulp_api = Katello::Pulp3::Repository.instance_for_type(self, SmartProxy.pulp_primary).api.content_release_components_api
|
|
1060
|
-
pulp_api.list({:repository_version => version_href}).results.map { |x| x.plain_component }.uniq
|
|
1061
|
-
end
|
|
1062
|
-
|
|
1063
|
-
def deb_sanitize_pulp_distribution(distribution)
|
|
1064
|
-
return "flat-repo" if distribution == "/"
|
|
1065
|
-
return distribution.chomp("/") if distribution&.end_with?("/")
|
|
1066
|
-
distribution
|
|
1067
|
-
end
|
|
1068
|
-
|
|
1069
|
-
def deb_pulp_distributions(version_href = self.version_href)
|
|
1070
|
-
return [] if version_href.blank?
|
|
1071
|
-
pulp_api = Katello::Pulp3::Repository.instance_for_type(self, SmartProxy.pulp_primary).api.content_release_components_api
|
|
1072
|
-
pulp_api.list({:repository_version => version_href}).results.map { |x| deb_sanitize_pulp_distribution(x.distribution) }.uniq
|
|
1073
|
-
end
|
|
1074
|
-
|
|
1075
1056
|
def sync_status
|
|
1076
1057
|
return latest_dynflow_sync
|
|
1077
1058
|
end
|
|
@@ -389,10 +389,6 @@ module Katello
|
|
|
389
389
|
self.content_type == Repository::DEB_TYPE
|
|
390
390
|
end
|
|
391
391
|
|
|
392
|
-
def deb_using_structured_apt?
|
|
393
|
-
self.deb? && !self.content_id
|
|
394
|
-
end
|
|
395
|
-
|
|
396
392
|
def ansible_collection?
|
|
397
393
|
self.content_type == Repository::ANSIBLE_COLLECTION_TYPE
|
|
398
394
|
end
|
|
@@ -446,7 +442,8 @@ module Katello
|
|
|
446
442
|
end
|
|
447
443
|
|
|
448
444
|
def format_arches
|
|
449
|
-
if
|
|
445
|
+
if self.deb?
|
|
446
|
+
# Pulp 2 needed a "," separated string-list, but Pulp 3 needs " " separated!
|
|
450
447
|
self.deb_architectures&.gsub(" ", ",")
|
|
451
448
|
else
|
|
452
449
|
self.arch == "noarch" ? nil : self.arch
|
|
@@ -15,46 +15,13 @@ module Katello
|
|
|
15
15
|
@message_handler = ::Katello::Candlepin::MessageHandler.new(message)
|
|
16
16
|
data[:entity_id] = @message_handler.entity_id
|
|
17
17
|
case message_handler.subject
|
|
18
|
-
when /entitlement\.created/
|
|
19
|
-
message_handler.import_pool
|
|
20
|
-
message_handler.create_pool_on_host
|
|
21
|
-
when /entitlement\.deleted/
|
|
22
|
-
message_handler.import_pool
|
|
23
|
-
message_handler.remove_pool_from_host
|
|
24
18
|
when /pool\.created/
|
|
25
19
|
message_handler.import_pool
|
|
26
20
|
when /pool\.deleted/
|
|
27
21
|
message_handler.delete_pool
|
|
28
|
-
when /^compliance\.created/
|
|
29
|
-
event_no_longer_handled
|
|
30
|
-
when /system_purpose_compliance\.created/
|
|
31
|
-
event_no_longer_handled
|
|
32
|
-
when /owner_content_access_mode\.modified/
|
|
33
|
-
message_handler.handle_content_access_mode_modified
|
|
34
22
|
end
|
|
35
23
|
end
|
|
36
24
|
end
|
|
37
|
-
|
|
38
|
-
private
|
|
39
|
-
|
|
40
|
-
def event_no_longer_handled
|
|
41
|
-
@logger.error "Received #{message_handler.subject} event from Candlepin. Handling of this event is no longer supported."
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def subscription_facet
|
|
45
|
-
message_handler.subscription_facet
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def reindex_consumer
|
|
49
|
-
if subscription_facet.nil?
|
|
50
|
-
@logger.debug "skip re-indexing of non-existent content host #{message_handler.consumer_uuid}"
|
|
51
|
-
return
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
@logger.debug "re-indexing content host #{subscription_facet.host.name}"
|
|
55
|
-
|
|
56
|
-
yield
|
|
57
|
-
end
|
|
58
25
|
end
|
|
59
26
|
end
|
|
60
27
|
end
|
|
@@ -46,27 +46,9 @@ module Katello
|
|
|
46
46
|
case subject
|
|
47
47
|
when 'pool.created', 'pool.deleted'
|
|
48
48
|
content['entityId']
|
|
49
|
-
when 'entitlement.created', 'entitlement.deleted'
|
|
50
|
-
content['referenceId']
|
|
51
49
|
end
|
|
52
50
|
end
|
|
53
51
|
|
|
54
|
-
def create_pool_on_host
|
|
55
|
-
return if self.subscription_facet.nil? || pool.nil?
|
|
56
|
-
old_host_ids = subscription_facet_host_ids
|
|
57
|
-
::Katello::SubscriptionFacetPool.where(subscription_facet_id: self.subscription_facet.id,
|
|
58
|
-
pool_id: pool.id).first_or_create
|
|
59
|
-
pool.import_audit_record(old_host_ids)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def remove_pool_from_host
|
|
63
|
-
return if self.subscription_facet.nil? || pool.nil?
|
|
64
|
-
old_host_ids = subscription_facet_host_ids
|
|
65
|
-
::Katello::SubscriptionFacetPool.where(subscription_facet_id: self.subscription_facet.id,
|
|
66
|
-
pool_id: pool.id).destroy_all
|
|
67
|
-
pool.import_audit_record(old_host_ids)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
52
|
def import_pool(index_hosts = true)
|
|
71
53
|
if pool
|
|
72
54
|
::Katello::EventQueue.push_event(::Katello::Events::ImportPool::EVENT_TYPE, pool.id)
|
|
@@ -86,29 +68,6 @@ module Katello
|
|
|
86
68
|
Rails.logger.info "Deleted Katello::Pool with cp_id=#{pool_id}"
|
|
87
69
|
end
|
|
88
70
|
end
|
|
89
|
-
|
|
90
|
-
def handle_content_access_mode_modified
|
|
91
|
-
# Ideally the target_name would be the Candlepin Owner key
|
|
92
|
-
# Since it's the displayName, and we don't update that after org creation, there could be a mismatch
|
|
93
|
-
# For now, find the Candlepin Owner displayName from this event, and tie it back to a Katello org based on owner key
|
|
94
|
-
owners = Katello::Resources::Candlepin::Owner.all
|
|
95
|
-
owner = owners.find { |o| o['displayName'] == target_name }
|
|
96
|
-
|
|
97
|
-
unless owner
|
|
98
|
-
fail("Candlepin Owner %s could not be found" % target_name)
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
org = ::Organization.find_by!(label: owner['key'])
|
|
102
|
-
|
|
103
|
-
Rails.logger.error "Received content_access_mode_modified event for org #{org.label}. This event is no longer supported."
|
|
104
|
-
org.simple_content_access?(cached: false)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
private
|
|
108
|
-
|
|
109
|
-
def subscription_facet_host_ids
|
|
110
|
-
::Katello::SubscriptionFacetPool.where(pool_id: pool_id).joins(:subscription_facet).pluck(:host_id)
|
|
111
|
-
end
|
|
112
71
|
end
|
|
113
72
|
end
|
|
114
73
|
end
|
|
@@ -39,18 +39,14 @@ module Katello
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
# Even after this bug (https://github.com/pulp/pulp_rpm/issues/2821) is fixed,
|
|
42
|
-
# it is possible to have duplicate errata
|
|
42
|
+
# it is possible to have duplicate errata associated to a repo.
|
|
43
43
|
if @content_type.label == 'erratum'
|
|
44
44
|
to_insert.uniq! { |row| row["pulp_id"] || row[:pulp_id] }
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
next if to_insert.empty?
|
|
48
48
|
insert_timestamps(to_insert)
|
|
49
|
-
|
|
50
|
-
@model_class.upsert_all(to_insert, unique_by: :pulp_id)
|
|
51
|
-
else
|
|
52
|
-
@model_class.insert_all(to_insert, unique_by: :pulp_id)
|
|
53
|
-
end
|
|
49
|
+
upsert_with_deadlock_retry(to_insert)
|
|
54
50
|
end
|
|
55
51
|
|
|
56
52
|
import_associations(units) if @repository
|
|
@@ -107,11 +103,13 @@ module Katello
|
|
|
107
103
|
def push(unit)
|
|
108
104
|
if @service_class.backend_unit_identifier
|
|
109
105
|
pulp_href = unit.dig(@service_class.backend_unit_identifier)
|
|
106
|
+
pulp_prn = unit['prn']
|
|
110
107
|
else
|
|
111
108
|
pulp_href = nil
|
|
109
|
+
pulp_prn = nil
|
|
112
110
|
end
|
|
113
111
|
unit_id = unit[@service_class.unit_identifier]
|
|
114
|
-
@values[unit_id] = pulp_href
|
|
112
|
+
@values[unit_id] = { href: pulp_href, prn: pulp_prn }
|
|
115
113
|
end
|
|
116
114
|
|
|
117
115
|
def db_values
|
|
@@ -121,7 +119,10 @@ module Katello
|
|
|
121
119
|
@final_values = ::Katello::ContentUnitIndexer.pulp_id_to_id_map(@content_type, @values.keys).map do |pulp_id, katello_id|
|
|
122
120
|
#:repository_id => X, :erratum_id => y
|
|
123
121
|
row = {:repository_id => @repository.id, @content_type.model_class.unit_id_field => katello_id}
|
|
124
|
-
|
|
122
|
+
if pulp_href_association_name
|
|
123
|
+
row[pulp_href_association_name] = @values[pulp_id][:href]
|
|
124
|
+
row[pulp_prn_association_name] = @values[pulp_id][:prn] if pulp_prn_association_name
|
|
125
|
+
end
|
|
125
126
|
row
|
|
126
127
|
end
|
|
127
128
|
ContentUnitIndexer.insert_timestamps(@content_type.model_class, @final_values)
|
|
@@ -131,6 +132,10 @@ module Katello
|
|
|
131
132
|
def pulp_href_association_name
|
|
132
133
|
'erratum_pulp3_href' if @content_type.label == 'erratum'
|
|
133
134
|
end
|
|
135
|
+
|
|
136
|
+
def pulp_prn_association_name
|
|
137
|
+
'erratum_prn' if @content_type.label == 'erratum'
|
|
138
|
+
end
|
|
134
139
|
end
|
|
135
140
|
|
|
136
141
|
def insert_timestamps(units)
|
|
@@ -154,17 +159,19 @@ module Katello
|
|
|
154
159
|
@service_class.supports_id_fetch?
|
|
155
160
|
end
|
|
156
161
|
|
|
157
|
-
def sync_repository_associations(
|
|
162
|
+
def sync_repository_associations(association_tracker, additive: false)
|
|
158
163
|
unless additive
|
|
159
164
|
ActiveRecord::Base.connection.uncached do
|
|
160
165
|
repo_associations_to_destroy = @model_class.repository_association_class.where(repository_id: @repository.id).where.
|
|
161
|
-
not(@model_class.unit_id_field =>
|
|
166
|
+
not(@model_class.unit_id_field => association_tracker.unit_ids)
|
|
162
167
|
clean_filter_rules(repo_associations_to_destroy) if repo_associations_to_destroy.present? && [::Katello::ModuleStream, ::Katello::Erratum, ::Katello::PackageGroup].include?(@model_class)
|
|
163
168
|
repo_associations_to_destroy.destroy_all
|
|
164
169
|
end
|
|
165
170
|
end
|
|
166
|
-
return if
|
|
167
|
-
@model_class.repository_association_class.upsert_all(
|
|
171
|
+
return if association_tracker.db_values.empty?
|
|
172
|
+
@model_class.repository_association_class.upsert_all(association_tracker.db_values, :unique_by => association_class_uniqueness_attributes)
|
|
173
|
+
|
|
174
|
+
clean_duplicate_docker_tags if @model_class == Katello::DockerTag
|
|
168
175
|
end
|
|
169
176
|
|
|
170
177
|
def clean_filter_rules(repo_associations_to_destroy)
|
|
@@ -190,7 +197,46 @@ module Katello
|
|
|
190
197
|
end
|
|
191
198
|
end
|
|
192
199
|
|
|
193
|
-
def
|
|
200
|
+
def clean_duplicate_docker_tags
|
|
201
|
+
# Deduplicate docker tags by name, keeping the one with the newest updated_at
|
|
202
|
+
deduplicated_tags = @repository.docker_tags.group_by(&:name).map { |_name, tags| tags.max_by(&:updated_at) }
|
|
203
|
+
return if deduplicated_tags.empty?
|
|
204
|
+
valid_names = deduplicated_tags.map(&:name)
|
|
205
|
+
valid_taggable_ids = deduplicated_tags.map(&:id)
|
|
206
|
+
|
|
207
|
+
# Remove duplicate tags with same names as valid tags, keeping only the newest ones
|
|
208
|
+
# Lookup by docker_manifest is important; docker_tags usually only contains the newest tag.
|
|
209
|
+
tag_ids_to_remove = @repository.docker_manifests
|
|
210
|
+
.joins(:docker_tags)
|
|
211
|
+
.where(katello_docker_tags: { name: valid_names })
|
|
212
|
+
.where.not(katello_docker_tags: {id: valid_taggable_ids})
|
|
213
|
+
.pluck('katello_docker_tags.id')
|
|
214
|
+
|
|
215
|
+
return if tag_ids_to_remove.empty?
|
|
216
|
+
Rails.logger.info("Removing #{tag_ids_to_remove.count} duplicate docker tag associations in repository '#{@repository.label}'")
|
|
217
|
+
Katello::DockerTag.where(id: tag_ids_to_remove).destroy_all
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
def upsert_with_deadlock_retry(to_insert)
|
|
221
|
+
retry_count = 0
|
|
222
|
+
begin
|
|
223
|
+
if @content_type.mutable
|
|
224
|
+
@model_class.upsert_all(to_insert, unique_by: :pulp_id)
|
|
225
|
+
else
|
|
226
|
+
@model_class.insert_all(to_insert, unique_by: :pulp_id)
|
|
227
|
+
end
|
|
228
|
+
rescue ActiveRecord::Deadlocked
|
|
229
|
+
retry_count += 1
|
|
230
|
+
if retry_count <= 3
|
|
231
|
+
sleep(rand(1..5))
|
|
232
|
+
retry
|
|
233
|
+
else
|
|
234
|
+
raise
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def association_class_uniqueness_attributes
|
|
194
240
|
columns = [@model_class.unit_id_field, 'repository_id']
|
|
195
241
|
found = ActiveRecord::Base.connection.indexes(@model_class.repository_association_class.table_name).find do |index|
|
|
196
242
|
index.columns.sort == columns.sort
|
|
@@ -22,10 +22,11 @@ module Katello
|
|
|
22
22
|
|
|
23
23
|
roots = Katello::RootRepository.where(:product_id => considered_products).subscribable
|
|
24
24
|
roots = roots.in_content_view_version(versions).distinct if versions.present?
|
|
25
|
-
content_ids = roots.where.not(:
|
|
26
|
-
|
|
27
|
-
if
|
|
28
|
-
|
|
25
|
+
content_ids = roots.where.not(:content_type => ::Katello::Repository::DEB_TYPE).pluck(:content_id)
|
|
26
|
+
deb_roots = roots.where(:content_type => ::Katello::Repository::DEB_TYPE)
|
|
27
|
+
if deb_roots.any?
|
|
28
|
+
# deb? roots need to be considered separately because they do not have content_ids on the root!
|
|
29
|
+
deb_repos_query = Katello::Repository.where(root: deb_roots)
|
|
29
30
|
deb_repos_library = Set.new
|
|
30
31
|
deb_repos_batch = []
|
|
31
32
|
if match_environment
|
|
@@ -81,7 +81,7 @@ module Katello
|
|
|
81
81
|
def create_remote
|
|
82
82
|
if smart_proxy_acs&.remote_href.nil?
|
|
83
83
|
response = super
|
|
84
|
-
smart_proxy_acs.update!(remote_href: response.pulp_href)
|
|
84
|
+
smart_proxy_acs.update!(remote_href: response.pulp_href, remote_prn: response.prn)
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -106,7 +106,7 @@ module Katello
|
|
|
106
106
|
end
|
|
107
107
|
response = api.alternate_content_source_api.create(name: generate_backend_object_name, paths: paths.sort,
|
|
108
108
|
remote: smart_proxy_acs.remote_href)
|
|
109
|
-
smart_proxy_acs.update!(alternate_content_source_href: response.pulp_href)
|
|
109
|
+
smart_proxy_acs.update!(alternate_content_source_href: response.pulp_href, alternate_content_source_prn: response.prn)
|
|
110
110
|
return response
|
|
111
111
|
end
|
|
112
112
|
end
|
|
@@ -31,21 +31,21 @@ module Katello
|
|
|
31
31
|
def refresh
|
|
32
32
|
found = list(name: default_name).results.first
|
|
33
33
|
if found && found.ca_certificate != ca_cert
|
|
34
|
-
partial_update(found.pulp_href)
|
|
34
|
+
partial_update(found.pulp_href) # Still use pulp_href for API calls
|
|
35
35
|
else
|
|
36
36
|
found = create
|
|
37
37
|
end
|
|
38
|
-
persist_if_needed(found
|
|
38
|
+
persist_if_needed(found)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
def persist_if_needed(
|
|
41
|
+
def persist_if_needed(content_guard_obj)
|
|
42
42
|
return if self.smart_proxy.pulp_mirror?
|
|
43
43
|
Katello::Util::Support.active_record_retry do
|
|
44
44
|
found = Katello::Pulp3::ContentGuard.find_by(:name => default_name)
|
|
45
45
|
if found
|
|
46
|
-
found.update(pulp_href:
|
|
46
|
+
found.update(pulp_href: content_guard_obj.pulp_href, pulp_prn: content_guard_obj.prn)
|
|
47
47
|
else
|
|
48
|
-
Katello::Pulp3::ContentGuard.create(name: default_name, pulp_href:
|
|
48
|
+
Katello::Pulp3::ContentGuard.create(name: default_name, pulp_href: content_guard_obj.pulp_href, pulp_prn: content_guard_obj.prn)
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -64,6 +64,10 @@ module Katello
|
|
|
64
64
|
PulpcoreClient::RepositoriesApi.new(core_api_client)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
+
def core_repository_versions_api
|
|
68
|
+
PulpcoreClient::RepositoryVersionsApi.new(core_api_client)
|
|
69
|
+
end
|
|
70
|
+
|
|
67
71
|
def repositories_api
|
|
68
72
|
repository_type.repositories_api_class.new(api_client)
|
|
69
73
|
end
|
|
@@ -237,6 +241,12 @@ module Katello
|
|
|
237
241
|
end
|
|
238
242
|
end
|
|
239
243
|
|
|
244
|
+
def core_repository_versions_list_all(options = {})
|
|
245
|
+
self.class.fetch_from_list do |page_opts|
|
|
246
|
+
core_repository_versions_api.list(page_opts.merge(options))
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
240
250
|
def list_all(options = {})
|
|
241
251
|
self.class.fetch_from_list do |page_opts|
|
|
242
252
|
repositories_api.list(page_opts.merge(options))
|
|
@@ -27,6 +27,7 @@ module Katello
|
|
|
27
27
|
schema_version: unit['schema_version'],
|
|
28
28
|
digest: unit['digest'],
|
|
29
29
|
pulp_id: unit[unit_identifier],
|
|
30
|
+
pulp_prn: unit['prn'],
|
|
30
31
|
annotations: unit['annotations'],
|
|
31
32
|
labels: unit['labels'],
|
|
32
33
|
is_bootable: unit['is_bootable'] || unit['type'] == 'bootable',
|
|
@@ -29,6 +29,7 @@ module Katello
|
|
|
29
29
|
schema_version: unit['schema_version'],
|
|
30
30
|
digest: unit['digest'],
|
|
31
31
|
pulp_id: unit[unit_identifier],
|
|
32
|
+
pulp_prn: unit['prn'],
|
|
32
33
|
annotations: unit['annotations'],
|
|
33
34
|
labels: unit['labels'],
|
|
34
35
|
is_bootable: unit['is_bootable'] || unit['type'] == 'bootable',
|
|
@@ -20,6 +20,7 @@ module Katello
|
|
|
20
20
|
def self.generate_model_row(unit, content_type)
|
|
21
21
|
{
|
|
22
22
|
pulp_id: unit['pulp_href'],
|
|
23
|
+
pulp_prn: unit['prn'],
|
|
23
24
|
name: content_type&.model_name&.call(unit),
|
|
24
25
|
version: content_type&.model_version&.call(unit),
|
|
25
26
|
filename: content_type&.model_filename&.call(unit),
|
|
@@ -68,6 +68,7 @@ module Katello
|
|
|
68
68
|
shared_attributes = unit.keys & Katello::ModuleStream.column_names
|
|
69
69
|
to_return = unit.select { |key, _v| shared_attributes.include?(key) }
|
|
70
70
|
to_return['pulp_id'] = unit['pulp_href']
|
|
71
|
+
to_return['pulp_prn'] = unit['prn']
|
|
71
72
|
to_return[:created_at] = DateTime.now
|
|
72
73
|
to_return[:updated_at] = DateTime.now
|
|
73
74
|
to_return
|
|
@@ -58,6 +58,7 @@ module Katello
|
|
|
58
58
|
def self.generate_model_row(unit)
|
|
59
59
|
custom_json = {}
|
|
60
60
|
custom_json['pulp_id'] = unit['pulp_href']
|
|
61
|
+
custom_json['pulp_prn'] = unit['prn']
|
|
61
62
|
custom_json['name'] = unit['name']
|
|
62
63
|
custom_json['description'] = unit['description']
|
|
63
64
|
custom_json
|