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.

Files changed (412) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +25 -16
  3. data/app/controllers/katello/api/v2/activation_keys_controller.rb +26 -21
  4. data/app/controllers/katello/api/v2/ansible_collections_controller.rb +6 -0
  5. data/app/controllers/katello/api/v2/content_uploads_controller.rb +8 -2
  6. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +8 -1
  7. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
  9. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -3
  10. data/app/controllers/katello/api/v2/katello_ping_controller.rb +24 -0
  11. data/app/controllers/katello/api/v2/module_streams_controller.rb +21 -0
  12. data/app/controllers/katello/api/v2/package_groups_controller.rb +5 -0
  13. data/app/controllers/katello/api/v2/packages_controller.rb +16 -0
  14. data/app/controllers/katello/api/v2/repositories_controller.rb +7 -4
  15. data/app/controllers/katello/api/v2/srpms_controller.rb +1 -1
  16. data/app/controllers/katello/api/v2/subscriptions_controller.rb +5 -1
  17. data/app/controllers/katello/api/v2/sync_plans_controller.rb +7 -5
  18. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +36 -5
  19. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +12 -0
  20. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +55 -0
  21. data/app/lib/actions/katello/capsule_content/sync.rb +13 -64
  22. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +40 -0
  23. data/app/lib/actions/katello/content_view/publish.rb +0 -3
  24. data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +1 -3
  25. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +21 -0
  26. data/app/lib/actions/katello/repository/create.rb +8 -0
  27. data/app/lib/actions/katello/repository/import_upload.rb +13 -12
  28. data/app/lib/actions/katello/repository/metadata_generate.rb +2 -2
  29. data/app/lib/actions/katello/repository/update.rb +9 -0
  30. data/app/lib/actions/katello/repository/upload_files.rb +4 -11
  31. data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -0
  32. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +16 -0
  33. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +25 -0
  34. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +34 -0
  35. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +35 -0
  36. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +15 -0
  37. data/app/lib/actions/{katello/capsule_content → pulp/orphan_cleanup}/remove_unneeded_repos.rb +2 -2
  38. data/app/lib/actions/pulp/repository/import_upload.rb +7 -11
  39. data/app/lib/actions/pulp3/abstract_async_task.rb +7 -7
  40. data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +32 -0
  41. data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +31 -0
  42. data/app/lib/actions/pulp3/capsule_content/sync.rb +26 -0
  43. data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +20 -0
  44. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +15 -15
  45. data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
  46. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +36 -0
  47. data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +24 -0
  48. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
  49. data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +25 -0
  50. data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +20 -0
  51. data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +16 -0
  52. data/app/lib/actions/pulp3/repository/create_publication.rb +1 -5
  53. data/app/lib/actions/pulp3/repository/import_upload.rb +21 -0
  54. data/app/lib/actions/pulp3/repository/save_artifact.rb +19 -0
  55. data/app/lib/actions/pulp3/repository/save_version.rb +3 -2
  56. data/app/lib/actions/pulp3/repository/sync.rb +1 -1
  57. data/app/lib/actions/pulp3/repository/upload_file.rb +76 -0
  58. data/app/lib/katello/api/v2/rendering.rb +1 -2
  59. data/app/lib/katello/concerns/base_template_scope_extensions.rb +34 -2
  60. data/app/lib/katello/errors.rb +21 -0
  61. data/app/lib/katello/resources/candlepin/consumer.rb +0 -9
  62. data/app/lib/katello/resources/candlepin/owner.rb +0 -5
  63. data/app/lib/katello/resources/candlepin/product.rb +2 -6
  64. data/app/lib/katello/resources/registry.rb +25 -10
  65. data/app/lib/katello/util/filter_clause_generator.rb +1 -1
  66. data/app/lib/katello/util/module_stream_clause_generator.rb +49 -0
  67. data/app/lib/katello/util/package_clause_generator.rb +1 -1
  68. data/app/models/katello/ansible_collection.rb +5 -8
  69. data/app/models/katello/ansible_collection_tag.rb +8 -0
  70. data/app/models/katello/ansible_tag.rb +8 -0
  71. data/app/models/katello/concerns/host_managed_extensions.rb +16 -14
  72. data/app/models/katello/concerns/pulp_database_unit.rb +27 -4
  73. data/app/models/katello/concerns/search_by_repository_name.rb +4 -1
  74. data/app/models/katello/concerns/smart_proxy_extensions.rb +44 -20
  75. data/app/models/katello/content_view_docker_filter.rb +15 -2
  76. data/app/models/katello/content_view_filter.rb +28 -8
  77. data/app/models/katello/content_view_module_stream_filter.rb +14 -0
  78. data/app/models/katello/content_view_module_stream_filter_rule.rb +11 -0
  79. data/app/models/katello/content_view_package_filter.rb +18 -8
  80. data/app/models/katello/content_view_version.rb +7 -2
  81. data/app/models/katello/deb.rb +0 -8
  82. data/app/models/katello/docker_manifest.rb +0 -8
  83. data/app/models/katello/docker_manifest_list.rb +0 -8
  84. data/app/models/katello/docker_meta_tag.rb +38 -20
  85. data/app/models/katello/docker_tag.rb +22 -33
  86. data/app/models/katello/erratum.rb +10 -8
  87. data/app/models/katello/file_unit.rb +1 -13
  88. data/app/models/katello/glue/candlepin/owner.rb +0 -5
  89. data/app/models/katello/glue/candlepin/product.rb +1 -5
  90. data/app/models/katello/glue/pulp/repo.rb +1 -1
  91. data/app/models/katello/host/content_facet.rb +6 -0
  92. data/app/models/katello/host_collection.rb +4 -0
  93. data/app/models/katello/installed_package.rb +4 -0
  94. data/app/models/katello/module_stream.rb +1 -12
  95. data/app/models/katello/ostree_branch.rb +0 -7
  96. data/app/models/katello/package_group.rb +0 -7
  97. data/app/models/katello/ping.rb +10 -3
  98. data/app/models/katello/pool.rb +11 -1
  99. data/app/models/katello/puppet_module.rb +0 -7
  100. data/app/models/katello/repository.rb +15 -6
  101. data/app/models/katello/repository_docker_meta_tag.rb +7 -0
  102. data/app/models/katello/repository_docker_tag.rb +7 -0
  103. data/app/models/katello/repository_file_unit.rb +7 -0
  104. data/app/models/katello/rhsm_fact_name.rb +5 -1
  105. data/app/models/katello/rhsm_fact_parser.rb +17 -1
  106. data/app/models/katello/root_repository.rb +11 -6
  107. data/app/models/katello/rpm.rb +0 -8
  108. data/app/models/katello/srpm.rb +0 -8
  109. data/app/models/katello/upstream_pool.rb +2 -0
  110. data/app/models/katello/yum_metadata_file.rb +0 -4
  111. data/app/models/setting/content.rb +124 -128
  112. data/app/services/katello/candlepin/consumer.rb +0 -1
  113. data/app/services/katello/pulp/content.rb +11 -4
  114. data/app/services/katello/pulp/docker_tag.rb +0 -1
  115. data/app/services/katello/pulp/pulp_content_unit.rb +4 -0
  116. data/app/services/katello/pulp/repository.rb +53 -0
  117. data/app/services/katello/pulp/repository/file.rb +1 -1
  118. data/app/services/katello/pulp/repository/puppet.rb +8 -1
  119. data/app/services/katello/pulp/repository/yum.rb +42 -9
  120. data/app/services/katello/pulp/smart_proxy_repository.rb +13 -96
  121. data/app/services/katello/pulp3/ansible_collection.rb +7 -3
  122. data/app/services/katello/pulp3/content.rb +60 -0
  123. data/app/services/katello/pulp3/docker_blob.rb +1 -1
  124. data/app/services/katello/pulp3/docker_manifest.rb +1 -1
  125. data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
  126. data/app/services/katello/pulp3/docker_tag.rb +2 -2
  127. data/app/services/katello/pulp3/file_unit.rb +7 -1
  128. data/app/services/katello/pulp3/pulp_content_unit.rb +15 -5
  129. data/app/services/katello/pulp3/repository.rb +301 -24
  130. data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
  131. data/app/services/katello/pulp3/repository/docker.rb +54 -9
  132. data/app/services/katello/pulp3/repository/file.rb +8 -0
  133. data/app/services/katello/pulp3/repository/yum.rb +61 -0
  134. data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -0
  135. data/app/services/katello/repository_type_manager.rb +7 -0
  136. data/app/services/katello/smart_proxy_helper.rb +50 -0
  137. data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
  138. data/app/views/katello/api/v2/ansible_collections/base.json.rabl +5 -0
  139. data/app/views/katello/api/v2/ansible_collections/show.json.rabl +7 -0
  140. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -0
  141. data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +1 -1
  142. data/app/views/katello/api/v2/content_view_filters/base.json.rabl +5 -0
  143. data/app/views/katello/api/v2/content_view_filters/show.json.rabl +2 -1
  144. data/app/views/katello/api/v2/hosts_bulk_actions/erratum.json.rabl +2 -0
  145. data/app/views/katello/api/v2/{ping → katello_ping}/server_status.json.rabl +0 -0
  146. data/app/views/katello/api/v2/{ping → katello_ping}/show.json.rabl +0 -0
  147. data/app/views/katello/api/v2/{ping → katello_ping}/version.json.rabl +0 -0
  148. data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
  149. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  150. data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
  151. data/app/views/katello/api/v2/subscriptions/permissions.rabl +11 -0
  152. data/config/katello.yaml.example +9 -0
  153. data/config/routes.rb +2 -1
  154. data/config/routes/api/v2.rb +2 -2
  155. data/db/migrate/20180920214134_create_repository_root.rb +1 -1
  156. data/db/migrate/20190730183518_add_docker_tag_join_table.rb +25 -0
  157. data/db/migrate/20190730203334_add_docker_meta_tag_join_table.rb +25 -0
  158. data/db/migrate/20190814025338_create_content_view_module_stream_filter_rules.rb +13 -0
  159. data/db/migrate/20190816162733_rename_ansible_collection_whitelist_to_requirements.rb +5 -0
  160. data/db/migrate/20190822144300_add_ansible_fields.rb +18 -0
  161. data/db/migrate/20190912210927_rename_repository_file_unit.rb +12 -0
  162. data/engines/bastion/README.md +2 -2
  163. data/engines/bastion/app/assets/javascripts/bastion/components/bst-edit.directive.js +2 -1
  164. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +20 -6
  165. data/engines/bastion/app/assets/javascripts/bastion/components/views/bst-modal.html +1 -1
  166. data/engines/bastion/app/assets/javascripts/bastion/layouts/partials/table.html +2 -1
  167. data/engines/bastion/app/assets/stylesheets/bastion/overrides.scss +1 -0
  168. data/engines/bastion/lib/bastion.rb +1 -0
  169. data/engines/bastion_katello/README.md +1 -2
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +1 -4
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.factory.js +28 -0
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.module.js +15 -0
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +4 -0
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -6
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-destroy-modal.html +3 -3
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +2 -34
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -1
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +6 -0
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -11
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -4
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +3 -1
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -3
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -5
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -4
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +4 -16
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +13 -0
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -13
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +47 -5
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-module-stream-filter.controller.js +68 -0
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +2 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-rule-matching-package-modal.controller.js +37 -0
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -1
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/module-stream-list-filter.controller.js +73 -0
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +4 -1
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +14 -1
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +3 -0
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-details.html +0 -2
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +5 -0
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-rule-matching-package-modal.html +43 -0
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +4 -0
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +41 -0
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter.html +43 -0
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +4 -0
  211. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +1 -1
  212. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +1 -1
  213. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +3 -3
  214. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +1 -2
  215. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -1
  216. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +3 -0
  217. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js +1 -1
  218. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +1 -1
  219. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +44 -35
  220. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
  221. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +12 -0
  222. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -3
  223. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +21 -3
  224. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ansible-collections.html +36 -0
  225. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/download-policy.service.js +1 -1
  226. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +24 -2
  227. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +29 -15
  228. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +9 -0
  229. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +1 -1
  230. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +8 -0
  231. data/engines/bastion_katello/lib/bastion_katello/engine.rb +8 -8
  232. data/lib/katello/engine.rb +0 -4
  233. data/lib/katello/plugin.rb +19 -1
  234. data/lib/katello/repository_types/yum.rb +2 -0
  235. data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
  236. data/lib/katello/tasks/reimport.rake +1 -1
  237. data/lib/katello/version.rb +1 -1
  238. data/package.json +9 -5
  239. data/webpack/__mocks__/foremanReact/common/helpers.js +4 -1
  240. data/webpack/__mocks__/foremanReact/components/PermissionDenied/index.js +2 -0
  241. data/webpack/components/Content/ContentPage.js +55 -0
  242. data/webpack/{scenes/ModuleStreams/ModuleStreamsTable.js → components/Content/ContentTable.js} +9 -8
  243. data/webpack/components/Content/Details/ContentDetailInfo.js +33 -0
  244. data/webpack/{scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js → components/Content/Details/ContentDetailRepositories.js} +4 -4
  245. data/webpack/{scenes/ModuleStreams/Details/Repositories/TableSchema.js → components/Content/Details/ContentDetailRepositoryTableSchema.js} +1 -1
  246. data/webpack/components/Content/Details/ContentDetails.js +70 -0
  247. data/webpack/components/Content/Details/__tests__/ContentDetailInfo.test.js +28 -0
  248. data/webpack/components/Content/Details/__tests__/ContentDetailRepositories.test.js +22 -0
  249. data/webpack/components/Content/Details/__tests__/ContentDetails.test.js +64 -0
  250. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap +39 -0
  251. data/webpack/{scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap → components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap} +3 -9
  252. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +137 -0
  253. data/webpack/components/Content/__tests__/ContentPage.test.js +36 -0
  254. data/webpack/components/Content/__tests__/ContentTable.test.js +40 -0
  255. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +70 -0
  256. data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +33 -0
  257. data/webpack/components/Search/index.js +6 -7
  258. data/webpack/components/SelectOrg/SelectOrgAction.js +20 -22
  259. data/webpack/containers/Application/config.js +10 -0
  260. data/webpack/containers/Application/overrides.scss +5 -0
  261. data/webpack/move_to_foreman/common/helpers.js +1 -1
  262. data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +5 -2
  263. data/webpack/move_to_foreman/components/common/table/formatters/EntitlementsInlineEditFormatter.js +9 -2
  264. data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +2 -0
  265. data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +3 -0
  266. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +1 -0
  267. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +10 -10
  268. data/webpack/redux/actions/RedHatRepositories/__tests__/enabled.test.js +39 -0
  269. data/webpack/redux/actions/RedHatRepositories/enabled.js +24 -24
  270. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
  271. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +23 -22
  272. data/webpack/redux/actions/RedHatRepositories/sets.js +17 -21
  273. data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +1 -0
  274. data/webpack/redux/reducers/RedHatRepositories/__tests__/sets.test.js +1 -1
  275. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +1 -0
  276. data/webpack/redux/reducers/RedHatRepositories/enabled.js +42 -33
  277. data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +2 -1
  278. data/webpack/redux/reducers/RedHatRepositories/sets.js +2 -1
  279. data/webpack/redux/reducers/index.js +4 -0
  280. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +30 -0
  281. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsConstants.js +3 -0
  282. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsPage.js +80 -0
  283. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +39 -0
  284. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +60 -0
  285. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTables.scss +0 -0
  286. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetails.js +91 -0
  287. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +23 -0
  288. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsConstants.js +3 -0
  289. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +30 -0
  290. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionsSchema.js +35 -0
  291. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailInfo.test.js +16 -0
  292. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.fixtures.js +25 -0
  293. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +29 -0
  294. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +41 -0
  295. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsReducer.test.js +33 -0
  296. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailInfo.test.js.snap +83 -0
  297. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetails.test.js.snap +190 -0
  298. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsActions.test.js.snap +54 -0
  299. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsReducer.test.js.snap +50 -0
  300. data/webpack/scenes/AnsibleCollections/Details/index.js +17 -0
  301. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +25 -0
  302. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollections.fixtures.js +52 -0
  303. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsActions.test.js +48 -0
  304. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsReducer.test.js +46 -0
  305. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +27 -0
  306. data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionPage.test.js.snap +73 -0
  307. data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionsTable.test.js.snap +81 -0
  308. data/webpack/scenes/AnsibleCollections/index.js +17 -0
  309. data/webpack/scenes/ModuleStreams/Details/ModuleDetailsSchema.js +56 -0
  310. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +7 -71
  311. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +9 -11
  312. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +5 -3
  313. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +453 -507
  314. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +10 -11
  315. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +12 -33
  316. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -4
  317. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +8 -9
  318. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +5 -3
  319. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +83 -65
  320. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +1 -1
  321. data/webpack/scenes/Organizations/OrganizationActions.js +27 -32
  322. data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +12 -12
  323. data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +1 -1
  324. data/webpack/scenes/Products/ProductActions.js +10 -10
  325. data/webpack/scenes/Products/__tests__/ProductActions.test.js +6 -6
  326. data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +118 -0
  327. data/webpack/scenes/RedHatRepositories/__tests__/RedHatRepositoriesPage.test.js +51 -0
  328. data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +117 -0
  329. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +44 -45
  330. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/EnabledRepository.test.js +84 -5
  331. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +46 -47
  332. data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
  333. data/webpack/scenes/RedHatRepositories/index.js +2 -101
  334. data/webpack/scenes/Settings/Tables/TableActions.js +42 -43
  335. data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +18 -18
  336. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +10 -10
  337. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
  338. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +8 -8
  339. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
  340. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +142 -113
  341. data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +8 -0
  342. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +40 -40
  343. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +24 -24
  344. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -199
  345. data/webpack/scenes/Subscriptions/SubscriptionActions.js +52 -46
  346. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +21 -2
  347. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +64 -42
  348. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  349. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +21 -21
  350. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +20 -21
  351. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -15
  352. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +12 -13
  353. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -14
  354. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +21 -23
  355. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +35 -1
  356. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +13 -0
  357. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +7 -0
  358. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +18 -0
  359. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +5 -4
  360. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +26 -5
  361. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +9 -1
  362. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +27 -2
  363. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +5 -4
  364. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +1 -0
  365. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Dialogs/UpdateDialog.js +9 -9
  366. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +8 -3
  367. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -23
  368. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +0 -135
  369. data/webpack/scenes/Subscriptions/index.js +2 -0
  370. data/webpack/scenes/Tasks/TaskActions.js +36 -31
  371. data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +35 -47
  372. metadata +146 -67
  373. data/app/controllers/katello/api/v2/ping_controller.rb +0 -24
  374. data/app/lib/actions/katello/capsule_content/create_repos.rb +0 -30
  375. data/app/lib/actions/katello/capsule_content/remove_orphans.rb +0 -21
  376. data/app/lib/actions/pulp/repository/refresh_needed.rb +0 -37
  377. data/app/lib/katello/resources/candlepin/owner_info.rb +0 -18
  378. data/app/models/katello/glue/candlepin/owner_info.rb +0 -41
  379. data/app/models/katello/repository_file.rb +0 -7
  380. data/app/overrides/add_subscription_status.rb +0 -6
  381. data/app/views/overrides/hosts/_subscription_link.html.erb +0 -6
  382. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-events.controller.js +0 -17
  383. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +0 -30
  384. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
  385. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -58
  386. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-product-details.controller.js +0 -12
  387. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-products.controller.js +0 -30
  388. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -25
  389. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +0 -120
  390. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-products.html +0 -54
  391. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/grouped.filter.js +0 -21
  392. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-details.controller.js +0 -34
  393. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-history.controller.js +0 -18
  394. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +0 -261
  395. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest.controller.js +0 -16
  396. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +0 -19
  397. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +0 -46
  398. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +0 -17
  399. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -92
  400. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +0 -33
  401. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-start-date.directive.js +0 -21
  402. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-type.directive.js +0 -16
  403. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptionAttachAmountFilter.filter.js +0 -16
  404. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.controller.js +0 -73
  405. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +0 -110
  406. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -5
  407. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +0 -2
  408. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-type.html +0 -18
  409. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions-delete-bulk.html +0 -4
  410. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +0 -63
  411. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +0 -52
  412. data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +0 -16
@@ -57,7 +57,6 @@ module Katello
57
57
  validates_with Validators::ContainerImageNameValidator, :attributes => :docker_upstream_name, :allow_blank => true, :if => :docker?
58
58
 
59
59
  validate :ensure_valid_docker_attributes, :if => :docker?
60
- validate :ensure_valid_ansible_collection_attributes, :if => :ansible_collection?
61
60
  validate :ensure_docker_repo_unprotected, :if => :docker?
62
61
  validate :ensure_ostree_repo_protected, :if => :ostree?
63
62
  validate :ensure_compatible_download_policy, :if => :yum?
@@ -104,6 +103,16 @@ module Katello
104
103
  }
105
104
  delegate :redhat?, :provider, :organization, to: :product
106
105
 
106
+ # Note - Audit hook added to find records based on column except associations to display audit information
107
+ def self.audit_hook_to_find_records(name, change, _audit)
108
+ if name =~ /_id$/
109
+ case name
110
+ when 'content_id'
111
+ Katello::Content.find_by(:cp_content_id => change)
112
+ end
113
+ end
114
+ end
115
+
107
116
  def library_instance
108
117
  repositories.in_default_view.first
109
118
  end
@@ -213,10 +222,6 @@ module Katello
213
222
  end
214
223
  end
215
224
 
216
- def ensure_valid_ansible_collection_attributes
217
- errors.add(:base, N_("Whitelist cannot be blank.")) if ansible_collection_whitelist.blank?
218
- end
219
-
220
225
  def ensure_valid_upstream_authorization
221
226
  return if (self.upstream_username.blank? && self.upstream_password.blank?)
222
227
  if redhat?
@@ -289,7 +294,7 @@ module Katello
289
294
  ssl_ca_cert_id ssl_client_cert_id ssl_client_key_id http_proxy_policy http_proxy_id)
290
295
  changeable_attributes += %w(name container_repository_name docker_tags_whitelist) if docker?
291
296
  changeable_attributes += %w(deb_releases deb_components deb_architectures gpg_key_id) if deb?
292
- changeable_attributes += %w(ansible_collection_whitelist) if ansible_collection?
297
+ changeable_attributes += %w(ansible_collection_requirements) if ansible_collection?
293
298
  changeable_attributes.any? { |key| previous_changes.key?(key) }
294
299
  end
295
300
 
@@ -3,10 +3,6 @@ module Katello
3
3
  include Concerns::PulpDatabaseUnit
4
4
 
5
5
  CONTENT_TYPE = 'rpm'.freeze
6
-
7
- has_many :repository_rpms, :class_name => "Katello::RepositoryRpm", :dependent => :destroy, :inverse_of => :rpm
8
- has_many :repositories, :through => :repository_rpms, :class_name => "Katello::Repository"
9
-
10
6
  has_many :content_facet_applicable_rpms, :class_name => "Katello::ContentFacetApplicableRpm",
11
7
  :dependent => :destroy, :inverse_of => :rpm
12
8
  has_many :content_facets, :through => :content_facet_applicable_rpms, :class_name => "Katello::Host::ContentFacet"
@@ -31,10 +27,6 @@ module Katello
31
27
  order(:name).order(:epoch).order(:version_sortable).order(:release_sortable)
32
28
  end
33
29
 
34
- def self.repository_association_class
35
- RepositoryRpm
36
- end
37
-
38
30
  def self.content_facet_association_class
39
31
  ContentFacetApplicableRpm
40
32
  end
@@ -3,20 +3,12 @@ module Katello
3
3
  include Concerns::PulpDatabaseUnit
4
4
 
5
5
  CONTENT_TYPE = 'srpm'.freeze
6
-
7
- has_many :repository_srpms, :class_name => "Katello::RepositorySrpm", :dependent => :destroy, :inverse_of => :srpm
8
- has_many :repositories, :through => :repository_srpms, :class_name => "Katello::Repository"
9
-
10
6
  before_save lambda { |rpm| rpm.summary = rpm.summary.truncate(255) unless rpm.summary.blank? }
11
7
 
12
8
  def self.default_sort
13
9
  order(:name).order(:epoch).order(:version_sortable).order(:release_sortable)
14
10
  end
15
11
 
16
- def self.repository_association_class
17
- RepositorySrpm
18
- end
19
-
20
12
  def self.total_for_repositories(repos)
21
13
  self.in_repositories(repos).count
22
14
  end
@@ -31,6 +31,8 @@ module Katello
31
31
  def base_params(params)
32
32
  attachable = ::Foreman::Cast.to_bool(params.delete(:attachable))
33
33
  params[:consumer] = upstream_consumer_id if attachable
34
+ params[:sort_by] = 'Product.name'
35
+ params[:order] = 'asc'
34
36
  params
35
37
  end
36
38
 
@@ -10,10 +10,6 @@ module Katello
10
10
  super(repository)
11
11
  end
12
12
 
13
- def self.many_repository_associations
14
- false
15
- end
16
-
17
13
  # yum metadata file only has one repo
18
14
  def repositories
19
15
  [repository]
@@ -8,12 +8,7 @@ class Setting::Content < Setting
8
8
  Hash[parameters.map { |p| [p, p] }]
9
9
  end
10
10
 
11
- def self.load_defaults
12
- return unless super
13
-
14
- BLANK_ATTRS.concat %w(register_hostname_fact default_location_subscribed_hosts
15
- default_location_puppet_content content_default_http_proxy host_dmi_uuid_duplicates)
16
-
11
+ def self.default_settings
17
12
  download_policies = proc { hashify_parameters(::Runcible::Models::YumImporter::DOWNLOAD_POLICIES) }
18
13
  proxy_download_policies = proc { hashify_parameters(::SmartProxy::DOWNLOAD_POLICIES) }
19
14
  dependency_solving_options = proc { hashify_parameters(['conservative', 'greedy']) }
@@ -25,128 +20,129 @@ class Setting::Content < Setting
25
20
  text_method: 'name_and_url'
26
21
  }]
27
22
 
28
- self.transaction do
29
- [
30
- self.set('content_default_http_proxy', N_("Default HTTP Proxy for syncing content"),
31
- nil, N_('Default http proxy'),
32
- nil,
33
- collection: proc { http_proxy_select }, include_blank: N_("no global default")
34
- ),
35
- self.set('katello_default_provision', N_("Default provisioning template for Operating Systems created from synced content"),
36
- 'Kickstart default', N_('Default synced OS provisioning template'),
37
- nil, :collection => proc { katello_template_setting_values("provision") }
38
- ),
39
- self.set('katello_default_finish',
40
- N_("Default finish template for new Operating Systems created from synced content"),
41
- 'Kickstart default finish', N_('Default synced OS finish template'),
42
- nil, :collection => proc { katello_template_setting_values("finish") }
43
- ),
44
- self.set('katello_default_user_data', N_("Default user data for new Operating Systems created from synced content"),
45
- 'Kickstart default user data', N_('Default synced OS user-data'),
46
- nil, :collection => proc { katello_template_setting_values("user_data") }
47
- ),
48
- self.set('katello_default_PXELinux', N_("Default PXELinux template for new Operating Systems created from synced content"),
49
- 'Kickstart default PXELinux', N_('Default synced OS PXELinux template'),
50
- nil, :collection => proc { katello_template_setting_values("PXELinux") }
51
- ),
52
- self.set('katello_default_PXEGrub', N_("Default PXEGrub template for new Operating Systems created from synced content"),
53
- 'Kickstart default PXEGrub', N_('Default synced OS PXEGrub template'),
54
- nil, :collection => proc { katello_template_setting_values("PXEGrub") }
55
- ),
56
- self.set('katello_default_PXEGrub2', N_("Default PXEGrub2 template for new Operating Systems created from synced content"),
57
- 'Kickstart default PXEGrub2', N_('Default synced OS PXEGrub2 template'),
58
- nil, :collection => proc { katello_template_setting_values("PXEGrub2") }
59
- ),
60
- self.set('katello_default_iPXE', N_("Default iPXE template for new Operating Systems created from synced content"),
61
- 'Kickstart default iPXE', N_('Default synced OS iPXE template'),
62
- nil, :collection => proc { katello_template_setting_values("iPXE") }
63
- ),
64
- self.set('katello_default_ptable', N_("Default partitioning table for new Operating Systems created from synced content"),
65
- 'Kickstart default', N_('Default synced OS partition table'),
66
- nil, :collection => proc { Hash[Template.all.where(:type => "Ptable").map { |tmp| [tmp[:name], tmp[:name]] }] }
67
- ), self.set('katello_default_kexec', N_("Default kexec template for new Operating Systems created from synced content"), 'Discovery Red Hat kexec', N_('Default synced OS kexec template'),
68
- nil, :collection => proc { katello_template_setting_values("kexec") }
69
- ),
70
- self.set('katello_default_atomic_provision', N_("Default provisioning template for new Atomic Operating Systems created from synced content"),
71
- 'Atomic Kickstart default', N_('Default synced OS Atomic template'),
72
- nil, :collection => proc { katello_template_setting_values("provision") }
73
- ),
74
- self.set('manifest_refresh_timeout', N_('Timeout when refreshing a manifest (in seconds)'), 60 * 20, N_("Manifest refresh timeout")),
75
- self.set('content_action_accept_timeout', N_("Time in seconds to wait for a Host to pickup a remote action"),
76
- 20, N_('Accept action timeout')),
77
- self.set('content_action_finish_timeout', N_("Time in seconds to wait for a Host to finish a remote action"),
78
- 3600, N_('Finish action timeout')),
79
- self.set('content_disconnected', N_("A server operating in disconnected mode does not communicate with the Red Hat CDN."),
80
- false, N_('Disconnected mode')),
81
- self.set('errata_status_installable', N_("Calculate errata host status based only on errata in a Host's Content View and Lifecycle Environment"),
82
- false, N_('Installable errata from Content View')),
83
- self.set('restrict_composite_view', N_("If set to true, a composite content view may not be published or "\
84
- "promoted, unless the component content view versions that it includes exist in the target environment."),
85
- false, N_('Restrict Composite Content View promotion')),
86
- self.set('check_services_before_actions', N_("Whether or not to check the status of backend services such as pulp and candlepin prior to performing some actions."),
87
- true, N_('Check services before actions')),
88
- self.set('foreman_proxy_content_auto_sync', N_("Whether or not to auto sync the Smart Proxies after a Content View promotion."),
89
- true, N_('Sync Smart Proxies after Content View promotion')),
90
- self.set('default_download_policy', N_("Default download policy for custom repositories (either 'immediate', 'on_demand', or 'background')"), "immediate",
91
- N_('Default Custom Repository download policy'), nil, :collection => download_policies),
92
- self.set('default_redhat_download_policy', N_("Default download policy for enabled Red Hat repositories (either 'immediate', 'on_demand', or 'background')"), "on_demand",
93
- N_('Default Red Hat Repository download policy'), nil, :collection => download_policies),
94
- self.set('default_proxy_download_policy', N_("Default download policy for Smart Proxy syncs (either 'inherit', immediate', 'on_demand', or 'background')"), "on_demand",
95
- N_('Default Smart Proxy download policy'), nil, :collection => proxy_download_policies),
96
- self.set('pulp_docker_registry_port', N_("The port used by Pulp Crane to provide Docker Registries"),
97
- 5000, N_('Pulp Docker registry port')),
98
- self.set('pulp_export_destination', N_("On-disk location for exported repositories"),
99
- "/var/lib/pulp/katello-export", N_('Pulp export destination filepath')),
100
- self.set('pulp_client_key', N_("Path for ssl key used for pulp server auth"),
101
- "/etc/pki/katello/private/pulp-client.key", N_('Pulp client key')),
102
- self.set('pulp_client_cert', N_("Path for ssl cert used for pulp server auth"),
103
- "/etc/pki/katello/certs/pulp-client.crt", N_('Pulp client cert')),
104
- self.set('remote_execution_by_default', N_("If set to true, use the remote execution over katello-agent for remote actions"),
105
- false, N_('Use remote execution by default')),
106
- self.set('unregister_delete_host', N_("When unregistering a host via subscription-manager, also delete the host record. Managed resources linked to host " \
107
- "such as virtual machines and DNS records may also be deleted."),
108
- false, N_('Delete Host upon unregister')),
109
- self.set('register_hostname_fact', N_("When registering a host via subscription-manager, force use the specified fact (in the form of 'fact.fact')"),
110
- '', N_('Subscription manager name registration fact'), nil),
111
- self.set('register_hostname_fact_strict_match', N_('If true, and register_hostname_fact is set and provided, registration will look for a new host by name only '\
112
- 'using that fact, and will skip all hostname matching'), false, N_('Subscription manager name registration fact strict matching'), nil),
113
- self.set('erratum_install_batch_size', N_("Errata installed via katello-agent will be triggered in batches of this size. Set to 0 to install all errata in one batch."),
114
- 0, N_('Erratum Install Batch Size')),
115
- self.set('default_location_subscribed_hosts',
116
- N_('Default Location where new subscribed hosts will put upon registration'),
117
- nil, N_('Default Location subscribed hosts'), nil,
118
- :collection => proc { Hash[Location.unscoped.all.map { |loc| [loc[:title], loc[:title]] }] }),
119
- self.set('default_location_puppet_content',
120
- N_('Default Location where new Puppet content will be put upon Content View publish'),
121
- nil, N_('Default Location Puppet content'), nil,
122
- :collection => proc { Hash[Location.unscoped.all.map { |loc| [loc[:title], loc[:title]] }] }),
123
- self.set('host_update_lock', N_("Allow multiple concurrent Actions::Katello::Host::Update calls for one host to be processed at the same time."),
124
- false, N_('Concurrent Actions::Katello::Host::Update allowed')),
125
- self.set('expire_soon_days', N_('The number of days remaining in a subscription before you will be reminded about renewing it.'),
126
- 120, N_('Expire soon days')),
127
- self.set('content_view_solve_dependencies',
128
- N_('The default dependency solving value for new Content Views.'),
129
- false, N_('Content View Dependency Solving Default')),
130
- self.set('dependency_solving_algorithm',
131
- N_("How the logic of solving dependencies in a Content View is managed. Conservative will only add " \
132
- "packages to solve the dependencies if the package needed doesn't exist. Greedy will pull in the " \
133
- "latest package to solve a dependency even if it already does exist in the repository."),
134
- 'conservative', N_('Content View Dependency Solving Algorithm'), nil,
135
- :collection => dependency_solving_options),
136
- self.set('host_tasks_workers_pool_size', N_("Amount of workers in the pool to handle the execution of host-related tasks. When set to 0, the default queue will be used instead. Restart of the dynflowd/foreman-tasks service is required."),
137
- 5, N_('Host Tasks Workers Pool Size')),
138
- self.set('host_dmi_uuid_duplicates',
139
- N_("If hosts fail to register because of duplicate DMI UUIDs " \
140
- "add their comma-separated values here. Subsequent registrations will generate a unique DMI UUID for the affected hosts."),
141
- [], N_('Host Duplicate DMI UUIDs')),
142
- self.set('host_profile_assume', N_("Allow new Host registrations to assume registered profiles with matching hostname " \
143
- "as long as the registering DMI UUID is not used by another host."),
144
- true, N_('Host Profile Assume')),
145
- self.set('host_tasks_workers_pool_size', N_("Amount of workers in the pool to handle the execution of host-related tasks. When set to 0, the default queue will be used instead. Restart of the dynflowd/foreman-tasks service is required."),
146
- 5, N_('Host Tasks Workers Pool Size'))
147
- ].each { |s| self.create! s.update(:category => "Setting::Content") }
148
- end
149
- true
23
+ [
24
+ self.set('content_default_http_proxy', N_("Default HTTP Proxy for syncing content"),
25
+ nil, N_('Default http proxy'),
26
+ nil,
27
+ collection: proc { http_proxy_select }, include_blank: N_("no global default")
28
+ ),
29
+ self.set('katello_default_provision', N_("Default provisioning template for Operating Systems created from synced content"),
30
+ 'Kickstart default', N_('Default synced OS provisioning template'),
31
+ nil, :collection => proc { katello_template_setting_values("provision") }
32
+ ),
33
+ self.set('katello_default_finish',
34
+ N_("Default finish template for new Operating Systems created from synced content"),
35
+ 'Kickstart default finish', N_('Default synced OS finish template'),
36
+ nil, :collection => proc { katello_template_setting_values("finish") }
37
+ ),
38
+ self.set('katello_default_user_data', N_("Default user data for new Operating Systems created from synced content"),
39
+ 'Kickstart default user data', N_('Default synced OS user-data'),
40
+ nil, :collection => proc { katello_template_setting_values("user_data") }
41
+ ),
42
+ self.set('katello_default_PXELinux', N_("Default PXELinux template for new Operating Systems created from synced content"),
43
+ 'Kickstart default PXELinux', N_('Default synced OS PXELinux template'),
44
+ nil, :collection => proc { katello_template_setting_values("PXELinux") }
45
+ ),
46
+ self.set('katello_default_PXEGrub', N_("Default PXEGrub template for new Operating Systems created from synced content"),
47
+ 'Kickstart default PXEGrub', N_('Default synced OS PXEGrub template'),
48
+ nil, :collection => proc { katello_template_setting_values("PXEGrub") }
49
+ ),
50
+ self.set('katello_default_PXEGrub2', N_("Default PXEGrub2 template for new Operating Systems created from synced content"),
51
+ 'Kickstart default PXEGrub2', N_('Default synced OS PXEGrub2 template'),
52
+ nil, :collection => proc { katello_template_setting_values("PXEGrub2") }
53
+ ),
54
+ self.set('katello_default_iPXE', N_("Default iPXE template for new Operating Systems created from synced content"),
55
+ 'Kickstart default iPXE', N_('Default synced OS iPXE template'),
56
+ nil, :collection => proc { katello_template_setting_values("iPXE") }
57
+ ),
58
+ self.set('katello_default_ptable', N_("Default partitioning table for new Operating Systems created from synced content"),
59
+ 'Kickstart default', N_('Default synced OS partition table'),
60
+ nil, :collection => proc { Hash[Template.all.where(:type => "Ptable").map { |tmp| [tmp[:name], tmp[:name]] }] }
61
+ ), self.set('katello_default_kexec', N_("Default kexec template for new Operating Systems created from synced content"), 'Discovery Red Hat kexec', N_('Default synced OS kexec template'),
62
+ nil, :collection => proc { katello_template_setting_values("kexec") }
63
+ ),
64
+ self.set('katello_default_atomic_provision', N_("Default provisioning template for new Atomic Operating Systems created from synced content"),
65
+ 'Atomic Kickstart default', N_('Default synced OS Atomic template'),
66
+ nil, :collection => proc { katello_template_setting_values("provision") }
67
+ ),
68
+ self.set('manifest_refresh_timeout', N_('Timeout when refreshing a manifest (in seconds)'), 60 * 20, N_("Manifest refresh timeout")),
69
+ self.set('content_action_accept_timeout', N_("Time in seconds to wait for a Host to pickup a remote action"),
70
+ 20, N_('Accept action timeout')),
71
+ self.set('content_action_finish_timeout', N_("Time in seconds to wait for a Host to finish a remote action"),
72
+ 3600, N_('Finish action timeout')),
73
+ self.set('content_disconnected', N_("A server operating in disconnected mode does not communicate with the Red Hat CDN."),
74
+ false, N_('Disconnected mode')),
75
+ self.set('errata_status_installable', N_("Calculate errata host status based only on errata in a Host's Content View and Lifecycle Environment"),
76
+ false, N_('Installable errata from Content View')),
77
+ self.set('restrict_composite_view', N_("If set to true, a composite content view may not be published or "\
78
+ "promoted, unless the component content view versions that it includes exist in the target environment."),
79
+ false, N_('Restrict Composite Content View promotion')),
80
+ self.set('check_services_before_actions', N_("Whether or not to check the status of backend services such as pulp and candlepin prior to performing some actions."),
81
+ true, N_('Check services before actions')),
82
+ self.set('foreman_proxy_content_auto_sync', N_("Whether or not to auto sync the Smart Proxies after a Content View promotion."),
83
+ true, N_('Sync Smart Proxies after Content View promotion')),
84
+ self.set('default_download_policy', N_("Default download policy for custom repositories (either 'immediate', 'on_demand', or 'background')"), "immediate",
85
+ N_('Default Custom Repository download policy'), nil, :collection => download_policies),
86
+ self.set('default_redhat_download_policy', N_("Default download policy for enabled Red Hat repositories (either 'immediate', 'on_demand', or 'background')"), "on_demand",
87
+ N_('Default Red Hat Repository download policy'), nil, :collection => download_policies),
88
+ self.set('default_proxy_download_policy', N_("Default download policy for Smart Proxy syncs (either 'inherit', immediate', 'on_demand', or 'background')"), "on_demand",
89
+ N_('Default Smart Proxy download policy'), nil, :collection => proxy_download_policies),
90
+ self.set('pulp_docker_registry_port', N_("The port used by Pulp Crane to provide Docker Registries"),
91
+ 5000, N_('Pulp Docker registry port')),
92
+ self.set('pulp_export_destination', N_("On-disk location for exported repositories"),
93
+ "/var/lib/pulp/katello-export", N_('Pulp export destination filepath')),
94
+ self.set('pulp_client_key', N_("Path for ssl key used for pulp server auth"),
95
+ "/etc/pki/katello/private/pulp-client.key", N_('Pulp client key')),
96
+ self.set('pulp_client_cert', N_("Path for ssl cert used for pulp server auth"),
97
+ "/etc/pki/katello/certs/pulp-client.crt", N_('Pulp client cert')),
98
+ self.set('remote_execution_by_default', N_("If set to true, use the remote execution over katello-agent for remote actions"),
99
+ false, N_('Use remote execution by default')),
100
+ self.set('unregister_delete_host', N_("When unregistering a host via subscription-manager, also delete the host record. Managed resources linked to host " \
101
+ "such as virtual machines and DNS records may also be deleted."),
102
+ false, N_('Delete Host upon unregister')),
103
+ self.set('register_hostname_fact', N_("When registering a host via subscription-manager, force use the specified fact (in the form of 'fact.fact')"),
104
+ '', N_('Subscription manager name registration fact'), nil),
105
+ self.set('register_hostname_fact_strict_match', N_('If true, and register_hostname_fact is set and provided, registration will look for a new host by name only '\
106
+ 'using that fact, and will skip all hostname matching'), false, N_('Subscription manager name registration fact strict matching'), nil),
107
+ self.set('erratum_install_batch_size', N_("Errata installed via katello-agent will be triggered in batches of this size. Set to 0 to install all errata in one batch."),
108
+ 0, N_('Erratum Install Batch Size')),
109
+ self.set('default_location_subscribed_hosts',
110
+ N_('Default Location where new subscribed hosts will put upon registration'),
111
+ nil, N_('Default Location subscribed hosts'), nil,
112
+ :collection => proc { Hash[Location.unscoped.all.map { |loc| [loc[:title], loc[:title]] }] }),
113
+ self.set('default_location_puppet_content',
114
+ N_('Default Location where new Puppet content will be put upon Content View publish'),
115
+ nil, N_('Default Location Puppet content'), nil,
116
+ :collection => proc { Hash[Location.unscoped.all.map { |loc| [loc[:title], loc[:title]] }] }),
117
+ self.set('host_update_lock', N_("Allow multiple concurrent Actions::Katello::Host::Update calls for one host to be processed at the same time."),
118
+ false, N_('Concurrent Actions::Katello::Host::Update allowed')),
119
+ self.set('expire_soon_days', N_('The number of days remaining in a subscription before you will be reminded about renewing it.'),
120
+ 120, N_('Expire soon days')),
121
+ self.set('content_view_solve_dependencies',
122
+ N_('The default dependency solving value for new Content Views.'),
123
+ false, N_('Content View Dependency Solving Default')),
124
+ self.set('dependency_solving_algorithm',
125
+ N_("How the logic of solving dependencies in a Content View is managed. Conservative will only add " \
126
+ "packages to solve the dependencies if the package needed doesn't exist. Greedy will pull in the " \
127
+ "latest package to solve a dependency even if it already does exist in the repository."),
128
+ 'conservative', N_('Content View Dependency Solving Algorithm'), nil,
129
+ :collection => dependency_solving_options),
130
+ self.set('host_dmi_uuid_duplicates',
131
+ N_("If hosts fail to register because of duplicate DMI UUIDs " \
132
+ "add their comma-separated values here. Subsequent registrations will generate a unique DMI UUID for the affected hosts."),
133
+ [], N_('Host Duplicate DMI UUIDs')),
134
+ self.set('host_profile_assume', N_("Allow new Host registrations to assume registered profiles with matching hostname " \
135
+ "as long as the registering DMI UUID is not used by another host."),
136
+ true, N_('Host Profile Assume')),
137
+ self.set('host_tasks_workers_pool_size', N_("Amount of workers in the pool to handle the execution of host-related tasks. When set to 0, the default queue will be used instead. Restart of the dynflowd/foreman-tasks service is required."),
138
+ 5, N_('Host Tasks Workers Pool Size'))
139
+ ]
140
+ end
141
+
142
+ def self.load_defaults
143
+ BLANK_ATTRS.concat %w(register_hostname_fact default_location_subscribed_hosts
144
+ default_location_puppet_content content_default_http_proxy host_dmi_uuid_duplicates)
145
+ super
150
146
  end
151
147
 
152
148
  def self.katello_template_setting_values(name)
@@ -13,7 +13,6 @@ module Katello
13
13
  CP_TYPES = [SYSTEM, HYPERVISOR, CANDLEPIN].freeze
14
14
 
15
15
  lazy_accessor :entitlements, :initializer => lambda { |_s| Resources::Candlepin::Consumer.entitlements(uuid) }
16
- lazy_accessor :events, :initializer => lambda { |_s| Resources::Candlepin::Consumer.events(uuid) }
17
16
  lazy_accessor :consumer_attributes, :initializer => lambda { |_s| Resources::Candlepin::Consumer.get(uuid) }
18
17
  lazy_accessor :installed_products, :initializer => lambda { |_s| consumer_attributes['installedProducts'] }
19
18
  lazy_accessor :available_pools, :initializer => lambda { |_s| Resources::Candlepin::Consumer.available_pools(owner_label, uuid, false) }
@@ -3,10 +3,17 @@ module Katello
3
3
  class Content
4
4
  extend Katello::Abstract::Pulp::Content
5
5
  class << self
6
- extend Forwardable
7
- def_delegator :pulp_content, :create_upload_request, :create_upload
8
- def_delegator :pulp_content, :delete_upload_request, :delete_upload
9
- def_delegator :pulp_content, :upload_bits, :upload_chunk
6
+ def create_upload(_size = 0, _checksum = nil, _content_type = nil)
7
+ pulp_content.create_upload_request
8
+ end
9
+
10
+ def delete_upload(upload_id)
11
+ pulp_content.delete_upload_request(upload_id)
12
+ end
13
+
14
+ def upload_chunk(upload_id, offset, content, _size)
15
+ pulp_content.upload_bits(upload_id, offset, content)
16
+ end
10
17
 
11
18
  private def pulp_content
12
19
  SmartProxy.pulp_master.pulp_api.resources.content
@@ -6,7 +6,6 @@ module Katello
6
6
  def update_model(model)
7
7
  taggable_class = backend_data['manifest_type'] == "list" ? ::Katello::DockerManifestList : ::Katello::DockerManifest
8
8
  model.docker_taggable = taggable_class.find_by(:digest => backend_data['manifest_digest'])
9
- model.repository_id = ::Katello::Repository.find_by(:pulp_id => backend_data['repo_id']).try(:id)
10
9
  model.name = backend_data['name']
11
10
  model.save!
12
11
  end
@@ -30,6 +30,10 @@ module Katello
30
30
  "_id"
31
31
  end
32
32
 
33
+ def self.content_type
34
+ self::CONTENT_TYPE
35
+ end
36
+
33
37
  def self.unit_handler
34
38
  Katello.pulp_server.extensions.send(self.name.demodulize.underscore)
35
39
  end
@@ -79,6 +79,14 @@ module Katello
79
79
  false
80
80
  end
81
81
 
82
+ def create_mirror_entities
83
+ create
84
+ end
85
+
86
+ def mirror_needs_updates?
87
+ needs_importer_updates? || needs_distributor_updates?
88
+ end
89
+
82
90
  def sync(overrides = {})
83
91
  sync_options = {}
84
92
  sync_options[:max_speed] = SETTINGS.dig(:katello, :pulp, :sync_KBlimit)
@@ -121,6 +129,19 @@ module Katello
121
129
  end
122
130
  end
123
131
 
132
+ def needs_importer_updates?
133
+ repo_details = backend_data
134
+ return unless repo_details
135
+ capsule_importer = repo_details["importers"][0]
136
+ !importer_matches?(capsule_importer)
137
+ end
138
+
139
+ def needs_distributor_updates?
140
+ repo_details = backend_data
141
+ return unless repo_details
142
+ !distributors_match?(repo_details["distributors"])
143
+ end
144
+
124
145
  def master_importer_connection_options
125
146
  options = {
126
147
  basic_auth_username: root.upstream_username,
@@ -185,6 +206,10 @@ module Katello
185
206
  tasks
186
207
  end
187
208
 
209
+ def refresh_mirror_entities
210
+ refresh
211
+ end
212
+
188
213
  def update_or_associate_importer
189
214
  existing_importers = backend_data["importers"]
190
215
  importer = generate_importer
@@ -273,6 +298,34 @@ module Katello
273
298
  end
274
299
  { proxy_host: '' }
275
300
  end
301
+
302
+ private
303
+
304
+ def filtered_distribution_config_equal?(generated_config, actual_config)
305
+ generated = generated_config.clone
306
+ actual = actual_config.clone
307
+ #We store 'default' checksum type as nil, but pulp will default to sha256, so if we haven't set it, ignore it
308
+ if generated.keys.include?('checksum_type') && generated['checksum_type'].nil?
309
+ generated.delete('checksum_type')
310
+ actual.delete('checksum_type')
311
+ end
312
+ generated.compact == actual.compact
313
+ end
314
+
315
+ def importer_matches?(capsule_importer)
316
+ generated_importer = generate_importer
317
+ capsule_importer.try(:[], 'importer_type_id') == generated_importer.id &&
318
+ generated_importer.config.compact == capsule_importer['config'].compact
319
+ end
320
+
321
+ def distributors_match?(capsule_distributors)
322
+ generated_distributor_configs = generate_distributors
323
+ generated_distributor_configs.all? do |gen_dist|
324
+ type = gen_dist.class.type_id
325
+ found_on_capsule = capsule_distributors.find { |dist| dist['distributor_type_id'] == type }
326
+ found_on_capsule && filtered_distribution_config_equal?(gen_dist.config, found_on_capsule['config'])
327
+ end
328
+ end
276
329
  end
277
330
  end
278
331
  end