katello 3.13.4 → 3.14.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +25 -16
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +26 -21
- data/app/controllers/katello/api/v2/ansible_collections_controller.rb +6 -0
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +8 -2
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +8 -1
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -3
- data/app/controllers/katello/api/v2/katello_ping_controller.rb +24 -0
- data/app/controllers/katello/api/v2/module_streams_controller.rb +21 -0
- data/app/controllers/katello/api/v2/package_groups_controller.rb +5 -0
- data/app/controllers/katello/api/v2/packages_controller.rb +16 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +7 -4
- data/app/controllers/katello/api/v2/srpms_controller.rb +1 -1
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +5 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +7 -5
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +36 -5
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +12 -0
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +55 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +13 -64
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +40 -0
- data/app/lib/actions/katello/content_view/publish.rb +0 -3
- data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +1 -3
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +21 -0
- data/app/lib/actions/katello/repository/create.rb +8 -0
- data/app/lib/actions/katello/repository/import_upload.rb +13 -12
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -2
- data/app/lib/actions/katello/repository/update.rb +9 -0
- data/app/lib/actions/katello/repository/upload_files.rb +4 -11
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -0
- data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +16 -0
- data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +25 -0
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +34 -0
- data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +35 -0
- data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +15 -0
- data/app/lib/actions/{katello/capsule_content → pulp/orphan_cleanup}/remove_unneeded_repos.rb +2 -2
- data/app/lib/actions/pulp/repository/import_upload.rb +7 -11
- data/app/lib/actions/pulp3/abstract_async_task.rb +7 -7
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +32 -0
- data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +31 -0
- data/app/lib/actions/pulp3/capsule_content/sync.rb +26 -0
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +20 -0
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +15 -15
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +36 -0
- data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +24 -0
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +25 -0
- data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +20 -0
- data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +16 -0
- data/app/lib/actions/pulp3/repository/create_publication.rb +1 -5
- data/app/lib/actions/pulp3/repository/import_upload.rb +21 -0
- data/app/lib/actions/pulp3/repository/save_artifact.rb +19 -0
- data/app/lib/actions/pulp3/repository/save_version.rb +3 -2
- data/app/lib/actions/pulp3/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_file.rb +76 -0
- data/app/lib/katello/api/v2/rendering.rb +1 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +34 -2
- data/app/lib/katello/errors.rb +21 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +0 -9
- data/app/lib/katello/resources/candlepin/owner.rb +0 -5
- data/app/lib/katello/resources/candlepin/product.rb +2 -6
- data/app/lib/katello/resources/registry.rb +25 -10
- data/app/lib/katello/util/filter_clause_generator.rb +1 -1
- data/app/lib/katello/util/module_stream_clause_generator.rb +49 -0
- data/app/lib/katello/util/package_clause_generator.rb +1 -1
- data/app/models/katello/ansible_collection.rb +5 -8
- data/app/models/katello/ansible_collection_tag.rb +8 -0
- data/app/models/katello/ansible_tag.rb +8 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +16 -14
- data/app/models/katello/concerns/pulp_database_unit.rb +27 -4
- data/app/models/katello/concerns/search_by_repository_name.rb +4 -1
- data/app/models/katello/concerns/smart_proxy_extensions.rb +44 -20
- data/app/models/katello/content_view_docker_filter.rb +15 -2
- data/app/models/katello/content_view_filter.rb +28 -8
- data/app/models/katello/content_view_module_stream_filter.rb +14 -0
- data/app/models/katello/content_view_module_stream_filter_rule.rb +11 -0
- data/app/models/katello/content_view_package_filter.rb +18 -8
- data/app/models/katello/content_view_version.rb +7 -2
- data/app/models/katello/deb.rb +0 -8
- data/app/models/katello/docker_manifest.rb +0 -8
- data/app/models/katello/docker_manifest_list.rb +0 -8
- data/app/models/katello/docker_meta_tag.rb +38 -20
- data/app/models/katello/docker_tag.rb +22 -33
- data/app/models/katello/erratum.rb +10 -8
- data/app/models/katello/file_unit.rb +1 -13
- data/app/models/katello/glue/candlepin/owner.rb +0 -5
- data/app/models/katello/glue/candlepin/product.rb +1 -5
- data/app/models/katello/glue/pulp/repo.rb +1 -1
- data/app/models/katello/host/content_facet.rb +6 -0
- data/app/models/katello/host_collection.rb +4 -0
- data/app/models/katello/installed_package.rb +4 -0
- data/app/models/katello/module_stream.rb +1 -12
- data/app/models/katello/ostree_branch.rb +0 -7
- data/app/models/katello/package_group.rb +0 -7
- data/app/models/katello/ping.rb +10 -3
- data/app/models/katello/pool.rb +11 -1
- data/app/models/katello/puppet_module.rb +0 -7
- data/app/models/katello/repository.rb +15 -6
- data/app/models/katello/repository_docker_meta_tag.rb +7 -0
- data/app/models/katello/repository_docker_tag.rb +7 -0
- data/app/models/katello/repository_file_unit.rb +7 -0
- data/app/models/katello/rhsm_fact_name.rb +5 -1
- data/app/models/katello/rhsm_fact_parser.rb +17 -1
- data/app/models/katello/root_repository.rb +11 -6
- data/app/models/katello/rpm.rb +0 -8
- data/app/models/katello/srpm.rb +0 -8
- data/app/models/katello/upstream_pool.rb +2 -0
- data/app/models/katello/yum_metadata_file.rb +0 -4
- data/app/models/setting/content.rb +124 -128
- data/app/services/katello/candlepin/consumer.rb +0 -1
- data/app/services/katello/pulp/content.rb +11 -4
- data/app/services/katello/pulp/docker_tag.rb +0 -1
- data/app/services/katello/pulp/pulp_content_unit.rb +4 -0
- data/app/services/katello/pulp/repository.rb +53 -0
- data/app/services/katello/pulp/repository/file.rb +1 -1
- data/app/services/katello/pulp/repository/puppet.rb +8 -1
- data/app/services/katello/pulp/repository/yum.rb +42 -9
- data/app/services/katello/pulp/smart_proxy_repository.rb +13 -96
- data/app/services/katello/pulp3/ansible_collection.rb +7 -3
- data/app/services/katello/pulp3/content.rb +60 -0
- data/app/services/katello/pulp3/docker_blob.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
- data/app/services/katello/pulp3/docker_tag.rb +2 -2
- data/app/services/katello/pulp3/file_unit.rb +7 -1
- data/app/services/katello/pulp3/pulp_content_unit.rb +15 -5
- data/app/services/katello/pulp3/repository.rb +301 -24
- data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
- data/app/services/katello/pulp3/repository/docker.rb +54 -9
- data/app/services/katello/pulp3/repository/file.rb +8 -0
- data/app/services/katello/pulp3/repository/yum.rb +61 -0
- data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -0
- data/app/services/katello/repository_type_manager.rb +7 -0
- data/app/services/katello/smart_proxy_helper.rb +50 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
- data/app/views/katello/api/v2/ansible_collections/base.json.rabl +5 -0
- data/app/views/katello/api/v2/ansible_collections/show.json.rabl +7 -0
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -0
- data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_filters/base.json.rabl +5 -0
- data/app/views/katello/api/v2/content_view_filters/show.json.rabl +2 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/erratum.json.rabl +2 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/server_status.json.rabl +0 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/show.json.rabl +0 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/version.json.rabl +0 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
- data/app/views/katello/api/v2/subscriptions/permissions.rabl +11 -0
- data/config/katello.yaml.example +9 -0
- data/config/routes.rb +2 -1
- data/config/routes/api/v2.rb +2 -2
- data/db/migrate/20180920214134_create_repository_root.rb +1 -1
- data/db/migrate/20190730183518_add_docker_tag_join_table.rb +25 -0
- data/db/migrate/20190730203334_add_docker_meta_tag_join_table.rb +25 -0
- data/db/migrate/20190814025338_create_content_view_module_stream_filter_rules.rb +13 -0
- data/db/migrate/20190816162733_rename_ansible_collection_whitelist_to_requirements.rb +5 -0
- data/db/migrate/20190822144300_add_ansible_fields.rb +18 -0
- data/db/migrate/20190912210927_rename_repository_file_unit.rb +12 -0
- data/engines/bastion/README.md +2 -2
- data/engines/bastion/app/assets/javascripts/bastion/components/bst-edit.directive.js +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +20 -6
- data/engines/bastion/app/assets/javascripts/bastion/components/views/bst-modal.html +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/layouts/partials/table.html +2 -1
- data/engines/bastion/app/assets/stylesheets/bastion/overrides.scss +1 -0
- data/engines/bastion/lib/bastion.rb +1 -0
- data/engines/bastion_katello/README.md +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.factory.js +28 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.module.js +15 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-destroy-modal.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +2 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +4 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +13 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +47 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-module-stream-filter.controller.js +68 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-rule-matching-package-modal.controller.js +37 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/module-stream-list-filter.controller.js +73 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +14 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-details.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-rule-matching-package-modal.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +41 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +44 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +21 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ansible-collections.html +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/download-policy.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +24 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +29 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +8 -0
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +8 -8
- data/lib/katello/engine.rb +0 -4
- data/lib/katello/plugin.rb +19 -1
- data/lib/katello/repository_types/yum.rb +2 -0
- data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
- data/lib/katello/tasks/reimport.rake +1 -1
- data/lib/katello/version.rb +1 -1
- data/package.json +9 -5
- data/webpack/__mocks__/foremanReact/common/helpers.js +4 -1
- data/webpack/__mocks__/foremanReact/components/PermissionDenied/index.js +2 -0
- data/webpack/components/Content/ContentPage.js +55 -0
- data/webpack/{scenes/ModuleStreams/ModuleStreamsTable.js → components/Content/ContentTable.js} +9 -8
- data/webpack/components/Content/Details/ContentDetailInfo.js +33 -0
- data/webpack/{scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js → components/Content/Details/ContentDetailRepositories.js} +4 -4
- data/webpack/{scenes/ModuleStreams/Details/Repositories/TableSchema.js → components/Content/Details/ContentDetailRepositoryTableSchema.js} +1 -1
- data/webpack/components/Content/Details/ContentDetails.js +70 -0
- data/webpack/components/Content/Details/__tests__/ContentDetailInfo.test.js +28 -0
- data/webpack/components/Content/Details/__tests__/ContentDetailRepositories.test.js +22 -0
- data/webpack/components/Content/Details/__tests__/ContentDetails.test.js +64 -0
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap +39 -0
- data/webpack/{scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap → components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap} +3 -9
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +137 -0
- data/webpack/components/Content/__tests__/ContentPage.test.js +36 -0
- data/webpack/components/Content/__tests__/ContentTable.test.js +40 -0
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +70 -0
- data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +33 -0
- data/webpack/components/Search/index.js +6 -7
- data/webpack/components/SelectOrg/SelectOrgAction.js +20 -22
- data/webpack/containers/Application/config.js +10 -0
- data/webpack/containers/Application/overrides.scss +5 -0
- data/webpack/move_to_foreman/common/helpers.js +1 -1
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +5 -2
- data/webpack/move_to_foreman/components/common/table/formatters/EntitlementsInlineEditFormatter.js +9 -2
- data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +2 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +3 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +1 -0
- data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +10 -10
- data/webpack/redux/actions/RedHatRepositories/__tests__/enabled.test.js +39 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +24 -24
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +23 -22
- data/webpack/redux/actions/RedHatRepositories/sets.js +17 -21
- data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/__tests__/sets.test.js +1 -1
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +42 -33
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +2 -1
- data/webpack/redux/reducers/RedHatRepositories/sets.js +2 -1
- data/webpack/redux/reducers/index.js +4 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +30 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsConstants.js +3 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsPage.js +80 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +39 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +60 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTables.scss +0 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetails.js +91 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +23 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsConstants.js +3 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +30 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionsSchema.js +35 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailInfo.test.js +16 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.fixtures.js +25 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +29 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +41 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsReducer.test.js +33 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailInfo.test.js.snap +83 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetails.test.js.snap +190 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsActions.test.js.snap +54 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsReducer.test.js.snap +50 -0
- data/webpack/scenes/AnsibleCollections/Details/index.js +17 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +25 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollections.fixtures.js +52 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsActions.test.js +48 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsReducer.test.js +46 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +27 -0
- data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionPage.test.js.snap +73 -0
- data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionsTable.test.js.snap +81 -0
- data/webpack/scenes/AnsibleCollections/index.js +17 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleDetailsSchema.js +56 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +7 -71
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +9 -11
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +5 -3
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +453 -507
- data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +10 -11
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +12 -33
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -4
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +8 -9
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +5 -3
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +83 -65
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +1 -1
- data/webpack/scenes/Organizations/OrganizationActions.js +27 -32
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +12 -12
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +1 -1
- data/webpack/scenes/Products/ProductActions.js +10 -10
- data/webpack/scenes/Products/__tests__/ProductActions.test.js +6 -6
- data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +118 -0
- data/webpack/scenes/RedHatRepositories/__tests__/RedHatRepositoriesPage.test.js +51 -0
- data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +117 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +44 -45
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/EnabledRepository.test.js +84 -5
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +46 -47
- data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
- data/webpack/scenes/RedHatRepositories/index.js +2 -101
- data/webpack/scenes/Settings/Tables/TableActions.js +42 -43
- data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +18 -18
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +10 -10
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +8 -8
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +142 -113
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +8 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +40 -40
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +24 -24
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -199
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +52 -46
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +21 -2
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +64 -42
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +21 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +20 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -15
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +12 -13
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -14
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +21 -23
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +35 -1
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +13 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +7 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +18 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +5 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +26 -5
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +9 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +27 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +5 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Dialogs/UpdateDialog.js +9 -9
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +8 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -23
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +0 -135
- data/webpack/scenes/Subscriptions/index.js +2 -0
- data/webpack/scenes/Tasks/TaskActions.js +36 -31
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +35 -47
- metadata +146 -67
- data/app/controllers/katello/api/v2/ping_controller.rb +0 -24
- data/app/lib/actions/katello/capsule_content/create_repos.rb +0 -30
- data/app/lib/actions/katello/capsule_content/remove_orphans.rb +0 -21
- data/app/lib/actions/pulp/repository/refresh_needed.rb +0 -37
- data/app/lib/katello/resources/candlepin/owner_info.rb +0 -18
- data/app/models/katello/glue/candlepin/owner_info.rb +0 -41
- data/app/models/katello/repository_file.rb +0 -7
- data/app/overrides/add_subscription_status.rb +0 -6
- data/app/views/overrides/hosts/_subscription_link.html.erb +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-events.controller.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -58
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-product-details.controller.js +0 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-products.controller.js +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +0 -120
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-products.html +0 -54
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/grouped.filter.js +0 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-details.controller.js +0 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-history.controller.js +0 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +0 -261
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest.controller.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +0 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +0 -46
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -92
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +0 -33
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-start-date.directive.js +0 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-type.directive.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptionAttachAmountFilter.filter.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.controller.js +0 -73
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +0 -110
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-type.html +0 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions-delete-bulk.html +0 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +0 -63
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +0 -52
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +0 -16
@@ -183,15 +183,6 @@ module Katello
|
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
|
-
def events(uuid)
|
187
|
-
response = Candlepin::CandlepinResource.get(join_path(path(uuid), 'events'), self.default_headers).body
|
188
|
-
if response.present?
|
189
|
-
::Katello::Util::Data.array_with_indifferent_access JSON.parse(response)
|
190
|
-
else
|
191
|
-
return []
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
186
|
def content_overrides(id)
|
196
187
|
result = Candlepin::CandlepinResource.get(join_path(path(id), 'content_overrides'), self.default_headers).body
|
197
188
|
::Katello::Util::Data.array_with_indifferent_access(JSON.parse(result))
|
@@ -101,11 +101,6 @@ module Katello
|
|
101
101
|
OpenSSL::PKCS12.create(password, name, p, c, nil, "PBE-SHA1-3DES", "PBE-SHA1-3DES")
|
102
102
|
end
|
103
103
|
|
104
|
-
def events(key)
|
105
|
-
response = self.get(join_path(path(key), 'events'), self.default_headers).body
|
106
|
-
::Katello::Util::Data.array_with_indifferent_access JSON.parse(response)
|
107
|
-
end
|
108
|
-
|
109
104
|
def service_levels(uuid)
|
110
105
|
response = Candlepin::CandlepinResource.get(join_path(path(uuid), 'servicelevels'), self.default_headers).body
|
111
106
|
if response.empty?
|
@@ -72,12 +72,8 @@ module Katello
|
|
72
72
|
|
73
73
|
def create_unlimited_subscription(owner_key, product_id, start_date)
|
74
74
|
start_date ||= Time.now
|
75
|
-
|
76
|
-
|
77
|
-
# 2049 year correctly. Refer the links below for more details:
|
78
|
-
# https://bugzilla.redhat.com/show_bug.cgi?id=1789654
|
79
|
-
# https://github.com/candlepin/candlepin/blob/5b87865f304555c112982af4fbc83a1c463d37b2/server/src/main/java/org/candlepin/model/UeberCertificateGenerator.java#L247
|
80
|
-
end_date = Time.parse('2049-12-01 00:00:00 +0000')
|
75
|
+
# End it 100 years from now
|
76
|
+
end_date ||= start_date + 10_950.days
|
81
77
|
|
82
78
|
pool = {
|
83
79
|
'startDate' => start_date,
|
@@ -12,22 +12,37 @@ module Katello
|
|
12
12
|
|
13
13
|
def self.get(path, headers = {:accept => :json})
|
14
14
|
logger.debug "Sending GET request to Registry: #{path}"
|
15
|
-
client = RegistryResource.rest_client(Net::HTTP::Get, :get, path)
|
15
|
+
client = RegistryResource.load_class.rest_client(Net::HTTP::Get, :get, path)
|
16
16
|
client.get(headers)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class RegistryResource < HttpResource
|
21
|
-
if SETTINGS[:katello][:container_image_registry]
|
22
|
-
cfg = SETTINGS[:katello][:container_image_registry]
|
23
|
-
url = cfg[:crane_url]
|
24
|
-
uri = URI.parse(url)
|
25
|
-
self.prefix = uri.path
|
26
|
-
self.site = "#{uri.scheme}://#{uri.host}:#{uri.port}"
|
27
|
-
self.ca_cert_file = cfg[:crane_ca_cert_file]
|
28
|
-
end
|
29
|
-
|
30
21
|
class << self
|
22
|
+
def load_class
|
23
|
+
container_config = SETTINGS.dig(:katello, :container_image_registry)
|
24
|
+
registry_url = nil
|
25
|
+
pulp_master = ::SmartProxy.pulp_master
|
26
|
+
|
27
|
+
# Pulp 3 has its own registry
|
28
|
+
if pulp_master && pulp_master.pulp3_repository_type_support?(::Katello::Repository::DOCKER_TYPE)
|
29
|
+
registry_url = pulp_master.setting('Pulp3', 'content_app_url')
|
30
|
+
# Assume the registry uses the same CA as the Smart Proxy
|
31
|
+
ca_cert_file = Setting[:ssl_ca_file]
|
32
|
+
elsif container_config
|
33
|
+
registry_url = container_config[:crane_url]
|
34
|
+
ca_cert_file = container_config[:registry_ca_cert_file]
|
35
|
+
end
|
36
|
+
|
37
|
+
fail Errors::ContainerRegistryNotConfigured unless registry_url
|
38
|
+
|
39
|
+
uri = URI.parse(registry_url)
|
40
|
+
self.prefix = uri.path
|
41
|
+
self.site = "#{uri.scheme}://#{uri.host}:#{uri.port}"
|
42
|
+
self.ca_cert_file = ca_cert_file
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
31
46
|
def process_response(response)
|
32
47
|
debug_level = response.code >= 400 ? :error : :debug
|
33
48
|
logger.send(debug_level, "Registry request returned with code #{response.code}")
|
@@ -54,7 +54,7 @@ module Katello
|
|
54
54
|
filters = fetch_filters.send(list_type).where(:id => @filters) # abstract
|
55
55
|
if filters.any?
|
56
56
|
# generate the clauses from filters to be implemented by subclasses
|
57
|
-
clauses = collect_clauses(@repo, filters) # abstract
|
57
|
+
clauses = collect_clauses(@repo, filters) || [] # abstract
|
58
58
|
clauses.delete_if { |cls| cls.blank? }
|
59
59
|
if clauses.any?
|
60
60
|
clauses
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Katello
|
2
|
+
module Util
|
3
|
+
class ModuleStreamClauseGenerator
|
4
|
+
include Util::FilterClauseGenerator
|
5
|
+
|
6
|
+
protected
|
7
|
+
|
8
|
+
def fetch_filters
|
9
|
+
ContentViewFilter.module_stream.or(ContentViewFilter.errata)
|
10
|
+
end
|
11
|
+
|
12
|
+
def whitelist_non_matcher_clause
|
13
|
+
{"_id" => {"$not" => {"$exists" => true}}}
|
14
|
+
end
|
15
|
+
|
16
|
+
def whitelist_all_matcher_clause
|
17
|
+
{"_id" => {"$exists" => true}}
|
18
|
+
end
|
19
|
+
|
20
|
+
def collect_clauses(repo, filters)
|
21
|
+
[ContentViewErratumFilter, ContentViewModuleStreamFilter].collect do |filter_class|
|
22
|
+
content_type_filters = filters.where(:type => filter_class.to_s)
|
23
|
+
make_module_stream_clauses(repo, content_type_filters) unless content_type_filters.empty?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def make_module_stream_clauses(repo, filters)
|
28
|
+
content_type = filters.first.content_type
|
29
|
+
clauses = filters.collect do |filter|
|
30
|
+
filter.generate_clauses(repo)
|
31
|
+
end
|
32
|
+
clauses.flatten!
|
33
|
+
clauses.compact!
|
34
|
+
module_stream_clauses_from_content(content_type, clauses) unless clauses.empty?
|
35
|
+
end
|
36
|
+
|
37
|
+
def module_stream_clauses_from_content(content_type, clauses)
|
38
|
+
module_streams = []
|
39
|
+
case content_type
|
40
|
+
when ContentViewFilter::ERRATA
|
41
|
+
module_streams = Katello::Erratum.list_modular_streams_by_clauses(@repo, clauses)
|
42
|
+
when ContentViewFilter::MODULE_STREAM
|
43
|
+
module_streams = ModuleStream.where(:id => clauses)
|
44
|
+
end
|
45
|
+
{'_id' => { "$in" => module_streams.pluck(:pulp_id)}} unless module_streams.empty?
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -3,24 +3,21 @@ module Katello
|
|
3
3
|
include Concerns::PulpDatabaseUnit
|
4
4
|
|
5
5
|
self.table_name = 'katello_ansible_collections'
|
6
|
-
|
7
6
|
CONTENT_TYPE = 'ansible collection'.freeze
|
8
7
|
|
9
|
-
has_many :
|
10
|
-
has_many :
|
8
|
+
has_many :ansible_collection_tags, :class_name => "Katello::AnsibleCollectionTag", :dependent => :delete_all
|
9
|
+
has_many :tags, :through => :ansible_collection_tags
|
11
10
|
|
12
11
|
scoped_search :on => :name, :complete_value => true
|
13
|
-
scoped_search :on => :namespace, :complete_value => true
|
12
|
+
scoped_search :on => :namespace, :complete_value => true, :rename => :author
|
14
13
|
scoped_search :on => :version, :complete_value => true
|
14
|
+
scoped_search :on => :checksum, :complete_value => true
|
15
|
+
scoped_search :on => :name, :complete_value => true, :relation => :tags, :rename => :tag
|
15
16
|
|
16
17
|
def self.default_sort
|
17
18
|
order(:name)
|
18
19
|
end
|
19
20
|
|
20
|
-
def self.repository_association_class
|
21
|
-
RepositoryAnsibleCollection
|
22
|
-
end
|
23
|
-
|
24
21
|
def self.unit_id_field
|
25
22
|
'ansible_collection_id'
|
26
23
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Katello
|
2
|
+
class AnsibleCollectionTag < ApplicationRecord
|
3
|
+
self.table_name = 'katello_ansible_collection_tags'
|
4
|
+
|
5
|
+
belongs_to :ansible_collection, :inverse_of => :ansible_collection_tags, :class_name => 'Katello::AnsibleCollection'
|
6
|
+
belongs_to :tag, :inverse_of => :ansible_collection_tags, :class_name => 'Katello::AnsibleTag', :foreign_key => :ansible_tag_id
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Katello
|
2
|
+
class AnsibleTag < ApplicationRecord
|
3
|
+
self.table_name = 'katello_ansible_tags'
|
4
|
+
|
5
|
+
has_many :ansible_collection_tags, :class_name => "Katello::AnsibleCollectionTag", :dependent => :delete_all
|
6
|
+
has_many :ansible_collections, :through => :ansible_collection_tags
|
7
|
+
end
|
8
|
+
end
|
@@ -174,24 +174,24 @@ module Katello
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def sync_package_associations(new_installed_package_ids)
|
177
|
-
|
178
|
-
|
177
|
+
Katello::Util::Support.active_record_retry do
|
178
|
+
old_associated_ids = self.reload.installed_package_ids
|
179
|
+
table_name = self.host_installed_packages.table_name
|
179
180
|
|
180
|
-
|
181
|
-
|
181
|
+
new_ids = new_installed_package_ids - old_associated_ids
|
182
|
+
delete_ids = old_associated_ids - new_installed_package_ids
|
182
183
|
|
183
|
-
|
184
|
+
queries = []
|
184
185
|
|
185
|
-
|
186
|
-
|
187
|
-
|
186
|
+
if delete_ids.any?
|
187
|
+
queries << "DELETE FROM #{table_name} WHERE host_id=#{self.id} AND installed_package_id IN (#{delete_ids.join(', ')})"
|
188
|
+
end
|
188
189
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
190
|
+
unless new_ids.empty?
|
191
|
+
inserts = new_ids.map { |unit_id| "(#{unit_id.to_i}, #{self.id.to_i})" }
|
192
|
+
queries << "INSERT INTO #{table_name} (installed_package_id, host_id) VALUES #{inserts.join(', ')}"
|
193
|
+
end
|
193
194
|
|
194
|
-
ActiveRecord::Base.transaction do
|
195
195
|
queries.each do |query|
|
196
196
|
ActiveRecord::Base.connection.execute(query)
|
197
197
|
end
|
@@ -282,5 +282,7 @@ module Katello
|
|
282
282
|
end
|
283
283
|
|
284
284
|
class ::Host::Managed::Jail < Safemode::Jail
|
285
|
-
allow :content_source, :subscription_manager_configuration_url, :rhsm_organization_label
|
285
|
+
allow :content_source, :subscription_manager_configuration_url, :rhsm_organization_label,
|
286
|
+
:host_collections, :comment, :pools, :hypervisor_host, :lifecycle_environment, :content_view,
|
287
|
+
:installed_packages
|
286
288
|
end
|
@@ -3,9 +3,16 @@ require 'set'
|
|
3
3
|
module Katello
|
4
4
|
module Concerns::PulpDatabaseUnit
|
5
5
|
extend ActiveSupport::Concern
|
6
|
-
include Katello::Concerns::SearchByRepositoryName
|
7
|
-
|
8
6
|
# Class.repository_association_class
|
7
|
+
included do
|
8
|
+
if many_repository_associations
|
9
|
+
# rubocop:disable Rails/ReflectionClassName
|
10
|
+
has_many repository_association.to_sym, class_name: repository_association_class_name,
|
11
|
+
dependent: :delete_all, inverse_of: association_name
|
12
|
+
has_many :repositories, through: repository_association.to_sym, class_name: "Katello::Repository"
|
13
|
+
include ::Katello::Concerns::SearchByRepositoryName
|
14
|
+
end
|
15
|
+
end
|
9
16
|
|
10
17
|
def backend_data
|
11
18
|
self.class.pulp_data(pulp_id) || {}
|
@@ -15,7 +22,23 @@ module Katello
|
|
15
22
|
self.class.repository_association_class.where(:repository_id => repo_id, self.class.unit_id_field.to_sym => self.id).delete_all
|
16
23
|
end
|
17
24
|
|
25
|
+
def library_repositories
|
26
|
+
self.repositories.where(library_instance: nil)
|
27
|
+
end
|
28
|
+
|
18
29
|
module ClassMethods
|
30
|
+
def association_name
|
31
|
+
self.name.demodulize.underscore
|
32
|
+
end
|
33
|
+
|
34
|
+
def repository_association_class_name
|
35
|
+
"::Katello::Repository#{self.name.demodulize}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def repository_association_class
|
39
|
+
repository_association_class_name.constantize
|
40
|
+
end
|
41
|
+
|
19
42
|
def content_type
|
20
43
|
self::CONTENT_TYPE
|
21
44
|
end
|
@@ -25,11 +48,11 @@ module Katello
|
|
25
48
|
end
|
26
49
|
|
27
50
|
def many_repository_associations
|
28
|
-
|
51
|
+
self != YumMetadataFile
|
29
52
|
end
|
30
53
|
|
31
54
|
def repository_association
|
32
|
-
|
55
|
+
repository_association_class_name.demodulize.pluralize.underscore
|
33
56
|
end
|
34
57
|
|
35
58
|
def immutable_unit_types
|
@@ -5,7 +5,10 @@ module Katello
|
|
5
5
|
include ScopedSearchExtensions
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
8
|
+
has_many :root_repositories, through: :repositories, :source => :root, class_name: "Katello::RootRepository"
|
9
|
+
scoped_search :relation => :root_repositories, :on => :name, :rename => :repository,
|
10
|
+
:complete_value => true,
|
11
|
+
:ext_method => :search_by_repo_name, :only_explicit => true
|
9
12
|
end
|
10
13
|
|
11
14
|
module ClassMethods
|
@@ -83,12 +83,12 @@ module Katello
|
|
83
83
|
features = [PULP_NODE_FEATURE]
|
84
84
|
features << PULP_FEATURE if include_default
|
85
85
|
|
86
|
-
with_features(features).joins(:capsule_lifecycle_environments).
|
86
|
+
unscoped.with_features(features).joins(:capsule_lifecycle_environments).
|
87
87
|
where(katello_capsule_lifecycle_environments: { lifecycle_environment_id: environment.id })
|
88
88
|
end
|
89
89
|
|
90
90
|
def self.sync_needed?(environment)
|
91
|
-
with_environment(environment).any?
|
91
|
+
unscoped.with_environment(environment).any?
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -117,8 +117,9 @@ module Katello
|
|
117
117
|
|
118
118
|
def pulp3_configuration(config_class)
|
119
119
|
config_class.new do |config|
|
120
|
-
|
121
|
-
config.
|
120
|
+
uri = pulp3_uri!
|
121
|
+
config.host = uri.host
|
122
|
+
config.scheme = uri.scheme
|
122
123
|
config.username = 'admin'
|
123
124
|
config.password = 'password'
|
124
125
|
config.debugging = true
|
@@ -139,24 +140,45 @@ module Katello
|
|
139
140
|
end
|
140
141
|
|
141
142
|
def pulp3_support?(repository)
|
142
|
-
|
143
|
-
type.pulp3_plugin && self.capabilities('Pulp3').try(:include?, type.pulp3_plugin)
|
143
|
+
pulp3_repository_type_support?(repository.content_type)
|
144
144
|
end
|
145
145
|
|
146
|
-
def
|
147
|
-
|
148
|
-
|
149
|
-
|
146
|
+
def pulp2_preferred_for_type?(repository_type)
|
147
|
+
if SETTINGS[:katello][:use_pulp_2_for_content_type].nil? ||
|
148
|
+
SETTINGS[:katello][:use_pulp_2_for_content_type][repository_type.to_sym].nil?
|
149
|
+
return false
|
150
|
+
else
|
151
|
+
return SETTINGS[:katello][:use_pulp_2_for_content_type][repository_type.to_sym]
|
152
|
+
end
|
150
153
|
end
|
151
154
|
|
152
|
-
def
|
153
|
-
|
155
|
+
def pulp3_repository_type_support?(repository_type)
|
156
|
+
repository_type_obj = repository_type.is_a?(String) ? Katello::RepositoryTypeManager.repository_types[repository_type] : repository_type
|
157
|
+
fail "Cannot find repository type #{repository_type}, is it enabled?" unless repository_type_obj
|
158
|
+
repository_type_obj.pulp3_plugin.present? && pulp3_enabled? && self.capabilities(PULP3_FEATURE).try(:include?, repository_type_obj.pulp3_plugin) && !pulp2_preferred_for_type?(repository_type_obj.id)
|
159
|
+
end
|
160
|
+
|
161
|
+
def pulp3_content_support?(content_type)
|
162
|
+
content_type_obj = content_type.is_a?(String) ? Katello::RepositoryTypeManager.find_content_type(content_type) : content_type
|
163
|
+
fail "Cannot find content type #{content_type}." unless content_type_obj
|
164
|
+
|
165
|
+
found_type = Katello::RepositoryTypeManager.repository_types.values.find { |repo_type| repo_type.content_types.include?(content_type_obj) }
|
166
|
+
fail "Cannot find repository type for content_type #{content_type}, is it enabled?" unless found_type
|
167
|
+
pulp3_repository_type_support?(found_type)
|
168
|
+
end
|
169
|
+
|
170
|
+
def pulp3_uri!
|
171
|
+
url = self.setting(PULP3_FEATURE, 'pulp_url')
|
154
172
|
fail "Cannot determine pulp3 url, check smart proxy configuration" unless url
|
155
|
-
URI.parse(url)
|
173
|
+
URI.parse(url)
|
174
|
+
end
|
175
|
+
|
176
|
+
def pulp3_host!
|
177
|
+
pulp3_uri!.host
|
156
178
|
end
|
157
179
|
|
158
180
|
def pulp3_url(path = nil)
|
159
|
-
pulp_url = self.setting(
|
181
|
+
pulp_url = self.setting(PULP3_FEATURE, 'pulp_url')
|
160
182
|
path.blank? ? pulp_url : "#{pulp_url.sub(%r|/$|, '')}/#{path.sub(%r|^/|, '')}"
|
161
183
|
end
|
162
184
|
|
@@ -188,12 +210,8 @@ module Katello
|
|
188
210
|
end
|
189
211
|
|
190
212
|
def content_service(content_type)
|
191
|
-
if content_type.is_a?(String)
|
192
|
-
|
193
|
-
end
|
194
|
-
|
195
|
-
#this will rely on smart proxy capabilities when available
|
196
|
-
content_pulp3_support?(content_type) ? content_type.pulp3_service_class : content_type.pulp2_service_class
|
213
|
+
content_type = RepositoryTypeManager.find_content_type(content_type) if content_type.is_a?(String)
|
214
|
+
pulp3_content_support?(content_type) ? content_type.pulp3_service_class : content_type.pulp2_service_class
|
197
215
|
end
|
198
216
|
|
199
217
|
def set_default_download_policy
|
@@ -254,6 +272,12 @@ module Katello
|
|
254
272
|
raise ::Katello::Errors::CapsuleCannotBeReached, _("%s is unreachable. %s" % [self.name, error])
|
255
273
|
end
|
256
274
|
|
275
|
+
def ping_pulp3
|
276
|
+
::Katello::Ping.pulp3_without_auth(self.pulp3_url("api/v3"))
|
277
|
+
rescue Errno::EHOSTUNREACH, Errno::ECONNREFUSED, RestClient::Exception => error
|
278
|
+
raise ::Katello::Errors::CapsuleCannotBeReached, _("%s is unreachable. %s" % [self.name, error])
|
279
|
+
end
|
280
|
+
|
257
281
|
def verify_ueber_certs
|
258
282
|
self.organizations.each do |org|
|
259
283
|
Cert::Certs.verify_ueber_cert(org)
|
@@ -21,18 +21,31 @@ module Katello
|
|
21
21
|
{ "_id" => { "$in" => manifest_tags } } unless manifest_tags.empty?
|
22
22
|
end
|
23
23
|
|
24
|
+
def content_unit_pulp_ids(repo)
|
25
|
+
manifest_tags = []
|
26
|
+
self.docker_rules.each do |rule|
|
27
|
+
manifest_tags.concat(query_manifests(repo, rule))
|
28
|
+
end
|
29
|
+
|
30
|
+
manifest_tags
|
31
|
+
end
|
32
|
+
|
24
33
|
protected
|
25
34
|
|
26
35
|
def fetch_tag_pulp_ids(repo, rule, manifest_klass = DockerManifest)
|
27
36
|
query_name = rule.name.tr("*", "%")
|
28
|
-
tags_query = ::Katello::DockerTag.where(:
|
37
|
+
tags_query = ::Katello::DockerTag.where(:id => ::Katello::RepositoryDockerTag.
|
38
|
+
where(:repository_id => repo.id).select(:docker_tag_id)).
|
29
39
|
where(:docker_taggable_type => manifest_klass.name).
|
30
40
|
where("name ilike ?", query_name).
|
31
41
|
select(:docker_taggable_id)
|
32
42
|
|
33
43
|
query = manifest_klass.in_repositories(repo).where("id in (#{tags_query.to_sql})")
|
34
44
|
names = query.all.collect do |manifest|
|
35
|
-
manifest.docker_tags.where(:
|
45
|
+
manifest.docker_tags.where(:id => ::Katello::RepositoryDockerTag.
|
46
|
+
where(:repository_id => repo.id).
|
47
|
+
select(:docker_tag_id)).where("name ilike ?", query_name).
|
48
|
+
all.collect do |tag|
|
36
49
|
tag.pulp_id
|
37
50
|
end
|
38
51
|
end
|