katello 4.13.1 → 4.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 (386) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +12 -8
  3. data/app/assets/javascripts/katello/locale/bn/katello.js +274 -22
  4. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +274 -22
  5. data/app/assets/javascripts/katello/locale/ca/katello.js +274 -22
  6. data/app/assets/javascripts/katello/locale/cs/katello.js +274 -22
  7. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +275 -23
  8. data/app/assets/javascripts/katello/locale/de/katello.js +280 -28
  9. data/app/assets/javascripts/katello/locale/de_AT/katello.js +274 -22
  10. data/app/assets/javascripts/katello/locale/de_DE/katello.js +274 -22
  11. data/app/assets/javascripts/katello/locale/el/katello.js +274 -22
  12. data/app/assets/javascripts/katello/locale/en/katello.js +274 -22
  13. data/app/assets/javascripts/katello/locale/en_GB/katello.js +274 -22
  14. data/app/assets/javascripts/katello/locale/en_US/katello.js +274 -22
  15. data/app/assets/javascripts/katello/locale/es/katello.js +276 -24
  16. data/app/assets/javascripts/katello/locale/et_EE/katello.js +274 -22
  17. data/app/assets/javascripts/katello/locale/fr/katello.js +283 -31
  18. data/app/assets/javascripts/katello/locale/gl/katello.js +274 -22
  19. data/app/assets/javascripts/katello/locale/gu/katello.js +274 -22
  20. data/app/assets/javascripts/katello/locale/he_IL/katello.js +274 -22
  21. data/app/assets/javascripts/katello/locale/hi/katello.js +274 -22
  22. data/app/assets/javascripts/katello/locale/id/katello.js +274 -22
  23. data/app/assets/javascripts/katello/locale/it/katello.js +274 -22
  24. data/app/assets/javascripts/katello/locale/ja/katello.js +283 -31
  25. data/app/assets/javascripts/katello/locale/ka/katello.js +280 -28
  26. data/app/assets/javascripts/katello/locale/kn/katello.js +274 -22
  27. data/app/assets/javascripts/katello/locale/ko/katello.js +274 -22
  28. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +274 -22
  29. data/app/assets/javascripts/katello/locale/mr/katello.js +274 -22
  30. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +274 -22
  31. data/app/assets/javascripts/katello/locale/or/katello.js +274 -22
  32. data/app/assets/javascripts/katello/locale/pa/katello.js +274 -22
  33. data/app/assets/javascripts/katello/locale/pl/katello.js +274 -22
  34. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +274 -22
  35. data/app/assets/javascripts/katello/locale/pt/katello.js +274 -22
  36. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +276 -24
  37. data/app/assets/javascripts/katello/locale/ro/katello.js +274 -22
  38. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +274 -22
  39. data/app/assets/javascripts/katello/locale/ru/katello.js +274 -22
  40. data/app/assets/javascripts/katello/locale/sl/katello.js +274 -22
  41. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +274 -22
  42. data/app/assets/javascripts/katello/locale/ta/katello.js +274 -22
  43. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +274 -22
  44. data/app/assets/javascripts/katello/locale/te/katello.js +274 -22
  45. data/app/assets/javascripts/katello/locale/tr/katello.js +274 -22
  46. data/app/assets/javascripts/katello/locale/vi/katello.js +274 -22
  47. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +274 -22
  48. data/app/assets/javascripts/katello/locale/zh/katello.js +274 -22
  49. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +283 -31
  50. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +274 -22
  51. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +118 -74
  52. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -10
  53. data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -1
  54. data/app/controllers/katello/api/v2/api_controller.rb +7 -0
  55. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
  56. data/app/controllers/katello/api/v2/debs_controller.rb +3 -2
  57. data/app/controllers/katello/api/v2/environments_controller.rb +2 -4
  58. data/app/controllers/katello/api/v2/host_contents_controller.rb +8 -3
  59. data/app/controllers/katello/api/v2/host_errata_controller.rb +4 -4
  60. data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -2
  61. data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
  62. data/app/controllers/katello/api/v2/packages_controller.rb +13 -3
  63. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +6 -2
  64. data/app/controllers/katello/api/v2/repositories_controller.rb +3 -4
  65. data/app/controllers/katello/api/v2/repository_sets_controller.rb +13 -14
  66. data/app/controllers/katello/api/v2/subscriptions_controller.rb +15 -9
  67. data/app/controllers/katello/api/v2/sync_controller.rb +2 -2
  68. data/app/controllers/katello/application_controller.rb +1 -1
  69. data/app/controllers/katello/concerns/api/v2/authorization.rb +3 -2
  70. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +28 -0
  71. data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +1 -1
  72. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +4 -3
  73. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +2 -4
  74. data/app/controllers/katello/remote_execution_controller.rb +53 -58
  75. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +19 -2
  76. data/app/helpers/katello/katello_urls_helper.rb +1 -1
  77. data/app/lib/actions/katello/alternate_content_source/alternate_content_source_common.rb +1 -1
  78. data/app/lib/actions/katello/alternate_content_source/update.rb +2 -1
  79. data/app/lib/actions/katello/capsule_content/verify_checksum.rb +1 -2
  80. data/app/lib/actions/katello/content_view/publish.rb +1 -0
  81. data/app/lib/actions/katello/content_view_version/create_repos.rb +1 -0
  82. data/app/lib/actions/katello/content_view_version/incremental_update.rb +3 -2
  83. data/app/lib/actions/katello/environment/{publish_repositories.rb → publish_container_repositories.rb} +10 -8
  84. data/app/lib/actions/katello/foreman/content_update.rb +4 -6
  85. data/app/lib/actions/katello/host/hypervisors_update.rb +6 -4
  86. data/app/lib/actions/katello/repository/create.rb +4 -4
  87. data/app/lib/actions/katello/repository/import_upload.rb +4 -6
  88. data/app/lib/actions/katello/repository/metadata_generate.rb +1 -0
  89. data/app/lib/actions/katello/repository/update.rb +3 -3
  90. data/app/lib/actions/katello/repository_set/enable_repository.rb +5 -6
  91. data/app/lib/actions/middleware/backend_services_check.rb +3 -2
  92. data/app/lib/actions/pulp3/abstract_async_task.rb +2 -4
  93. data/app/lib/actions/pulp3/capsule_content/verify_checksum.rb +1 -2
  94. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +5 -1
  95. data/app/lib/actions/pulp3/orchestration/repository/delete.rb +5 -2
  96. data/app/lib/actions/pulp3/repository/save_version.rb +3 -5
  97. data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -9
  98. data/app/lib/katello/errors.rb +1 -0
  99. data/app/lib/katello/http_resource.rb +1 -0
  100. data/app/lib/katello/lazy_accessor.rb +1 -1
  101. data/app/lib/katello/resources/candlepin/candlepin_ping.rb +0 -5
  102. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  103. data/app/lib/katello/resources/candlepin/pool.rb +1 -2
  104. data/app/lib/katello/resources/candlepin/upstream_job.rb +1 -1
  105. data/app/lib/katello/resources/cdn.rb +3 -2
  106. data/app/lib/katello/resources/discovery/yum.rb +3 -3
  107. data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
  108. data/app/lib/katello/util/data.rb +3 -2
  109. data/app/lib/katello/util/errata.rb +4 -3
  110. data/app/lib/katello/util/package.rb +3 -3
  111. data/app/lib/katello/util/path_with_substitutions.rb +1 -1
  112. data/app/lib/katello/util/report_table.rb +3 -2
  113. data/app/lib/katello/util/url_matcher.rb +1 -1
  114. data/app/lib/katello/validators/alternate_content_source_path_validator.rb +4 -3
  115. data/app/lib/katello/validators/alternate_content_source_products_validator.rb +5 -7
  116. data/app/lib/katello/validators/container_image_name_validator.rb +1 -1
  117. data/app/lib/katello/validators/katello_name_format_validator.rb +2 -2
  118. data/app/lib/katello/validators/no_trailing_space_validator.rb +2 -2
  119. data/app/lib/katello/validators/prior_validator.rb +2 -2
  120. data/app/lib/katello/validators/product_unique_attribute_validator.rb +2 -4
  121. data/app/models/katello/activation_key.rb +4 -6
  122. data/app/models/katello/alternate_content_source.rb +1 -1
  123. data/app/models/katello/authorization/host_tracer.rb +1 -2
  124. data/app/models/katello/candlepin/repository_mapper.rb +2 -2
  125. data/app/models/katello/concerns/host_managed_extensions.rb +41 -10
  126. data/app/models/katello/concerns/hostgroup_extensions.rb +2 -4
  127. data/app/models/katello/concerns/location_extensions.rb +2 -4
  128. data/app/models/katello/concerns/operatingsystem_extensions.rb +84 -16
  129. data/app/models/katello/concerns/smart_proxy_extensions.rb +4 -4
  130. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
  131. data/app/models/katello/content_view.rb +5 -1
  132. data/app/models/katello/content_view_environment.rb +19 -4
  133. data/app/models/katello/content_view_environment_content_facet.rb +11 -0
  134. data/app/models/katello/erratum.rb +1 -1
  135. data/app/models/katello/event.rb +1 -1
  136. data/app/models/katello/glue/provider.rb +1 -2
  137. data/app/models/katello/hash_util.rb +1 -1
  138. data/app/models/katello/host/content_facet.rb +16 -3
  139. data/app/models/katello/host/subscription_facet.rb +27 -4
  140. data/app/models/katello/host_collection.rb +12 -8
  141. data/app/models/katello/pool.rb +5 -1
  142. data/app/models/katello/product.rb +7 -4
  143. data/app/models/katello/provider.rb +1 -2
  144. data/app/models/katello/repository.rb +18 -4
  145. data/app/models/katello/root_repository.rb +19 -0
  146. data/app/models/katello/rpm.rb +2 -2
  147. data/app/models/katello/subscription_facet_pool.rb +1 -1
  148. data/app/models/katello/sync_plan.rb +5 -4
  149. data/app/models/katello/task_status.rb +18 -18
  150. data/app/presenters/katello/product_host_count_presenter.rb +10 -0
  151. data/app/services/katello/candlepin/consumer.rb +11 -11
  152. data/app/services/katello/candlepin/message_handler.rb +3 -2
  153. data/app/services/katello/content_unit_indexer.rb +6 -0
  154. data/app/services/katello/pulp3/alternate_content_source.rb +1 -3
  155. data/app/services/katello/pulp3/api/core.rb +1 -1
  156. data/app/services/katello/pulp3/api/docker.rb +10 -0
  157. data/app/services/katello/pulp3/content_view_version/export.rb +1 -0
  158. data/app/services/katello/pulp3/content_view_version/import.rb +6 -4
  159. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -3
  160. data/app/services/katello/pulp3/repository/apt.rb +4 -16
  161. data/app/services/katello/pulp3/repository/yum.rb +9 -5
  162. data/app/services/katello/pulp3/repository.rb +2 -2
  163. data/app/services/katello/pulp3/repository_mirror.rb +2 -9
  164. data/app/services/katello/pulp3/task.rb +4 -2
  165. data/app/services/katello/registration_manager.rb +13 -3
  166. data/app/services/katello/smart_proxy_helper.rb +1 -0
  167. data/app/views/dashboard/_host_collection_widget.html.erb +5 -4
  168. data/app/views/foreman/job_templates/install_errata.erb +2 -0
  169. data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +2 -0
  170. data/app/views/foreman/job_templates/install_errata_by_search_query.erb +2 -0
  171. data/app/views/foreman/job_templates/install_errata_by_search_query_-_katello_ansible_default.erb +3 -1
  172. data/app/views/foreman/job_templates/install_packages_by_search_query_-_katello_ansible_default.erb +1 -1
  173. data/app/views/foreman/job_templates/remove_packages_by_search_query_-_katello_ansible_default.erb +2 -2
  174. data/app/views/foreman/job_templates/resolve_traces.erb +5 -1
  175. data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +1 -1
  176. data/app/views/foreman/job_templates/upload_profile.erb +2 -0
  177. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +7 -5
  178. data/app/views/katello/api/v2/content_facet/base.json.rabl +18 -2
  179. data/app/views/katello/api/v2/packages/thindex.json.rabl +6 -0
  180. data/app/views/katello/api/v2/repositories/show.json.rabl +8 -8
  181. data/app/views/katello/api/v2/repository_sets/show.json.rabl +1 -1
  182. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  183. data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
  184. data/app/views/katello/api/v2/subscriptions/show.json.rabl +1 -0
  185. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +14 -11
  186. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +4 -4
  187. data/config/routes/api/v2.rb +3 -1
  188. data/config/routes.rb +1 -3
  189. data/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +1 -0
  190. data/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +1 -0
  191. data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +3 -0
  192. data/db/migrate/20240522165308_add_priority_to_content_view_environment_content_facet.rb +5 -0
  193. data/db/migrate/20240621121212_katello_repository_debs_id_bigint.rb +6 -0
  194. data/db/migrate/20240729192228_add_convert2rhel_to_host_facets.rb +9 -0
  195. data/db/seeds.d/102-organizations.rb +5 -7
  196. data/db/seeds.d/150-module_job_templates.rb +7 -9
  197. data/db/seeds.d/75-job_templates.rb +9 -16
  198. data/engines/bastion_katello/README.md +3 -0
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +6 -6
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +4 -4
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +6 -6
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +28 -27
  205. data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
  206. data/lib/katello/engine.rb +1 -8
  207. data/lib/katello/permission_creator.rb +3 -2
  208. data/lib/katello/plugin.rb +31 -27
  209. data/lib/katello/tasks/clean_old_file_repos.rake +2 -4
  210. data/lib/katello/tasks/reset.rake +3 -4
  211. data/lib/katello/version.rb +1 -1
  212. data/lib/katello.rb +0 -2
  213. data/lib/monkeys/ar_postgres_evr_t.rb +2 -0
  214. data/locale/action_names.rb +1 -1
  215. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  216. data/locale/bn/katello.po +274 -22
  217. data/locale/bn_IN/katello.po +274 -22
  218. data/locale/ca/katello.po +274 -22
  219. data/locale/cs/katello.po +274 -22
  220. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  221. data/locale/cs_CZ/katello.po +275 -23
  222. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  223. data/locale/de/katello.po +280 -28
  224. data/locale/de_AT/katello.po +274 -22
  225. data/locale/de_DE/katello.po +274 -22
  226. data/locale/el/katello.po +274 -22
  227. data/locale/en/katello.po +274 -22
  228. data/locale/en_GB/katello.po +274 -22
  229. data/locale/en_US/katello.po +274 -22
  230. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  231. data/locale/es/katello.po +276 -24
  232. data/locale/et_EE/katello.po +274 -22
  233. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  234. data/locale/fr/katello.po +283 -31
  235. data/locale/gl/katello.po +274 -22
  236. data/locale/gu/katello.po +274 -22
  237. data/locale/he_IL/katello.po +274 -22
  238. data/locale/hi/katello.po +274 -22
  239. data/locale/id/katello.po +274 -22
  240. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  241. data/locale/it/katello.po +274 -22
  242. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  243. data/locale/ja/katello.po +283 -31
  244. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  245. data/locale/ka/katello.po +280 -28
  246. data/locale/katello.pot +1001 -527
  247. data/locale/kn/katello.po +274 -22
  248. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  249. data/locale/ko/katello.po +274 -22
  250. data/locale/ml_IN/katello.po +274 -22
  251. data/locale/mr/katello.po +274 -22
  252. data/locale/nl_NL/katello.po +274 -22
  253. data/locale/or/katello.po +274 -22
  254. data/locale/pa/katello.po +274 -22
  255. data/locale/pl/katello.po +274 -22
  256. data/locale/pl_PL/katello.po +274 -22
  257. data/locale/pt/katello.po +274 -22
  258. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  259. data/locale/pt_BR/katello.po +276 -24
  260. data/locale/ro/katello.po +274 -22
  261. data/locale/ro_RO/katello.po +274 -22
  262. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  263. data/locale/ru/katello.po +274 -22
  264. data/locale/sl/katello.po +274 -22
  265. data/locale/sv_SE/katello.po +274 -22
  266. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  267. data/locale/ta/katello.po +274 -22
  268. data/locale/ta_IN/katello.po +274 -22
  269. data/locale/te/katello.po +274 -22
  270. data/locale/tr/katello.po +274 -22
  271. data/locale/vi/katello.po +274 -22
  272. data/locale/vi_VN/katello.po +274 -22
  273. data/locale/zh/katello.po +274 -22
  274. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  275. data/locale/zh_CN/katello.po +283 -31
  276. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  277. data/locale/zh_TW/katello.po +274 -22
  278. data/webpack/ForemanColumnExtensions/index.js +44 -1
  279. data/webpack/components/Table/TableWrapper.js +6 -0
  280. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +24 -3
  281. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +124 -56
  282. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/HostContentViewActions.js +2 -3
  283. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/contentViewDetailsCard.test.js +44 -10
  284. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +75 -31
  285. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
  286. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionHooks.js +1 -1
  287. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +22 -7
  288. data/webpack/components/extensions/Hosts/ActionsBar/ActionsBar.scss +14 -0
  289. data/webpack/components/extensions/Hosts/ActionsBar/index.js +82 -23
  290. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js +5 -2
  291. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js +171 -0
  292. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js +160 -0
  293. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.js +99 -0
  294. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +157 -0
  295. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/index.js +24 -0
  296. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +157 -0
  297. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_Review.js +168 -0
  298. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.js +141 -0
  299. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +252 -0
  300. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/index.js +24 -0
  301. data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +176 -0
  302. data/webpack/components/extensions/Hosts/TableRowActions/index.js +17 -0
  303. data/webpack/global_index.js +11 -3
  304. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +5 -6
  305. data/webpack/redux/reducers/RedHatRepositories/__tests__/repositorySetRepositories.test.js +1 -1
  306. data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +1 -1
  307. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +2 -1
  308. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +2 -1
  309. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +2 -1
  310. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  311. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  312. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -2
  313. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +2 -1
  314. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +3 -2
  315. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +2 -1
  316. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +2 -1
  317. data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +2 -1
  318. data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +2 -2
  319. data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +1 -0
  320. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +10 -0
  321. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +6 -0
  322. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +2 -0
  323. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +14 -0
  324. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +1 -0
  325. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +10 -0
  326. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +1 -0
  327. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +10 -0
  328. data/webpack/scenes/Tasks/helpers.js +1 -1
  329. metadata +24 -63
  330. data/app/assets/javascripts/katello/containers/container.js +0 -304
  331. data/app/lib/katello/util/http_helper.rb +0 -15
  332. data/app/models/732bd3db9f64c621c64d2be4f2a838727aac0845.patch +0 -61
  333. data/app/models/katello/repository.rb.bak +0 -978
  334. data/app/services/katello/pulp3/content_view_version/import_validator.rb.bak +0 -166
  335. data/app/services/katello/pulp3/content_view_version/importable_repositories.rb.bak +0 -164
  336. data/lib/katello/tasks/update_repository_expiry.rake +0 -114
  337. data/locale/bn/katello.po.time_stamp +0 -0
  338. data/locale/bn_IN/katello.po.time_stamp +0 -0
  339. data/locale/ca/katello.po.time_stamp +0 -0
  340. data/locale/cs/katello.po.time_stamp +0 -0
  341. data/locale/cs_CZ/katello.po.time_stamp +0 -0
  342. data/locale/de/katello.po.time_stamp +0 -0
  343. data/locale/de_AT/katello.po.time_stamp +0 -0
  344. data/locale/de_DE/katello.po.time_stamp +0 -0
  345. data/locale/el/katello.po.time_stamp +0 -0
  346. data/locale/en/katello.po.time_stamp +0 -0
  347. data/locale/en_GB/katello.po.time_stamp +0 -0
  348. data/locale/en_US/katello.po.time_stamp +0 -0
  349. data/locale/es/katello.po.time_stamp +0 -0
  350. data/locale/et_EE/katello.po.time_stamp +0 -0
  351. data/locale/fr/katello.po.time_stamp +0 -0
  352. data/locale/gl/katello.po.time_stamp +0 -0
  353. data/locale/gu/katello.po.time_stamp +0 -0
  354. data/locale/he_IL/katello.po.time_stamp +0 -0
  355. data/locale/hi/katello.po.time_stamp +0 -0
  356. data/locale/id/katello.po.time_stamp +0 -0
  357. data/locale/it/katello.po.time_stamp +0 -0
  358. data/locale/ja/katello.po.time_stamp +0 -0
  359. data/locale/ka/katello.po.time_stamp +0 -0
  360. data/locale/kn/katello.po.time_stamp +0 -0
  361. data/locale/ko/katello.po.time_stamp +0 -0
  362. data/locale/ml_IN/katello.po.time_stamp +0 -0
  363. data/locale/mr/katello.po.time_stamp +0 -0
  364. data/locale/nl_NL/katello.po.time_stamp +0 -0
  365. data/locale/or/katello.po.time_stamp +0 -0
  366. data/locale/pa/katello.po.time_stamp +0 -0
  367. data/locale/pl/katello.po.time_stamp +0 -0
  368. data/locale/pl_PL/katello.po.time_stamp +0 -0
  369. data/locale/pt/katello.po.time_stamp +0 -0
  370. data/locale/pt_BR/katello.po.time_stamp +0 -0
  371. data/locale/ro/katello.po.time_stamp +0 -0
  372. data/locale/ro_RO/katello.po.time_stamp +0 -0
  373. data/locale/ru/katello.po.time_stamp +0 -0
  374. data/locale/sl/katello.po.time_stamp +0 -0
  375. data/locale/sv_SE/katello.po.time_stamp +0 -0
  376. data/locale/ta/katello.po.time_stamp +0 -0
  377. data/locale/ta_IN/katello.po.time_stamp +0 -0
  378. data/locale/te/katello.po.time_stamp +0 -0
  379. data/locale/tr/katello.po.time_stamp +0 -0
  380. data/locale/vi/katello.po.time_stamp +0 -0
  381. data/locale/vi_VN/katello.po.time_stamp +0 -0
  382. data/locale/zh/katello.po.time_stamp +0 -0
  383. data/locale/zh_CN/katello.po.time_stamp +0 -0
  384. data/locale/zh_TW/katello.po.time_stamp +0 -0
  385. data/webpack/global_test_setup.js.bak +0 -59
  386. data/webpack/utils/useKatelloDocUrl.js +0 -18
@@ -6,9 +6,7 @@ module Katello
6
6
  skip_before_action :authorize
7
7
  before_action :optional_authorize, only: [:token, :catalog]
8
8
  before_action :registry_authorize, except: [:token, :v1_search, :catalog]
9
- before_action :authorize_repository_read, only: [:pull_manifest, :tags_list]
10
- # TODO: authorize_repository_write commented out due to container push changes. Additional task needed to fix.
11
- # before_action :authorize_repository_write, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
9
+ before_action :authorize_repository_read, only: [:pull_manifest, :tags_list, :check_blob, :pull_blob]
12
10
  before_action :container_push_prop_validation, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
13
11
  before_action :create_container_repo_if_needed, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
14
12
  skip_before_action :check_media_type, only: [:start_upload_blob, :upload_blob, :finish_upload_blob,
@@ -86,7 +84,6 @@ module Katello
86
84
 
87
85
  def container_push_prop_validation(props = nil)
88
86
  # Handle validation and repo creation for container pushes before talking to pulp
89
- return false unless confirm_push_settings
90
87
  props = parse_blob_push_props if props.nil?
91
88
  return false unless check_blob_push_field_syntax(props)
92
89
 
@@ -143,7 +140,7 @@ module Katello
143
140
  unless props[:valid_format]
144
141
  return render_podman_error(
145
142
  "NAME_INVALID",
146
- "Invalid format. Container pushes should follow 'organization_label/product_label/name' OR 'id/organization_id/product_id/name' schema.",
143
+ _("Invalid format. Container pushes should follow 'organization_label/product_label/name' OR 'id/organization_id/product_id/name' schema."),
147
144
  :bad_request
148
145
  )
149
146
  end
@@ -156,7 +153,7 @@ module Katello
156
153
  unless org_label.present? && org_label.length > 0
157
154
  return render_podman_error(
158
155
  "NAME_INVALID",
159
- "Invalid format. Organization label cannot be blank.",
156
+ _("Invalid format. Organization label cannot be blank."),
160
157
  :bad_request
161
158
  )
162
159
  end
@@ -173,11 +170,12 @@ module Katello
173
170
  unless root_repos.empty?
174
171
  return render_podman_error(
175
172
  "NAME_INVALID",
176
- "Due to a change in your organizations, this container name has become "\
177
- "ambiguous (org name '#{org_label}'). If you wish to continue using this "\
178
- "container name, destroy the organization in conflict with '#{o.name} (id "\
179
- "#{o.id}). If you wish to keep both orgs, destroy '#{o.label}/#{prod.label}/"\
180
- "#{root_repos.first.label}' and retry your push using the id format.",
173
+ _("Due to a change in your organizations, this container name has become "\
174
+ "ambiguous (org name '%{org_label}'). If you wish to continue using this "\
175
+ "container name, destroy the organization in conflict with '%{o_name} (id "\
176
+ "%{o_id}). If you wish to keep both orgs, destroy '%{o_label}/%{prod_label}/"\
177
+ "%{root_repo_label}' and retry your push using the id format.") %
178
+ { org_label: org_label, o_name: o.name, o_id: o.id, o_label: o.label, prod_label: prod.label, root_repo_label: root_repos.first.label },
181
179
  :conflict
182
180
  )
183
181
  end
@@ -188,14 +186,14 @@ module Katello
188
186
  # Otherwise tell them to try pushing with ID format
189
187
  return render_podman_error(
190
188
  "NAME_INVALID",
191
- "Organization label '#{org_label}' is ambiguous. Try using an id-based container name.",
189
+ _("Organization label '%s' is ambiguous. Try using an id-based container name.") % org_label,
192
190
  :conflict
193
191
  )
194
192
  end
195
193
  if org.length == 0
196
194
  return render_podman_error(
197
195
  "NAME_UNKNOWN",
198
- "Organization not found: '#{org_label}'",
196
+ _("Organization not found: '%s'") % org_label,
199
197
  :not_found
200
198
  )
201
199
  end
@@ -208,7 +206,7 @@ module Katello
208
206
  unless org_id.present? && org_id == org_id.to_i.to_s
209
207
  return render_podman_error(
210
208
  "NAME_INVALID",
211
- "Invalid format. Organization id must be an integer without leading zeros.",
209
+ _("Invalid format. Organization id must be an integer without leading zeros."),
212
210
  :bad_request
213
211
  )
214
212
  end
@@ -216,7 +214,7 @@ module Katello
216
214
  if @organization.nil?
217
215
  return render_podman_error(
218
216
  "NAME_UNKNOWN",
219
- "Organization id not found: '#{org_id}'",
217
+ _("Organization id not found: '%s'") % org_id,
220
218
  :not_found
221
219
  )
222
220
  end
@@ -228,7 +226,7 @@ module Katello
228
226
  unless prod_label.present? && prod_label.length > 0
229
227
  return render_podman_error(
230
228
  "NAME_INVALID",
231
- "Invalid format. Product label cannot be blank.",
229
+ _("Invalid format. Product label cannot be blank."),
232
230
  :bad_request
233
231
  )
234
232
  end
@@ -243,11 +241,12 @@ module Katello
243
241
  unless root_repos.empty?
244
242
  return render_podman_error(
245
243
  "NAME_INVALID",
246
- "Due to a change in your products, this container name has become ambiguous "\
247
- "(product name '#{prod_label}'). If you wish to continue using this container "\
248
- "name, destroy the product in conflict with '#{prod.name}' (id #{prod.id}). If "\
249
- "you wish to keep both products, destroy '#{@organization.label}/#{prod.label}/"\
250
- "#{root_repos.first.label}' and retry your push using the id format.",
244
+ _("Due to a change in your products, this container name has become ambiguous "\
245
+ "(product name '%{prod_label}'). If you wish to continue using this container "\
246
+ "name, destroy the product in conflict with '%{prod_name}' (id %{prod_id}). If "\
247
+ "you wish to keep both products, destroy '%{org_label}/%{prod_dot_label}/"\
248
+ "%{root_repo_label}' and retry your push using the id format.") %
249
+ { prod_label: prod_label, prod_name: prod.name, prod_id: prod.id, org_label: @organization.label, prod_dot_label: prod.label, root_repo_label: root_repos.first.label },
251
250
  :conflict
252
251
  )
253
252
  end
@@ -256,14 +255,14 @@ module Katello
256
255
 
257
256
  return render_podman_error(
258
257
  "NAME_INVALID",
259
- "Product label '#{prod_label}' is ambiguous. Try using an id-based container name.",
258
+ _("Product label '%s' is ambiguous. Try using an id-based container name.") % prod_label,
260
259
  :conflict
261
260
  )
262
261
  end
263
262
  if product.length == 0
264
263
  return render_podman_error(
265
264
  "NAME_UNKNOWN",
266
- "Product not found: '#{prod_label}'",
265
+ _("Product not found: '%s'") % prod_label,
267
266
  :not_found
268
267
  )
269
268
  end
@@ -276,7 +275,7 @@ module Katello
276
275
  unless prod_id.present? && prod_id == prod_id.to_i.to_s
277
276
  return render_podman_error(
278
277
  "NAME_INVALID",
279
- "Invalid format. Product id must be an integer without leading zeros.",
278
+ _("Invalid format. Product id must be an integer without leading zeros."),
280
279
  :bad_request
281
280
  )
282
281
  end
@@ -284,7 +283,7 @@ module Katello
284
283
  if @product.nil?
285
284
  return render_podman_error(
286
285
  "NAME_UNKNOWN",
287
- "Product id not found: '#{prod_id}'",
286
+ _("Product id not found: '%s'") % prod_id,
288
287
  :not_found
289
288
  )
290
289
  end
@@ -299,11 +298,16 @@ module Katello
299
298
  return product.root_repositories.where(label: root_repo_name)
300
299
  end
301
300
 
301
+ def root_repository
302
+ @root_repository ||= get_root_repo_from_product(@product, @container_name)&.first
303
+ @root_repository
304
+ end
305
+
302
306
  def check_blob_push_container(props)
303
307
  unless props[:name].present? && props[:name].length > 0
304
308
  return render_podman_error(
305
309
  "NAME_INVALID",
306
- "Invalid format. Container name cannot be blank.",
310
+ _("Invalid format. Container name cannot be blank."),
307
311
  :bad_request
308
312
  )
309
313
  end
@@ -321,7 +325,8 @@ module Katello
321
325
  if !root_repo.nil? && @container_push_name_format != root_repo.container_push_name_format
322
326
  return render_podman_error(
323
327
  "NAME_INVALID",
324
- "Repository name '#{@container_name}' already exists in this product using a different naming scheme. Please retry your request with the #{root_repo.container_push_name_format} format or destroy and recreate the repository using your preferred schema.",
328
+ _("Repository name '%{container_name}' already exists in this product using a different naming scheme. Please retry your request with the %{root_repo_container_push_name} format or destroy and recreate the repository using your preferred schema.") %
329
+ {container_name: @container_name, root_repo_container_push_name: root_repo.container_push_name_format},
325
330
  :conflict
326
331
  )
327
332
  end
@@ -330,6 +335,14 @@ module Katello
330
335
  end
331
336
 
332
337
  def create_container_repo_if_needed
338
+ unless @product.syncable?
339
+ return render_podman_error(
340
+ 'DENIED',
341
+ _("Requested access to '%s' is denied") % @container_name,
342
+ :not_found
343
+ )
344
+ end
345
+
333
346
  if get_root_repo_from_product(@product, @container_name).empty?
334
347
  root = @product.add_repo(
335
348
  name: @container_name,
@@ -345,38 +358,74 @@ module Katello
345
358
  end
346
359
  end
347
360
 
348
- def blob_push_cleanup
349
- # after manifest upload, index content and set version href using pulp api
350
- root_repo = get_root_repo_from_product(@product, @container_name)&.first
351
- instance_repo = root_repo&.library_instance
361
+ def save_pulp_push_repository_href
362
+ instance_repo = root_repository&.library_instance
352
363
 
353
- unless root_repo.present? && instance_repo.present?
364
+ unless root_repository.present? && instance_repo.present?
354
365
  return render_podman_error(
355
366
  "BLOB_UPLOAD_UNKNOWN",
356
- "Could not locate local uploaded repository for content indexing.",
367
+ _("Could not locate local uploaded repository for content indexing."),
357
368
  :not_found
358
369
  )
359
370
  end
360
371
 
361
- api = ::Katello::Pulp3::Repository.api(SmartProxy.pulp_primary, ::Katello::Repository::DOCKER_TYPE).container_push_api
362
- api_response = api.list(name: @container_path_input)&.results&.first
363
- latest_version_href = api_response&.latest_version_href
364
- pulp_href = api_response&.pulp_href
372
+ pulp_api = instance_repo.backend_service(SmartProxy.pulp_primary).api
373
+ push_repo_api_response = pulp_api.container_push_repo_for_name(@container_path_input)
374
+
375
+ latest_version_href = push_repo_api_response&.latest_version_href
376
+ pulp_repo_href = push_repo_api_response&.pulp_href
365
377
 
366
- if latest_version_href.empty? || pulp_href.empty?
378
+ if latest_version_href.empty? || pulp_repo_href.empty?
367
379
  return render_podman_error(
368
380
  "BLOB_UPLOAD_UNKNOWN",
369
- "Could not locate repository properties for content indexing.",
381
+ _("Could not locate repository properties for content indexing."),
370
382
  :not_found
371
383
  )
372
384
  end
373
385
 
374
386
  instance_repo.update!(version_href: latest_version_href)
375
- ::Katello::Pulp3::RepositoryReference.where(root_repository_id: instance_repo.root_id,
376
- content_view_id: instance_repo.content_view.id, repository_href: pulp_href).create!
377
- instance_repo.index_content
387
+ # The Pulp repository should not change after first creation
388
+ if root_repository.repository_references.empty?
389
+ ::Katello::Pulp3::RepositoryReference.where(root_repository_id: instance_repo.root_id,
390
+ content_view_id: instance_repo.content_view.id,
391
+ repository_href: pulp_repo_href).create!
392
+ end
393
+ return pulp_repo_href
394
+ end
378
395
 
379
- true
396
+ def save_pulp_push_distribution_href(pulp_repo_href)
397
+ instance_repo = root_repository&.library_instance
398
+ pulp_api = instance_repo.backend_service(SmartProxy.pulp_primary).api
399
+ instance_repo = root_repository&.library_instance
400
+ distribution_api_response = pulp_api.container_push_distribution_for_repository(pulp_repo_href)
401
+ pulp_distribution_href = distribution_api_response&.pulp_href
402
+
403
+ if pulp_distribution_href.empty?
404
+ return render_podman_error(
405
+ "BLOB_UPLOAD_UNKNOWN",
406
+ _("Could not locate Pulp distribution."),
407
+ :not_found
408
+ )
409
+ end
410
+ dist = ::Katello::Pulp3::DistributionReference.where(path: @container_path_input,
411
+ href: pulp_distribution_href,
412
+ repository_id: instance_repo.id).first
413
+ if dist
414
+ if dist.href != pulp_distribution_href
415
+ dist.update(href: pulp_distribution_href)
416
+ end
417
+ else
418
+ ::Katello::Pulp3::DistributionReference.create!(path: @container_path_input,
419
+ href: pulp_distribution_href,
420
+ repository_id: instance_repo.id)
421
+ end
422
+ end
423
+
424
+ def save_push_repo_hrefs
425
+ # After content upload, save Pulp hrefs.
426
+ pulp_repo_href = save_pulp_push_repository_href
427
+ return unless pulp_repo_href
428
+ save_pulp_push_distribution_href(pulp_repo_href)
380
429
  end
381
430
 
382
431
  def find_writable_repository
@@ -466,7 +515,7 @@ module Katello
466
515
  key.match("^HTTP_.*")
467
516
  end
468
517
  env.each do |header|
469
- headers[header[0].split('_')[1..-1].join('-')] = header[1]
518
+ headers[header[0].split('_')[1..].join('-')] = header[1]
470
519
  end
471
520
 
472
521
  if (manifest_response = redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers) })
@@ -499,6 +548,17 @@ module Katello
499
548
  redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers, max_redirects: 0) }
500
549
  end
501
550
 
551
+ def translated_headers_for_proxy
552
+ current_headers = {}
553
+ env = request.env.select do |key, _value|
554
+ key.match("^HTTP_.*")
555
+ end
556
+ env.each do |header|
557
+ current_headers[header[0].split('_')[1..].join('-')] = header[1]
558
+ end
559
+ current_headers
560
+ end
561
+
502
562
  def start_upload_blob
503
563
  headers = translated_headers_for_proxy
504
564
  headers['Content-Type'] = request.headers['Content-Type'] if request.headers['Content-Type']
@@ -509,20 +569,10 @@ module Katello
509
569
  response.header[key.to_s] = value
510
570
  end
511
571
 
572
+ save_push_repo_hrefs if pulp_response.code.between?(200, 299)
512
573
  head pulp_response.code
513
574
  end
514
575
 
515
- def translated_headers_for_proxy
516
- current_headers = {}
517
- env = request.env.select do |key, _value|
518
- key.match("^HTTP_.*")
519
- end
520
- env.each do |header|
521
- current_headers[header[0].split('_')[1..-1].join('-')] = header[1]
522
- end
523
- current_headers
524
- end
525
-
526
576
  def upload_blob
527
577
  headers = translated_headers_for_proxy
528
578
  headers['Content-Type'] = request.headers['Content-Type'] if request.headers['Content-Type']
@@ -535,6 +585,7 @@ module Katello
535
585
  response.header[key.to_s] = value
536
586
  end
537
587
 
588
+ save_push_repo_hrefs if pulp_response.code.between?(200, 299)
538
589
  head pulp_response.code
539
590
  end
540
591
 
@@ -549,6 +600,7 @@ module Katello
549
600
  response.header[key.to_s] = value
550
601
  end
551
602
 
603
+ save_push_repo_hrefs if pulp_response.code.between?(200, 299)
552
604
  head pulp_response.code
553
605
  end
554
606
 
@@ -561,9 +613,9 @@ module Katello
561
613
  response.header[key.to_s] = value
562
614
  end
563
615
 
564
- cleanup_result = blob_push_cleanup if pulp_response.code.between?(200, 299)
565
- return false unless cleanup_result
566
-
616
+ save_push_repo_hrefs if pulp_response.code.between?(200, 299)
617
+ # Indexing content is only needed after pushing manifests
618
+ root_repository.library_instance.index_content
567
619
  head pulp_response.code
568
620
  end
569
621
 
@@ -573,7 +625,7 @@ module Katello
573
625
  end
574
626
 
575
627
  def v1_ping
576
- head 200
628
+ head :ok
577
629
  end
578
630
 
579
631
  def v1_search
@@ -642,23 +694,24 @@ module Katello
642
694
 
643
695
  def get_manifest_files(repository, manifest)
644
696
  files = ['manifest.json']
645
- if manifest['schemaVersion'] == 1
697
+ case manifest['schemaVersion']
698
+ when 1
646
699
  if manifest['fsLayers']
647
700
  files += manifest['fsLayers'].collect do |layer|
648
- layerfile = "#{layer['blobSum'][7..-1]}.tar"
701
+ layerfile = "#{layer['blobSum'][7..]}.tar"
649
702
  force_include_layer(repository, layer['blobSum'], layerfile)
650
703
  layerfile
651
704
  end
652
705
  end
653
- elsif manifest['schemaVersion'] == 2
706
+ when 2
654
707
  if manifest['layers']
655
708
  files += manifest['layers'].collect do |layer|
656
- layerfile = "#{layer['digest'][7..-1]}.tar"
709
+ layerfile = "#{layer['digest'][7..]}.tar"
657
710
  force_include_layer(repository, layer['digest'], layerfile)
658
711
  layerfile
659
712
  end
660
713
  end
661
- files << "#{manifest['config']['digest'][7..-1]}.tar"
714
+ files << "#{manifest['config']['digest'][7..]}.tar"
662
715
  else
663
716
  render_error 'custom_error', :status => :internal_server_error,
664
717
  :locals => { :message => "Unsupported schema #{manifest['schemaVersion']}" }
@@ -720,15 +773,6 @@ module Katello
720
773
  :locals => { :message => "Registry not configured" })
721
774
  end
722
775
 
723
- def confirm_push_settings
724
- return true if SETTINGS.dig(:katello, :container_image_registry, :allow_push)
725
- render_podman_error(
726
- "UNSUPPORTED",
727
- "Registry push is not enabled. To enable, add ':katello:'->':container_image_registry:'->':allow_push: true' in the katello settings file.",
728
- :unprocessable_entity
729
- )
730
- end
731
-
732
776
  def request_url
733
777
  request.protocol + request.host_with_port
734
778
  end
@@ -760,7 +804,7 @@ module Katello
760
804
  end
761
805
 
762
806
  def item_not_found(item)
763
- render_podman_error("NAME_UNKNOWN", "#{item} was not found!", :not_found)
807
+ render_podman_error("NAME_UNKNOWN", _("%s was not found!") % item, :not_found)
764
808
  end
765
809
  end
766
810
  end
@@ -259,14 +259,7 @@ module Katello
259
259
  def facts
260
260
  User.current = User.anonymous_admin
261
261
  @host.update_candlepin_associations(rhsm_params)
262
- if params[:environments]
263
- new_envs = params[:environments].map do |env|
264
- get_content_view_environment("cp_id", env['id'])
265
- end
266
- new_envs.compact!
267
- Rails.logger.debug "Setting new content view environments for host #{@host.to_label}: #{new_envs.map(&:label)}"
268
- @host.content_facet.content_view_environments = new_envs
269
- end
262
+ update_environments_from_facts(params[:environments]) if params[:environments]
270
263
  update_host_registered_through(@host, request.headers)
271
264
  @host.refresh_statuses([::Katello::RhelLifecycleStatus])
272
265
  render :json => {:content => _("Facts successfully updated.")}, :status => :ok
@@ -412,6 +405,18 @@ module Katello
412
405
  activation_keys
413
406
  end
414
407
 
408
+ def update_environments_from_facts(param_environments)
409
+ return if param_environments.blank?
410
+ new_envs = param_environments.map do |env|
411
+ get_content_view_environment("cp_id", env['id'])
412
+ end
413
+ new_envs.compact!
414
+ Rails.logger.debug "Setting new content view environments for host #{@host.to_label}: #{new_envs.map(&:label)}"
415
+ @host.content_facet.content_view_environments = new_envs
416
+ rescue ::Katello::Errors::MultiEnvironmentNotSupportedError => e
417
+ raise HttpErrors::BadRequest, e.message
418
+ end
419
+
415
420
  def get_content_view_environment(key, value)
416
421
  cve = nil
417
422
  if value
@@ -465,8 +470,8 @@ module Katello
465
470
  end
466
471
 
467
472
  def authorize_client_or_admin
468
- unless client_authorized?
469
- deny_access unless authorize
473
+ if !client_authorized? && !authorize
474
+ deny_access
470
475
  end
471
476
  end
472
477
 
@@ -239,7 +239,7 @@ module Katello
239
239
  param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the activation key's content view version")
240
240
  param_group :search, Api::V2::ApiController
241
241
  def product_content
242
- # note this is just there as a place holder for apipie.
242
+ # NOTE: this is just there as a place holder for apipie.
243
243
  # The routing would automatically redirect it to repository_sets#index
244
244
  end
245
245
 
@@ -88,6 +88,13 @@ module Katello
88
88
  query = query.order("#{query.table_name}.id DESC") unless group #secondary order to ensure sort is deterministic
89
89
  query = query.includes(includes) if includes.length > 0
90
90
 
91
+ if options[:select].present? # used in /packages/thindex
92
+ query = query.select(options[:select])
93
+ dist_total = ActiveRecord::Base.connection.execute("SELECT COUNT(*) FROM (#{query.to_sql}) AS result_rows").first['count']
94
+ total = dist_total
95
+ subtotal = dist_total
96
+ selectable = dist_total
97
+ end
91
98
  if ::Foreman::Cast.to_bool(params[:full_result])
92
99
  params[:per_page] = total
93
100
  else
@@ -266,12 +266,12 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. New ver
266
266
  end
267
267
  end
268
268
 
269
- if content[:package_ids]
270
- fail _("package_ids is not an array") unless content[:package_ids].is_a?(Array)
269
+ if content[:package_ids] && !content[:package_ids].is_a?(Array)
270
+ fail _("package_ids is not an array")
271
271
  end
272
272
 
273
- if content[:deb_ids]
274
- fail _("deb_ids is not an array") unless content[:deb_ids].is_a?(Array)
273
+ if content[:deb_ids] && !content[:deb_ids].is_a?(Array)
274
+ fail _("deb_ids is not an array")
275
275
  end
276
276
  end
277
277
 
@@ -14,9 +14,10 @@ module Katello
14
14
  page_size = Katello::Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
15
15
  debs = Deb.in_repositories(@repositories)
16
16
  col = ''
17
- if search == 'name'
17
+ case search
18
+ when 'name'
18
19
  col = "#{Deb.table_name}.name"
19
- elsif search == 'arch'
20
+ when 'arch'
20
21
  col = "#{Deb.table_name}.architecture"
21
22
  end
22
23
  debs = debs.where("#{col} ILIKE ?", "#{params[:term]}%").select(col).group(col).order(col).limit(page_size)
@@ -108,8 +108,7 @@ module Katello
108
108
  update_params[:name] = params[:environment][:new_name] if params[:environment][:new_name]
109
109
  @environment.update!(update_params)
110
110
  if update_params[:registry_name_pattern] || update_params[:registry_unauthenticated_pull]
111
- task = send(async ? :async_task : :sync_task, ::Actions::Katello::Environment::PublishRepositories,
112
- @environment, content_type: Katello::Repository::DOCKER_TYPE)
111
+ task = send(async ? :async_task : :sync_task, ::Actions::Katello::Environment::PublishContainerRepositories, @environment)
113
112
  end
114
113
 
115
114
  if params.include?(:async) && async && task
@@ -189,8 +188,7 @@ module Katello
189
188
  attrs = [:name, :description, :registry_name_pattern, :registry_unauthenticated_pull]
190
189
  end
191
190
  attrs << :label if params[:action] == "create"
192
- parms = params.require(:environment).permit(*attrs)
193
- parms
191
+ params.require(:environment).permit(*attrs)
194
192
  end
195
193
 
196
194
  def find_content_view
@@ -1,9 +1,14 @@
1
1
  module Katello
2
2
  class Api::V2::HostContentsController < Katello::Api::V2::ApiController
3
3
  def_param_group :content_facet_attributes do
4
- param :content_view_id, Integer
5
- param :lifecycle_environment_id, Integer
6
- param :content_source_id, Integer
4
+ param :content_view_id, Integer, :desc => N_("Id of the single content view to be associated with the host.")
5
+ param :lifecycle_environment_id, Integer, :desc => N_("Id of the single lifecycle environment to be associated with the host.")
6
+ param :content_view_environments, Array, :desc => N_("Comma-separated list of Candlepin environment names to be associated with the host,"\
7
+ " in the format of 'lifecycle_environment_label/content_view_label'."\
8
+ " Ignored if content_view_environment_ids is specified, or if content_view_id and lifecycle_environment_id are specified."\
9
+ " Requires allow_multiple_content_views setting to be on.")
10
+ param :content_view_environment_ids, Array, :desc => N_("Array of content view environment ids to be associated with the host. Ignored if content_view_id and lifecycle_environment_id are specified. Requires allow_multiple_content_views setting to be on.")
11
+ param :content_source_id, Integer, :desc => N_("Id of the smart proxy from which the host consumes content.")
7
12
  param :kickstart_repository_id, Integer, :desc => N_("Repository Id associated with the kickstart repo used for provisioning")
8
13
  end
9
14
  end
@@ -146,11 +146,11 @@ module Katello
146
146
  if (params[:content_view_id] && params[:environment_id].nil?) || (params[:environment_id] && params[:content_view_id].nil?)
147
147
  fail _("Either both parameters 'content_view_id' and 'environment_id' should be specified or neither should be specified")
148
148
  end
149
- if params[:type].present?
150
- fail _("Type must be one of: %s" % TYPES_FROM_PARAMS.keys.join(', ')) unless TYPES_FROM_PARAMS.key?(params[:type].to_sym)
149
+ if params[:type].present? && !TYPES_FROM_PARAMS.key?(params[:type].to_sym)
150
+ fail _("Type must be one of: %s" % TYPES_FROM_PARAMS.keys.join(', '))
151
151
  end
152
- if params[:severity].present?
153
- fail _("Severity must be one of: %s") % Katello::Erratum::SEVERITIES.join(', ') unless Katello::Erratum::SEVERITIES.include?(params[:severity])
152
+ if params[:severity].present? && !Katello::Erratum::SEVERITIES.include?(params[:severity])
153
+ fail _("Severity must be one of: %s") % Katello::Erratum::SEVERITIES.join(', ')
154
154
  end
155
155
  end
156
156
  end
@@ -98,8 +98,8 @@ module Katello
98
98
  end
99
99
 
100
100
  def validate_index_params!
101
- if params[:status].present?
102
- fail _("Status must be one of: %s" % VERSION_STATUSES.join(', ')) unless VERSION_STATUSES.include?(params[:status])
101
+ if params[:status].present? && !VERSION_STATUSES.include?(params[:status])
102
+ fail _("Status must be one of: %s" % VERSION_STATUSES.join(', '))
103
103
  end
104
104
  end
105
105
  end
@@ -59,7 +59,7 @@ module Katello
59
59
  param_group :resource
60
60
  def update
61
61
  if params[:redhat_repository_url]
62
- sync_task(::Actions::Katello::CdnConfiguration::Update, @organization.cdn_configuration, url: params[:redhat_repository_url])
62
+ sync_task(::Actions::Katello::CdnConfiguration::Update, @organization.cdn_configuration, url: params[:redhat_repository_url], type: CdnConfiguration::CUSTOM_CDN_TYPE)
63
63
  end
64
64
  super
65
65
  end
@@ -43,7 +43,19 @@ module Katello
43
43
  param :available_for, String, :desc => N_("Return packages that can be added to the specified object. Only the value 'content_view_version' is supported.")
44
44
  param_group :search, ::Katello::Api::V2::ApiController
45
45
  def index
46
- super
46
+ super # RepositoryContentController
47
+ end
48
+
49
+ api :GET, "/packages/thindex", N_("List all packages unique by name")
50
+ param_group :search, ::Katello::Api::V2::ApiController
51
+ def thindex
52
+ sort_by, sort_order, options = sort_options
53
+
54
+ options[:select] = "DISTINCT ON (#{Rpm.table_name}.name) #{Rpm.table_name}.id, #{Rpm.table_name}.name"
55
+ final_relation = custom_index_relation(Rpm.all)
56
+
57
+ result = scoped_search(final_relation, sort_by, sort_order, options)
58
+ respond_for_index(:collection => result, :template => "thindex")
47
59
  end
48
60
 
49
61
  def available_for_content_view_version(version)
@@ -54,7 +66,6 @@ module Katello
54
66
  applicable = ::Foreman::Cast.to_bool(params[:packages_restrict_applicable]) || params[:host_id]
55
67
  upgradable = ::Foreman::Cast.to_bool(params[:packages_restrict_upgradable])
56
68
  not_installed = ::Foreman::Cast.to_bool(params[:packages_restrict_not_installed])
57
-
58
69
  if upgradable
59
70
  collection = collection.installable_for_hosts(@hosts)
60
71
  elsif not_installed && params[:host_id]
@@ -63,7 +74,6 @@ module Katello
63
74
  elsif applicable
64
75
  collection = collection.applicable_to_hosts(@hosts)
65
76
  end
66
-
67
77
  collection
68
78
  end
69
79
 
@@ -6,7 +6,7 @@ module Katello
6
6
  param :ids, Array, :desc => N_("List of repository ids"), :required => true
7
7
  def destroy_repositories
8
8
  deletion_authorized_repositories = @repositories.deletable
9
- unpromoted_repos = deletion_authorized_repositories.reject { |repo| repo.promoted? && repo.content_views.generated_for_none.exists? }
9
+ unpromoted_repos = Setting.find_by(name: 'delete_repo_across_cv')&.value ? deletion_authorized_repositories : deletion_authorized_repositories.reject { |repo| repo.promoted? && repo.content_views.generated_for_none.exists? }
10
10
  unpromoted_repos_non_last_affected_repo = unpromoted_repos.reject { |repo| repo.filters.any? { |filter| filter.repositories.size == 1 } }
11
11
  messages1 = format_bulk_action_messages(
12
12
  :success => "",
@@ -33,7 +33,11 @@ module Katello
33
33
 
34
34
  task = nil
35
35
  if unpromoted_repos_non_last_affected_repo.any?
36
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Repository::Destroy, unpromoted_repos_non_last_affected_repo)
36
+ task = async_task(::Actions::BulkAction,
37
+ ::Actions::Katello::Repository::Destroy,
38
+ unpromoted_repos_non_last_affected_repo,
39
+ remove_from_content_view_versions: Setting.find_by(name: 'delete_repo_across_cv')&.value
40
+ )
37
41
  else
38
42
  status = 400
39
43
  end