katello 3.8.1 → 3.9.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/README.md +7 -7
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +16 -9
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/api_controller.rb +20 -22
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +5 -1
- data/app/controllers/katello/api/v2/content_view_histories_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +12 -12
- data/app/controllers/katello/api/v2/content_views_controller.rb +15 -1
- data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +12 -4
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +12 -0
- data/app/controllers/katello/api/v2/module_streams_controller.rb +49 -0
- data/app/controllers/katello/api/v2/organizations_controller.rb +3 -1
- data/app/controllers/katello/api/v2/package_groups_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +5 -4
- data/app/controllers/katello/api/v2/products_controller.rb +1 -1
- data/app/controllers/katello/api/v2/puppet_modules_controller.rb +5 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +80 -84
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +18 -7
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +2 -6
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +13 -24
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +12 -5
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +2 -5
- data/app/controllers/katello/react_controller.rb +2 -0
- data/app/controllers/katello/remote_execution_controller.rb +16 -5
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +0 -2
- data/app/lib/actions/candlepin/import_pool_handler.rb +40 -15
- data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -0
- data/app/lib/actions/katello/content_view/publish.rb +21 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -1
- data/app/lib/actions/katello/environment/destroy.rb +2 -3
- data/app/lib/actions/katello/environment/publish_repositories.rb +1 -1
- data/app/lib/actions/katello/event_queue/monitor.rb +9 -15
- data/app/lib/actions/katello/event_queue/poller_thread.rb +24 -1
- data/app/lib/actions/katello/event_queue/suspended_action.rb +2 -2
- data/app/lib/actions/katello/host/hypervisors_update.rb +82 -22
- data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
- data/app/lib/actions/katello/product/content_create.rb +30 -38
- data/app/lib/actions/katello/product/content_destroy.rb +11 -12
- data/app/lib/actions/katello/product/create.rb +0 -1
- data/app/lib/actions/katello/product/update.rb +0 -2
- data/app/lib/actions/katello/repository/clear.rb +2 -0
- data/app/lib/actions/katello/repository/clone_to_environment.rb +0 -2
- data/app/lib/actions/katello/repository/clone_to_version.rb +15 -3
- data/app/lib/actions/katello/repository/clone_yum_content.rb +21 -2
- data/app/lib/actions/katello/repository/clone_yum_metadata.rb +1 -1
- data/app/lib/actions/katello/repository/correct_checksum.rb +5 -5
- data/app/lib/actions/katello/repository/create.rb +7 -7
- data/app/lib/actions/katello/repository/create_root.rb +22 -0
- data/app/lib/actions/katello/repository/destroy.rb +11 -6
- data/app/lib/actions/katello/repository/discover.rb +5 -3
- data/app/lib/actions/katello/repository/export.rb +1 -1
- data/app/lib/actions/katello/repository/fetch_pxe_files.rb +13 -27
- data/app/lib/actions/katello/repository/index_module_streams.rb +16 -0
- data/app/lib/actions/katello/repository/metadata_generate.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +0 -2
- data/app/lib/actions/katello/repository/update.rb +15 -28
- data/app/lib/actions/katello/repository_set/disable_repository.rb +5 -13
- data/app/lib/actions/katello/repository_set/enable_repository.rb +3 -16
- data/app/lib/actions/katello/repository_set/scan_cdn.rb +4 -32
- data/app/lib/actions/katello/sync_plan/run.rb +37 -0
- data/app/lib/actions/pulp/abstract.rb +7 -2
- data/app/lib/actions/pulp/abstract_async_task.rb +1 -0
- data/app/lib/actions/pulp/consumer/generate_applicability.rb +1 -0
- data/app/lib/actions/pulp/repository/copy_module_default.rb +11 -0
- data/app/lib/actions/pulp/repository/copy_module_stream.rb +11 -0
- data/app/lib/actions/pulp/repository/create.rb +2 -0
- data/app/lib/actions/pulp/repository/distributor_publish.rb +3 -2
- data/app/lib/actions/pulp/repository/remove_module_default.rb +11 -0
- data/app/lib/actions/pulp/repository/remove_module_stream.rb +11 -0
- data/app/lib/actions/pulp/repository/sync.rb +6 -19
- data/app/lib/actions/pulp/repository/update_importer.rb +9 -7
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +42 -0
- data/app/lib/katello/concerns/renderer_extensions.rb +6 -4
- data/app/lib/katello/http_resource.rb +5 -1
- data/app/lib/katello/repo_discovery.rb +6 -2
- data/app/lib/katello/resources/candlepin/consumer.rb +18 -1
- data/app/lib/katello/resources/candlepin/owner.rb +9 -0
- data/app/lib/katello/resources/candlepin/pool.rb +2 -2
- data/app/lib/katello/validators/root_repository_unique_attribute_validator.rb +13 -0
- data/app/models/katello/authorization/product.rb +3 -4
- data/app/models/katello/authorization/repository.rb +4 -4
- data/app/models/katello/candlepin/repository_mapper.rb +12 -26
- data/app/models/katello/concerns/audit_search.rb +13 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -1
- data/app/models/katello/concerns/content_view_filter_rule_common.rb +1 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +68 -2
- data/app/models/katello/concerns/hostgroup_extensions.rb +13 -0
- data/app/models/katello/concerns/location_extensions.rb +3 -3
- data/app/models/katello/concerns/organization_extensions.rb +7 -3
- data/app/models/katello/concerns/pulp_database_unit.rb +1 -0
- data/app/models/katello/concerns/recurring_logic_extensions.rb +11 -0
- data/app/models/katello/concerns/redhat_extensions.rb +0 -25
- data/app/models/katello/concerns/search_by_repository_name.rb +21 -0
- data/app/models/katello/concerns/setting_extensions.rb +1 -1
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +43 -0
- data/app/models/katello/content.rb +7 -3
- data/app/models/katello/content_view.rb +4 -4
- data/app/models/katello/content_view_component.rb +1 -1
- data/app/models/katello/content_view_history.rb +1 -0
- data/app/models/katello/content_view_version.rb +14 -2
- data/app/models/katello/docker_manifest_list.rb +1 -1
- data/app/models/katello/docker_meta_tag.rb +11 -2
- data/app/models/katello/docker_tag.rb +1 -1
- data/app/models/katello/erratum.rb +6 -0
- data/app/models/katello/file_unit.rb +0 -1
- data/app/models/katello/glue/candlepin/owner.rb +1 -0
- data/app/models/katello/glue/candlepin/pool.rb +1 -2
- data/app/models/katello/glue/candlepin/product.rb +0 -4
- data/app/models/katello/glue/candlepin/repository.rb +0 -21
- data/app/models/katello/glue/provider.rb +4 -2
- data/app/models/katello/glue/pulp/repo.rb +10 -173
- data/app/models/katello/glue/pulp/repos.rb +2 -112
- data/app/models/katello/gpg_key.rb +6 -14
- data/app/models/katello/host/content_facet.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +32 -8
- data/app/models/katello/kt_environment.rb +9 -29
- data/app/models/katello/module_profile.rb +6 -0
- data/app/models/katello/module_profile_rpm.rb +5 -0
- data/app/models/katello/module_stream.rb +112 -0
- data/app/models/katello/module_stream_artifact.rb +5 -0
- data/app/models/katello/ostree_branch.rb +0 -1
- data/app/models/katello/package_group.rb +1 -1
- data/app/models/katello/pool.rb +4 -0
- data/app/models/katello/product.rb +18 -21
- data/app/models/katello/product_content.rb +2 -2
- data/app/models/katello/puppet_module.rb +1 -0
- data/app/models/katello/purpose_addons_status.rb +50 -0
- data/app/models/katello/purpose_role_status.rb +50 -0
- data/app/models/katello/purpose_sla_status.rb +48 -0
- data/app/models/katello/purpose_status.rb +56 -0
- data/app/models/katello/purpose_usage_status.rb +50 -0
- data/app/models/katello/repository.rb +116 -280
- data/app/models/katello/repository_module_stream.rb +7 -0
- data/app/models/katello/root_repository.rb +262 -0
- data/app/models/katello/subscription_status.rb +1 -1
- data/app/models/katello/sync_plan.rb +93 -40
- data/app/presenters/katello/content_view_version_compare_presenter.rb +7 -2
- data/app/services/katello/candlepin/consumer.rb +25 -0
- data/app/services/katello/candlepin/message_handler.rb +18 -2
- data/app/services/katello/managed_content_medium_provider.rb +27 -0
- data/app/services/katello/product_content_finder.rb +3 -3
- data/app/services/katello/pulp/module_stream.rb +9 -0
- data/app/services/katello/pulp/repository.rb +22 -0
- data/app/services/katello/pulp/srpm.rb +1 -1
- data/app/services/katello/pxe_files_downloader.rb +41 -0
- data/app/services/katello/registration_manager.rb +5 -0
- data/app/views/katello/api/v2/content_facet/show.json.rabl +0 -4
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +12 -2
- data/app/views/katello/api/v2/debs/compare.json.rabl +10 -0
- data/app/views/katello/api/v2/docker_manifest_lists/compare.json.rabl +10 -0
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -0
- data/app/views/katello/api/v2/hosts/host_collections.json.rabl +3 -0
- data/app/views/katello/api/v2/module_streams/base.json.rabl +4 -0
- data/app/views/katello/api/v2/module_streams/index.json.rabl +7 -0
- data/app/views/katello/api/v2/module_streams/name_stream.json.rabl +3 -0
- data/app/views/katello/api/v2/module_streams/name_streams.json.rabl +7 -0
- data/app/views/katello/api/v2/module_streams/show.json.rabl +21 -0
- data/app/views/katello/api/v2/organizations/show.json.rabl +4 -1
- data/app/views/katello/api/v2/products/base.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +23 -10
- data/app/views/katello/api/v2/repositories/show.json.rabl +47 -38
- data/app/views/katello/api/v2/smart_proxies/download_policy.json.rabl +1 -0
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/sync_plans/show.json.rabl +2 -1
- data/app/views/katello/layouts/react.html.erb +1 -0
- data/config/katello.yaml.example +1 -2
- data/config/routes.rb +5 -0
- data/config/routes/api/v2.rb +12 -1
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20150114225023_add_upstream_name_to_repository.rb +7 -2
- data/db/migrate/20170208215148_add_docker_repo_name.rb +10 -1
- data/db/migrate/20180326190408_move_subscription_products.rb +2 -0
- data/db/migrate/20180622105300_add_docker_tags_whitelist_to_repository.rb +9 -0
- data/db/migrate/20180725083800_change_repository_password_length.rb +5 -0
- data/db/migrate/20180806205420_add_index_to_content_view_version.rb +5 -0
- data/db/migrate/20180807145652_create_katello_module_streams.rb +88 -0
- data/db/migrate/20180807164405_remove_repository_cp_label.rb +5 -0
- data/db/migrate/20180808013432_add_system_purpose_attrs.rb +39 -0
- data/db/migrate/20180814202747_add_recurring_logic_to_sync_plan.rb +12 -0
- data/db/migrate/20180816142044_add_description_to_katello_module_streams.rb +6 -0
- data/db/migrate/20180821144248_add_cron_logic_to_sync_plans.rb +5 -0
- data/db/migrate/20180828161400_remove_join_table_for_role_and_usage.rb +20 -0
- data/db/migrate/20180917173645_add_source_repo_checksum_type_to_katello_repositories.rb +1 -1
- data/db/migrate/20180920123913_drop_repo_module_streams_timestamp_not_null.rb +7 -0
- data/db/migrate/20180920171008_change_repository_password_to_text.rb +17 -0
- data/db/migrate/20180920214134_create_repository_root.rb +142 -0
- data/db/seeds.d/111-container-image-bookmarks.rb +19 -0
- data/db/seeds.d/111-upgrade_tasks.rb +9 -0
- data/db/seeds.d/150-module_job_templates.rb +12 -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/common/module-stream-actions.service.js +26 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +60 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-host-bulk-module-streams-modal.html +70 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +16 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +8 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +48 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-module-streams.html +68 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +15 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +59 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +81 -27
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories.service.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +7 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +38 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-module-streams.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-package-groups.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-yum.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +7 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-module-streams.html +38 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +6 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-repositories.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/module-stream.factory.js +27 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/module-streams.module.js +15 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/views/partials/module-streams-table.html +25 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +6 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-repositories.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/repositories-filters.service.js +89 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +4 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +15 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +15 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +36 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-module-streams.html +17 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +6 -6
- 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 +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery.html +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/new-sync-plan-modal.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/repository-set.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +20 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +23 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/new-sync-plan.controller.js +10 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/views/new-sync-plan-form.html +11 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plan-helper.service.js +3 -3
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +5 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
- data/lib/katello/engine.rb +7 -12
- data/lib/katello/permission_creator.rb +5 -1
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +38 -14
- data/lib/katello/tasks/clean_backend_objects.rake +7 -3
- data/lib/katello/tasks/reimport.rake +1 -0
- data/lib/katello/tasks/repository.rake +11 -8
- data/lib/katello/tasks/upgrades/3.9/migrate_sync_plans.rake +29 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +11 -7
- data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
- data/webpack/components/MultiSelect/index.js +15 -3
- data/webpack/components/PaginationRow/index.js +1 -1
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +1 -0
- data/webpack/components/Search/index.js +5 -1
- data/webpack/components/SelectOrg/SetOrganization.js +2 -1
- data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +41 -0
- data/webpack/components/WithOrganization/withOrganization.js +42 -10
- data/webpack/components/WithOrganization/withOrganization.test.js +26 -0
- data/webpack/containers/Application/Headers.js +11 -0
- data/webpack/containers/Application/Routes.js +1 -1
- data/webpack/containers/Application/config.js +23 -7
- data/webpack/containers/Application/withHeaders.js +15 -0
- data/webpack/move_to_foreman/common/helpers.js +72 -8
- data/webpack/move_to_foreman/components/common/ConfirmDialog/ConfirmDialog.js +1 -0
- data/webpack/move_to_foreman/components/common/Dialog/Dialog.js +1 -0
- data/webpack/move_to_foreman/components/common/EmptyState/index.js +1 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.js +1 -1
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +1 -0
- data/webpack/move_to_pf/OptionTooltip/OptionTooltip.scss +20 -0
- data/webpack/move_to_pf/OptionTooltip/__tests__/OptionTooltip.test.js +32 -0
- data/webpack/move_to_pf/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +84 -0
- data/webpack/move_to_pf/OptionTooltip/index.js +83 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +15 -2
- data/webpack/move_to_pf/react-bootstrap-select/index.js +10 -4
- data/webpack/move_to_pf/test-utils/testHelpers.js +14 -2
- data/webpack/redux/actions/RedHatRepositories/enabled.js +29 -3
- data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +27 -0
- data/webpack/redux/consts.js +8 -0
- data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +62 -0
- data/webpack/redux/reducers/RedHatRepositories/{repositorySetRepositories.test.js → __tests__/repositorySetRepositories.test.js} +31 -3
- data/webpack/redux/reducers/RedHatRepositories/{sets.test.js → __tests__/sets.test.js} +3 -3
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +16 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +34 -18
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.fixtures.js +10 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +39 -48
- data/webpack/redux/reducers/index.js +6 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailArtifacts.js +19 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +51 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +147 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +25 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsConstants.js +3 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsReducer.js +33 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/ModuleStreamDetailProfiles.js +19 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/ProfileRpmsCellFormatter.js +53 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/ProfileRpmsCellFormatter.scss +4 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +35 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ModuleStreamDetailProfiles.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ProfileRpmsCellFormatter.test.js +24 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/__snapshots__/ModuleStreamDetailProfiles.test.js.snap +126 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/__snapshots__/ProfileRpmsCellFormatter.test.js.snap +14 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js +19 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/TableSchema.js +39 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap +70 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailArtifacts.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetails.test.js +27 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +42 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsReducer.test.js +33 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailArtifacts.test.js.snap +18 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailInfo.test.js.snap +111 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +552 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailsActions.test.js.snap +144 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailsReducer.test.js.snap +50 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/moduleStreamDetails.fixtures.js +115 -0
- data/webpack/scenes/ModuleStreams/Details/index.js +17 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +29 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsConstants.js +3 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +98 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsReducer.js +43 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsTable.js +38 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +69 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +27 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +49 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js +46 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +25 -0
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +69 -0
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +95 -0
- data/webpack/scenes/ModuleStreams/__tests__/moduleStreams.fixtures.js +72 -0
- data/webpack/scenes/ModuleStreams/index.js +17 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +120 -0
- data/webpack/scenes/RedHatRepositories/components/{EnabledRepository.stories.js → EnabledRepository/EnabledRepository.stories.js} +0 -0
- data/webpack/scenes/RedHatRepositories/components/{EnabledRepositoryContent.js → EnabledRepository/EnabledRepositoryContent.js} +0 -0
- data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/EnabledRepository.test.js +6 -2
- data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/EnabledRepositoryContent.test.js +0 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/__snapshots__/EnabledRepository.test.js.snap +31 -0
- data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/__snapshots__/EnabledRepositoryContent.test.js.snap +0 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/index.js +17 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +43 -5
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositoriesHelpers.js +3 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +168 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/RepositorySetRepository.test.js +38 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/__snapshots__/RepositorySetRepository.test.js.snap +70 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/index.js +18 -0
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +4 -3
- data/webpack/scenes/RedHatRepositories/components/__tests__/RepositorySetRepositories.test.js +44 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositorySetRepositories.test.js.snap +48 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +19 -15
- data/webpack/scenes/RedHatRepositories/index.js +1 -3
- data/webpack/scenes/RedHatRepositories/index.scss +16 -0
- data/webpack/scenes/Settings/Tables/TableActions.js +73 -0
- data/webpack/scenes/Settings/Tables/TableConstants.js +11 -0
- data/webpack/scenes/Settings/Tables/TableHelpers.js +8 -0
- data/webpack/scenes/Settings/Tables/TableReducer.js +46 -0
- data/webpack/scenes/Settings/Tables/__tests__/Table.fixtures.js +125 -0
- data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +84 -0
- data/webpack/scenes/Settings/Tables/__tests__/TableReducer.test.js +41 -0
- data/webpack/scenes/Settings/Tables/__tests__/__snapshots__/TableReducer.test.js.snap +76 -0
- data/webpack/scenes/Settings/index.js +4 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +2 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailAssociations.js +1 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +1 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js +20 -13
- data/webpack/scenes/Subscriptions/Details/{SubscriptionDetailEnabledProducts.js → SubscriptionDetailProductContent.js} +5 -5
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +3 -3
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
- data/webpack/scenes/Subscriptions/Details/__tests__/{SubscriptionDetailEnabledProducts.test.js → SubscriptionDetailProductContent.test.js} +4 -4
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +2 -2
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProduct.test.js.snap +28 -16
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/{SubscriptionDetailEnabledProducts.test.js.snap → SubscriptionDetailProductContent.test.js.snap} +1 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +16 -16
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/DeleteManifestModalText.js +2 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +38 -61
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +3 -3
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +12 -3
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +26 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +56 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +26 -11
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +1 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +144 -39
- data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +7 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +10 -16
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +1 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +11 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +15 -2
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +12 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +19 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +87 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +31 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +16 -11
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +18 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionTypeFormatter.test.js +33 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +29 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +34 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +24 -43
- data/webpack/scenes/Subscriptions/index.js +24 -7
- data/webpack/scenes/Tasks/TaskActions.js +43 -19
- data/webpack/scenes/Tasks/TaskConstants.js +1 -0
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +15 -12
- data/webpack/scenes/Tasks/helpers.js +17 -27
- data/webpack/services/api/index.js +3 -0
- metadata +160 -52
- data/app/lib/actions/katello/repository/scheduled_sync.rb +0 -15
- data/app/lib/actions/katello/sync_plan/add_products.rb +0 -27
- data/app/lib/actions/katello/sync_plan/destroy.rb +0 -26
- data/app/lib/actions/katello/sync_plan/remove_products.rb +0 -23
- data/app/lib/actions/katello/sync_plan/update.rb +0 -20
- data/app/lib/actions/pulp/repos/update.rb +0 -24
- data/app/lib/actions/pulp/repository/ensure_sync_notification.rb +0 -11
- data/app/lib/actions/pulp/repository/remove_schedule.rb +0 -16
- data/app/lib/actions/pulp/repository/update_schedule.rb +0 -47
- data/app/lib/katello/validators/repository_unique_attribute_validator.rb +0 -13
- data/app/models/katello/candlepin/docker_repository_mapper.rb +0 -77
- data/app/models/katello/input_template_renderer.rb +0 -7
- data/lib/katello/tasks/upgrades/2.4/import_distributions.rake +0 -11
- data/lib/katello/tasks/upgrades/2.4/import_package_groups.rake +0 -11
- data/lib/katello/tasks/upgrades/2.4/import_puppet_modules.rake +0 -12
- data/lib/katello/tasks/upgrades/2.4/import_rpms.rake +0 -12
- data/lib/katello/tasks/upgrades/3.0/add_export_distributor.rake +0 -14
- data/lib/katello/tasks/upgrades/3.0/delete_docker_v1_content.rake +0 -27
- data/lib/katello/tasks/upgrades/3.0/update_puppet_repository_distributors.rake +0 -20
- data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +0 -9
- data/lib/katello/tasks/upgrades/3.3/hypervisors.rake +0 -7
- data/lib/katello/tasks/upgrades/3.4/reindex_docker_tags.rake +0 -12
- data/lib/katello/tasks/upgrades/3.4/remove_unused_products.rake +0 -28
- data/lib/katello/tasks/upgrades/3.6/import_backend_consumer_attributes.rake +0 -32
- data/lib/katello/tasks/upgrades/3.6/import_product_content.rake +0 -12
- data/lib/katello/tasks/upgrades/3.6/republish_file_repos.rake +0 -16
- data/lib/katello/tasks/upgrades/3.7/import_pools.rake +0 -12
- data/lib/katello/tasks/upgrades/3.7/make_all_ks_repos_bootable.rake +0 -11
- data/webpack/helpers/caret.js +0 -6
- data/webpack/redux/reducers/RedHatRepositories/enabled.test.js +0 -36
- data/webpack/redux/reducers/RedHatRepositories/filters.fixtures.js +0 -5
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +0 -105
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +0 -129
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepository.test.js.snap +0 -25
@@ -0,0 +1,7 @@
|
|
1
|
+
module Katello
|
2
|
+
class RepositoryModuleStream < Katello::Model
|
3
|
+
# Do not use active record callbacks in this join model. Direct INSERTs and DELETEs are done
|
4
|
+
belongs_to :repository, inverse_of: :repository_module_streams, class_name: 'Katello::Repository'
|
5
|
+
belongs_to :module_stream, inverse_of: :repository_module_streams, class_name: 'Katello::ModuleStream'
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,262 @@
|
|
1
|
+
module Katello
|
2
|
+
class RootRepository < Katello::Model
|
3
|
+
audited
|
4
|
+
serialize :ignorable_content
|
5
|
+
serialize :docker_tags_whitelist
|
6
|
+
|
7
|
+
include Ext::LabelFromName
|
8
|
+
|
9
|
+
IGNORABLE_CONTENT_UNIT_TYPES = %w(rpm drpm srpm distribution erratum).freeze
|
10
|
+
CHECKSUM_TYPES = %w(sha1 sha256).freeze
|
11
|
+
|
12
|
+
OSTREE_UPSTREAM_SYNC_POLICY_LATEST = "latest".freeze
|
13
|
+
OSTREE_UPSTREAM_SYNC_POLICY_ALL = "all".freeze
|
14
|
+
OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM = "custom".freeze
|
15
|
+
OSTREE_UPSTREAM_SYNC_POLICIES = [OSTREE_UPSTREAM_SYNC_POLICY_LATEST, OSTREE_UPSTREAM_SYNC_POLICY_ALL, OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM].freeze
|
16
|
+
|
17
|
+
SUBSCRIBABLE_TYPES = [Repository::YUM_TYPE, Repository::OSTREE_TYPE, Repository::DEB_TYPE].freeze
|
18
|
+
|
19
|
+
CONTENT_ATTRIBUTE_RESTRICTIONS = {
|
20
|
+
:ostree_upstream_sync_depth => [Repository::OSTREE_TYPE],
|
21
|
+
:ostree_upstream_sync_policy => [Repository::OSTREE_TYPE],
|
22
|
+
:download_policy => [Repository::YUM_TYPE]
|
23
|
+
|
24
|
+
}.freeze
|
25
|
+
|
26
|
+
belongs_to :product, :inverse_of => :root_repositories, :class_name => "Katello::Product"
|
27
|
+
belongs_to :gpg_key, :inverse_of => :root_repositories, :class_name => "Katello::GpgKey"
|
28
|
+
belongs_to :ssl_ca_cert, :class_name => "Katello::GpgKey", :inverse_of => :ssl_ca_root_repos
|
29
|
+
belongs_to :ssl_client_cert, :class_name => "Katello::GpgKey", :inverse_of => :ssl_client_root_repos
|
30
|
+
belongs_to :ssl_client_key, :class_name => "Katello::GpgKey", :inverse_of => :ssl_key_root_repos
|
31
|
+
has_many :repositories, :class_name => "Katello::Repository", :foreign_key => :root_id,
|
32
|
+
:inverse_of => :root, :dependent => :destroy
|
33
|
+
|
34
|
+
before_validation :update_ostree_upstream_sync_policy
|
35
|
+
|
36
|
+
validates_lengths_from_database :except => [:label]
|
37
|
+
validates_with Validators::KatelloLabelFormatValidator, :attributes => :label
|
38
|
+
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
39
|
+
validates_with Validators::KatelloUrlFormatValidator, :attributes => :url, :nil_allowed => proc { |repo| repo.custom? },
|
40
|
+
:field_name => :url
|
41
|
+
validates_with Validators::RootRepositoryUniqueAttributeValidator, :attributes => :name
|
42
|
+
validates_with Validators::RootRepositoryUniqueAttributeValidator, :attributes => :label
|
43
|
+
validates_with Validators::ContainerImageNameValidator, :attributes => :docker_upstream_name, :allow_blank => true, :if => :docker?
|
44
|
+
|
45
|
+
validate :ensure_valid_docker_attributes, :if => :docker?
|
46
|
+
validate :ensure_docker_repo_unprotected, :if => :docker?
|
47
|
+
validate :ensure_ostree_repo_protected, :if => :ostree?
|
48
|
+
validate :ensure_compatible_download_policy, :if => :yum?
|
49
|
+
validate :ensure_valid_ignorable_content
|
50
|
+
validate :ensure_content_attribute_restrictions
|
51
|
+
validate :ensure_valid_upstream_authorization
|
52
|
+
validates :url, presence: true, if: :ostree?
|
53
|
+
validates :checksum_type, :inclusion => {:in => CHECKSUM_TYPES}, :allow_blank => true
|
54
|
+
validates :product_id, :presence => true
|
55
|
+
validates :ostree_upstream_sync_policy, :inclusion => {:in => OSTREE_UPSTREAM_SYNC_POLICIES, :allow_blank => true}, :if => :ostree?
|
56
|
+
validates :ostree_upstream_sync_depth, :presence => true, :numericality => { :only_integer => true },
|
57
|
+
:if => proc { |r| r.ostree? && r.ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM }
|
58
|
+
validates :content_type, :inclusion => {
|
59
|
+
:in => ->(_) { Katello::RepositoryTypeManager.repository_types.keys },
|
60
|
+
:allow_blank => false,
|
61
|
+
:message => ->(_, _) { _("must be one of the following: %s") % Katello::RepositoryTypeManager.repository_types.keys.join(', ') }
|
62
|
+
}
|
63
|
+
validates :download_policy, inclusion: {
|
64
|
+
:in => ::Runcible::Models::YumImporter::DOWNLOAD_POLICIES,
|
65
|
+
:message => _("must be one of the following: %s") % ::Runcible::Models::YumImporter::DOWNLOAD_POLICIES.join(', ')
|
66
|
+
}, if: :yum?
|
67
|
+
|
68
|
+
scope :subscribable, -> { where(content_type: RootRepository::SUBSCRIBABLE_TYPES) }
|
69
|
+
scope :has_url, -> { where.not(:url => nil) }
|
70
|
+
scope :with_repository_attribute, ->(attr, value) { joins(:repositories).where("#{Katello::Repository.table_name}.#{attr}" => value) }
|
71
|
+
scope :in_content_view_version, ->(version) { with_repository_attribute(:content_view_version_id, version) }
|
72
|
+
scope :deb_type, -> { where(:content_type => Repository::DEB_TYPE) }
|
73
|
+
scope :yum_type, -> { where(:content_type => Repository::YUM_TYPE) }
|
74
|
+
scope :file_type, -> { where(:content_type => Repository::FILE_TYPE) }
|
75
|
+
scope :puppet_type, -> { where(:content_type => Repository::PUPPET_TYPE) }
|
76
|
+
scope :docker_type, -> { where(:content_type => Repository::DOCKER_TYPE) }
|
77
|
+
scope :ostree_type, -> { where(:content_type => Repository::OSTREE_TYPE) }
|
78
|
+
delegate :redhat?, :provider, :organization, to: :product
|
79
|
+
|
80
|
+
def library_instance
|
81
|
+
repositories.in_default_view.first
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.repositories
|
85
|
+
Repository.where(:root => self)
|
86
|
+
end
|
87
|
+
|
88
|
+
def custom?
|
89
|
+
!redhat?
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.in_organization(org)
|
93
|
+
joins(:product).where("#{Katello::Product.table_name}.organization_id" => org)
|
94
|
+
end
|
95
|
+
|
96
|
+
def ensure_content_attribute_restrictions
|
97
|
+
CONTENT_ATTRIBUTE_RESTRICTIONS.each do |attribute, value|
|
98
|
+
if self.send(attribute).present? && !value.include?(self.content_type)
|
99
|
+
errors.add(attribute, _("Cannot set attribute %{attr} for content type %{type}") % {:attr => attribute, :type => self.content_type})
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def ensure_compatible_download_policy
|
105
|
+
if !url.blank? && URI(url).scheme == 'file' &&
|
106
|
+
[::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND, ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND].include?(download_policy)
|
107
|
+
errors.add(:download_policy, _("Cannot sync file:// repositories with On Demand or Background Download Policies"))
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def ensure_valid_docker_attributes
|
112
|
+
if (!url.blank? && docker_upstream_name.blank?)
|
113
|
+
errors.add(:docker_upstream_name, N_("cannot be blank when Repository URL is provided."))
|
114
|
+
errors.add(:base, _("Upstream Name cannot be blank when Repository URL is provided."))
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def ensure_docker_repo_unprotected
|
119
|
+
unless unprotected
|
120
|
+
errors.add(:base, _("Container Image Repositories are not protected at this time. " \
|
121
|
+
"They need to be published via http to be available to containers."))
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def ensure_no_download_policy
|
126
|
+
if !yum? && download_policy.present?
|
127
|
+
errors.add(:download_policy, _("cannot be set for non-yum repositories."))
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def ensure_ostree_repo_protected
|
132
|
+
if unprotected
|
133
|
+
errors.add(:base, _("OSTree Repositories cannot be unprotected."))
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def update_ostree_upstream_sync_policy
|
138
|
+
return unless ostree?
|
139
|
+
if self.ostree_upstream_sync_policy.blank?
|
140
|
+
self.ostree_upstream_sync_policy = OSTREE_UPSTREAM_SYNC_POLICY_LATEST
|
141
|
+
end
|
142
|
+
|
143
|
+
if self.ostree_upstream_sync_policy_changed? &&
|
144
|
+
previous_changes[:ostree_upstream_sync_policy].present?
|
145
|
+
self.ostree_upstream_sync_depth = nil unless self.ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
def compute_ostree_upstream_sync_depth
|
150
|
+
if ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM
|
151
|
+
ostree_upstream_sync_depth
|
152
|
+
elsif ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_ALL
|
153
|
+
-1
|
154
|
+
else
|
155
|
+
0
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def ensure_no_ostree_upstream_sync_policy
|
160
|
+
if !ostree? && ostree_upstream_sync_policy.present?
|
161
|
+
errors.add(:ostree_upstream_sync_policy, N_("cannot be set for non-ostree repositories."))
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def ensure_valid_ignorable_content
|
166
|
+
return if ignorable_content.blank?
|
167
|
+
if !yum?
|
168
|
+
errors.add(:ignorable_content, N_("Ignorable content can be only set for Yum repositories."))
|
169
|
+
elsif !ignorable_content.is_a?(Array)
|
170
|
+
errors.add(:ignorable_content, N_("Invalid value specified for ignorable content."))
|
171
|
+
elsif ignorable_content.any? { |item| !IGNORABLE_CONTENT_UNIT_TYPES.include?(item) }
|
172
|
+
errors.add(:ignorable_content, N_("Invalid value specified for ignorable content. Permissible values %s") % IGNORABLE_CONTENT_UNIT_TYPES.join(","))
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def ensure_valid_upstream_authorization
|
177
|
+
return if (self.upstream_username.blank? && self.upstream_password.blank?)
|
178
|
+
if redhat?
|
179
|
+
errors.add(:base, N_("Upstream username and password may only be set on custom repositories."))
|
180
|
+
elsif self.upstream_username.blank?
|
181
|
+
errors.add(:base, N_("Upstream password requires upstream username be set."))
|
182
|
+
elsif !self.upstream_password
|
183
|
+
errors.add(:base, N_("Upstream username requires upstream password be set.")) # requirement of pulp
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
def custom_content_path
|
188
|
+
parts = []
|
189
|
+
# We generate repo path only for custom product content. We add this
|
190
|
+
# constant string to avoid collisions with RH content. RH content url
|
191
|
+
# begins usually with something like "/content/dist/rhel/...".
|
192
|
+
# There we prefix custom content/repo url with "/custom/..."
|
193
|
+
parts << "custom"
|
194
|
+
parts += [product.label, self.label]
|
195
|
+
"/" + parts.map { |x| x.gsub(/[^-\w]/, "_") }.join("/")
|
196
|
+
end
|
197
|
+
|
198
|
+
def custom_content_label
|
199
|
+
"#{organization.label} #{product.label} #{label}".gsub(/\s/, "_")
|
200
|
+
end
|
201
|
+
|
202
|
+
def content
|
203
|
+
Katello::Content.find_by(:cp_content_id => self.content_id, :organization_id => self.product.organization_id)
|
204
|
+
end
|
205
|
+
|
206
|
+
def docker?
|
207
|
+
self.content_type == Repository::DOCKER_TYPE
|
208
|
+
end
|
209
|
+
|
210
|
+
def puppet?
|
211
|
+
self.content_type == Repository::PUPPET_TYPE
|
212
|
+
end
|
213
|
+
|
214
|
+
def file?
|
215
|
+
self.content_type == Repository::FILE_TYPE
|
216
|
+
end
|
217
|
+
|
218
|
+
def yum?
|
219
|
+
self.content_type == Repository::YUM_TYPE
|
220
|
+
end
|
221
|
+
|
222
|
+
def ostree?
|
223
|
+
self.content_type == Repository::OSTREE_TYPE
|
224
|
+
end
|
225
|
+
|
226
|
+
def deb?
|
227
|
+
self.content_type == Repository::DEB_TYPE
|
228
|
+
end
|
229
|
+
|
230
|
+
def metadata_generate_needed?
|
231
|
+
(%w(unprotected checksum_type container_repsoitory_name) & previous_changes.keys).any?
|
232
|
+
end
|
233
|
+
|
234
|
+
def pulp_update_needed?
|
235
|
+
changeable_attributes = %w(url unprotected checksum_type docker_upstream_name download_policy mirror_on_sync verify_ssl_on_sync
|
236
|
+
upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignore_global_proxy ignorable_content)
|
237
|
+
changeable_attributes += %w(name container_repository_name) if docker?
|
238
|
+
changeable_attributes += %w(deb_releases deb_components deb_architectures) if deb?
|
239
|
+
changeable_attributes.any? { |key| previous_changes.key?(key) }
|
240
|
+
end
|
241
|
+
|
242
|
+
def raw_content_path
|
243
|
+
self.content.content_url
|
244
|
+
end
|
245
|
+
|
246
|
+
def calculate_updated_name
|
247
|
+
fail _("Cannot calculate name for custom repos") if custom?
|
248
|
+
Katello::Candlepin::RepositoryMapper.new(self.product, self.content, self.substitutions).name
|
249
|
+
end
|
250
|
+
|
251
|
+
def substitutions
|
252
|
+
{
|
253
|
+
:releasever => self.minor,
|
254
|
+
:basearch => self.arch
|
255
|
+
}
|
256
|
+
end
|
257
|
+
|
258
|
+
class Jail < ::Safemode::Jail
|
259
|
+
allow :name, :label, :docker_upstream_name, :url
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
@@ -38,7 +38,7 @@ module Katello
|
|
38
38
|
|
39
39
|
def to_status(options = {})
|
40
40
|
return UNKNOWN unless host.subscription_facet.try(:uuid)
|
41
|
-
status_override = 'unsubscribed_hypervisor' if host.subscription_facet.hypervisor && host.subscription_facet.candlepin_consumer.entitlements
|
41
|
+
status_override = 'unsubscribed_hypervisor' if host.subscription_facet.hypervisor && !host.subscription_facet.candlepin_consumer.entitlements?
|
42
42
|
status_override ||= options.fetch(:status_override, nil)
|
43
43
|
status = status_override || Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label).entitlement_status
|
44
44
|
|
@@ -10,12 +10,14 @@ module Katello
|
|
10
10
|
HOURLY = 'hourly'.freeze
|
11
11
|
DAILY = 'daily'.freeze
|
12
12
|
WEEKLY = 'weekly'.freeze
|
13
|
-
|
13
|
+
CUSTOM_CRON = 'custom cron'.freeze
|
14
|
+
TYPES = [HOURLY, DAILY, WEEKLY, CUSTOM_CRON].freeze
|
14
15
|
DURATION = {HOURLY => 'T1H', DAILY => 'T24H', WEEKLY => '7D' }.freeze
|
15
16
|
WEEK_DAYS = %w(Sunday Monday Tuesday Wednesday Thursday Friday).collect { |d| N_(d) }
|
16
17
|
|
17
18
|
belongs_to :organization, :inverse_of => :sync_plans
|
18
19
|
has_many :products, :class_name => "Katello::Product", :dependent => :nullify
|
20
|
+
belongs_to :foreman_tasks_recurring_logic, :inverse_of => :sync_plan, :class_name => "ForemanTasks::RecurringLogic", :dependent => :destroy
|
19
21
|
|
20
22
|
validates_lengths_from_database
|
21
23
|
validates :name, :presence => true, :uniqueness => {:scope => :organization_id}
|
@@ -23,8 +25,11 @@ module Katello
|
|
23
25
|
validates :enabled, :inclusion => [true, false]
|
24
26
|
validate :validate_sync_date
|
25
27
|
validate :product_enabled
|
28
|
+
validate :custom_cron_interval_expression
|
26
29
|
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
27
30
|
|
31
|
+
before_destroy :cancel_recurring_logic
|
32
|
+
|
28
33
|
scoped_search :on => :name, :complete_value => true
|
29
34
|
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
30
35
|
scoped_search :on => :interval, :complete_value => true
|
@@ -36,6 +41,53 @@ module Katello
|
|
36
41
|
end
|
37
42
|
end
|
38
43
|
|
44
|
+
def custom_cron_interval_expression
|
45
|
+
errors.add :base, _("Custom cron expression only needs to be set for interval value of custom cron") if cron_status_mismatch?
|
46
|
+
end
|
47
|
+
|
48
|
+
def save_with_logic!
|
49
|
+
associate_recurring_logic
|
50
|
+
self.save!
|
51
|
+
start_recurring_logic
|
52
|
+
end
|
53
|
+
|
54
|
+
def update_attributes_with_logics!(params)
|
55
|
+
transaction do
|
56
|
+
params["cron_expression"] = '' unless params["interval"].eql? CUSTOM_CRON
|
57
|
+
self.update_attributes!(params)
|
58
|
+
if rec_logic_changed?
|
59
|
+
old_rec_logic = self.foreman_tasks_recurring_logic
|
60
|
+
associate_recurring_logic
|
61
|
+
self.save!
|
62
|
+
old_rec_logic.cancel
|
63
|
+
start_recurring_logic
|
64
|
+
end
|
65
|
+
toggle_enabled if enabled_toggle?
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def associate_recurring_logic
|
70
|
+
self.foreman_tasks_recurring_logic = add_recurring_logic_to_sync_plan(self.sync_date, self.interval, self.cron_expression)
|
71
|
+
end
|
72
|
+
|
73
|
+
def toggle_enabled
|
74
|
+
self.foreman_tasks_recurring_logic.enabled = self.enabled
|
75
|
+
end
|
76
|
+
|
77
|
+
def start_recurring_logic
|
78
|
+
User.as_anonymous_admin do
|
79
|
+
if self.sync_date.to_time < Time.now
|
80
|
+
self.foreman_tasks_recurring_logic.start(::Actions::Katello::SyncPlan::Run, self)
|
81
|
+
else
|
82
|
+
self.foreman_tasks_recurring_logic.start_after(::Actions::Katello::SyncPlan::Run, self.sync_date, self)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def cancel_recurring_logic
|
88
|
+
self.foreman_tasks_recurring_logic.cancel if self.foreman_tasks_recurring_logic
|
89
|
+
end
|
90
|
+
|
39
91
|
def validate_sync_date
|
40
92
|
errors.add :base, _("Start Date and Time can't be blank") if self.sync_date.nil?
|
41
93
|
end
|
@@ -56,13 +108,6 @@ module Katello
|
|
56
108
|
self.sync_date.strftime('%Y/%m/%d %H:%M:%S %z')
|
57
109
|
end
|
58
110
|
|
59
|
-
def schedule_format
|
60
|
-
return nil if DURATION[self.interval].nil?
|
61
|
-
date = self.sync_date
|
62
|
-
date = next_sync_date if enabled? && self.sync_date < Time.now
|
63
|
-
"#{date.iso8601}/P#{DURATION[self.interval]}"
|
64
|
-
end
|
65
|
-
|
66
111
|
def plan_zone
|
67
112
|
self.sync_date.strftime('%Z')
|
68
113
|
end
|
@@ -72,38 +117,8 @@ module Katello
|
|
72
117
|
end
|
73
118
|
|
74
119
|
def next_sync_date
|
75
|
-
return nil unless self.enabled
|
76
|
-
|
77
|
-
next_sync = self.sync_date
|
78
|
-
|
79
|
-
if self.sync_date < now
|
80
|
-
hours = self.sync_date.hour - now.hour
|
81
|
-
minutes = self.sync_date.min - now.min
|
82
|
-
seconds = self.sync_date.sec - now.sec
|
83
|
-
|
84
|
-
next_sync = nil
|
85
|
-
now_time = now.utc.strftime('%H%M%S%N')
|
86
|
-
|
87
|
-
case self.interval
|
88
|
-
when HOURLY
|
89
|
-
if self.sync_date.min < now.min
|
90
|
-
minutes += 60
|
91
|
-
end
|
92
|
-
next_sync = now.advance(:minutes => minutes, :seconds => seconds)
|
93
|
-
when DAILY
|
94
|
-
if self.sync_time < now_time
|
95
|
-
hours += 24
|
96
|
-
end
|
97
|
-
next_sync = now.advance(:hours => hours, :minutes => minutes, :seconds => seconds)
|
98
|
-
when WEEKLY
|
99
|
-
days = self.sync_date.wday - now.wday
|
100
|
-
days += 7 if days < 0 || (days == 0 && self.sync_time <= now_time)
|
101
|
-
next_sync = now.change(:hour => self.sync_date.hour, :min => self.sync_date.min,
|
102
|
-
:sec => self.sync_date.sec).advance(:days => days)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
next_sync
|
120
|
+
return nil unless (self.enabled || !self.foreman_tasks_recurring_logic.tasks.nil?)
|
121
|
+
self.foreman_tasks_recurring_logic.tasks.order(:start_at).last.try(:start_at)
|
107
122
|
end
|
108
123
|
|
109
124
|
def next_sync
|
@@ -113,5 +128,43 @@ module Katello
|
|
113
128
|
def self.humanize_class_name(_name = nil)
|
114
129
|
_("Sync Plans")
|
115
130
|
end
|
131
|
+
|
132
|
+
def add_recurring_logic_to_sync_plan(sync_date, interval, cron_expression)
|
133
|
+
sync_date_local_zone = sync_date
|
134
|
+
min, hour, day = sync_date_local_zone.min, sync_date_local_zone.hour, sync_date_local_zone.wday
|
135
|
+
if interval.nil?
|
136
|
+
fail _("Interval cannot be nil")
|
137
|
+
end
|
138
|
+
if (interval.downcase.eql? "hourly")
|
139
|
+
cron = min.to_s + " * * * *"
|
140
|
+
elsif (interval.downcase.eql? "daily")
|
141
|
+
cron = min.to_s + " " + hour.to_s + " * * *"
|
142
|
+
elsif (interval.downcase.eql? "weekly")
|
143
|
+
cron = min.to_s + " " + hour.to_s + " * * " + day.to_s
|
144
|
+
elsif (interval.downcase.eql? CUSTOM_CRON)
|
145
|
+
cron = cron_expression
|
146
|
+
else
|
147
|
+
fail _("Interval not set correctly")
|
148
|
+
end
|
149
|
+
|
150
|
+
recurring_logic = ForemanTasks::RecurringLogic.new_from_cronline(cron)
|
151
|
+
unless recurring_logic.valid_cronline?
|
152
|
+
fail _("Cron expression is not valid!")
|
153
|
+
end
|
154
|
+
recurring_logic.save!
|
155
|
+
return recurring_logic
|
156
|
+
end
|
157
|
+
|
158
|
+
def rec_logic_changed?
|
159
|
+
saved_change_to_attribute?(:sync_date) || saved_change_to_attribute?(:interval) || saved_change_to_attribute?(:cron_expression)
|
160
|
+
end
|
161
|
+
|
162
|
+
def enabled_toggle?
|
163
|
+
saved_change_to_attribute?(:enabled)
|
164
|
+
end
|
165
|
+
|
166
|
+
def cron_status_mismatch?
|
167
|
+
self.interval != CUSTOM_CRON && !(self.cron_expression.nil? || self.cron_expression.eql?(''))
|
168
|
+
end
|
116
169
|
end
|
117
170
|
end
|