katello 3.18.5 → 4.0.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 (239) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katello/katello.scss +72 -0
  3. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +6 -4
  4. data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +0 -19
  5. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -3
  6. data/app/controllers/katello/api/v2/content_credentials_controller.rb +24 -24
  7. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/content_exports_controller.rb +4 -0
  9. data/app/controllers/katello/api/v2/content_views_controller.rb +2 -2
  10. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +2 -3
  11. data/app/controllers/katello/api/v2/repositories_controller.rb +3 -19
  12. data/app/controllers/katello/api/v2/simple_content_access_controller.rb +34 -0
  13. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
  14. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +8 -4
  15. data/app/controllers/katello/concerns/api/v2/authorization.rb +1 -14
  16. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +1 -1
  17. data/app/helpers/katello/sync_management_helper.rb +0 -2
  18. data/app/lib/actions/candlepin/environment/create.rb +1 -1
  19. data/app/lib/actions/candlepin/environment/set_content.rb +1 -1
  20. data/app/lib/actions/katello/activation_key/create.rb +9 -11
  21. data/app/lib/actions/katello/capsule_content/sync.rb +8 -8
  22. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +9 -0
  23. data/app/lib/actions/katello/check_matching_content.rb +17 -0
  24. data/app/lib/actions/katello/content_view/environment_create.rb +6 -8
  25. data/app/lib/actions/katello/content_view/publish.rb +1 -1
  26. data/app/lib/actions/katello/content_view_version/incremental_update.rb +11 -7
  27. data/app/lib/actions/katello/host/hypervisors_update.rb +4 -4
  28. data/app/lib/actions/katello/organization/create.rb +3 -5
  29. data/app/lib/actions/katello/organization/destroy.rb +1 -1
  30. data/app/lib/actions/katello/organization/manifest_delete.rb +3 -5
  31. data/app/lib/actions/katello/organization/manifest_import.rb +1 -1
  32. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
  33. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +1 -1
  34. data/app/lib/actions/katello/repository/check_matching_content.rb +3 -1
  35. data/app/lib/actions/katello/repository/clone_contents.rb +8 -11
  36. data/app/lib/actions/katello/repository/create.rb +0 -8
  37. data/app/lib/actions/katello/repository/filtered_index_content.rb +3 -0
  38. data/app/lib/actions/katello/repository/index_content.rb +1 -0
  39. data/app/lib/actions/katello/repository/multi_clone_contents.rb +9 -12
  40. data/app/lib/actions/katello/repository/sync.rb +1 -5
  41. data/app/lib/actions/katello/repository/update.rb +0 -8
  42. data/app/lib/actions/middleware/execute_if_contents_changed.rb +4 -1
  43. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -6
  44. data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +3 -3
  45. data/app/lib/actions/pulp3/content_guard/refresh_all_distributions.rb +1 -2
  46. data/app/lib/actions/pulp3/content_migration_presenter.rb +2 -5
  47. data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +1 -6
  48. data/app/lib/katello/concerns/base_template_scope_extensions.rb +8 -0
  49. data/app/lib/katello/errors.rb +1 -1
  50. data/app/lib/katello/event_daemon/monitor.rb +53 -0
  51. data/app/lib/katello/event_daemon/runner.rb +99 -0
  52. data/app/lib/katello/logging.rb +32 -0
  53. data/app/lib/katello/messaging/connection.rb +1 -7
  54. data/app/lib/katello/util/pulpcore_content_filters.rb +1 -1
  55. data/app/lib/katello/validators/content_view_puppet_module_validator.rb +1 -1
  56. data/app/models/katello/activation_key.rb +2 -2
  57. data/app/models/katello/candlepin/repository_mapper.rb +1 -1
  58. data/app/models/katello/concerns/hostgroup_extensions.rb +2 -4
  59. data/app/models/katello/concerns/organization_extensions.rb +2 -2
  60. data/app/models/katello/concerns/pulp_database_unit.rb +0 -12
  61. data/app/models/katello/concerns/redhat_extensions.rb +8 -9
  62. data/app/models/katello/concerns/smart_proxy_extensions.rb +24 -0
  63. data/app/models/katello/content_view.rb +5 -1
  64. data/app/models/katello/content_view_environment.rb +2 -2
  65. data/app/models/katello/content_view_puppet_environment.rb +2 -2
  66. data/app/models/katello/content_view_version.rb +2 -1
  67. data/app/models/katello/content_view_version_export_history.rb +20 -0
  68. data/app/models/katello/erratum.rb +3 -1
  69. data/app/models/katello/file_unit.rb +0 -4
  70. data/app/models/katello/glue/candlepin/pool.rb +2 -0
  71. data/app/models/katello/glue/pulp/repo.rb +0 -6
  72. data/app/models/katello/glue/pulp/repos.rb +1 -22
  73. data/app/models/katello/host/content_facet.rb +31 -9
  74. data/app/models/katello/ping.rb +19 -39
  75. data/app/models/katello/pool.rb +5 -0
  76. data/app/models/katello/product.rb +3 -3
  77. data/app/models/katello/repository.rb +3 -3
  78. data/app/presenters/katello/host_subscription_presenter.rb +3 -4
  79. data/app/presenters/katello/host_subscriptions_presenter.rb +24 -0
  80. data/app/services/katello/applicability/applicable_content_helper.rb +6 -8
  81. data/app/services/katello/candlepin_event_listener.rb +11 -19
  82. data/app/services/katello/event_monitor/poller_thread.rb +2 -11
  83. data/app/services/katello/pulp/repository.rb +2 -4
  84. data/app/services/katello/pulp/smart_proxy_repository.rb +0 -15
  85. data/app/services/katello/pulp3/api/core.rb +0 -14
  86. data/app/services/katello/pulp3/erratum.rb +1 -2
  87. data/app/services/katello/pulp3/migration.rb +9 -83
  88. data/app/services/katello/pulp3/migration_plan.rb +5 -54
  89. data/app/services/katello/pulp3/migration_switchover.rb +5 -36
  90. data/app/services/katello/pulp3/repository/apt.rb +2 -1
  91. data/app/services/katello/pulp3/repository/yum.rb +2 -11
  92. data/app/services/katello/pulp3/repository.rb +13 -34
  93. data/app/services/katello/pulp3/rpm.rb +1 -5
  94. data/app/services/katello/pulp3/task.rb +5 -8
  95. data/app/services/katello/pulp3/task_group.rb +5 -13
  96. data/app/services/katello/repository_type.rb +1 -1
  97. data/app/views/foreman/smart_proxies/_content_tab.html.erb +4 -47
  98. data/app/views/foreman/smart_proxies/show.html.erb +1 -1
  99. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +22 -25
  100. data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -0
  101. data/app/views/katello/api/v2/organizations/show.json.rabl +7 -9
  102. data/app/views/katello/sync_management/_products.html.erb +1 -1
  103. data/app/views/overrides/organizations/_edit_override.html.erb +1 -4
  104. data/app/views/overrides/smart_proxies/_environment_tab.html.erb +1 -1
  105. data/app/views/overrides/smart_proxies/_environment_tab_pane.html.erb +1 -1
  106. data/config/katello.yaml.example +0 -3
  107. data/config/routes/api/v2.rb +8 -10
  108. data/db/migrate/20191204214919_add_content_view_version_counts.rb +0 -1
  109. data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +1 -1
  110. data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +56 -0
  111. data/db/migrate/20210128231228_add_type_and_from_cvv_to_cvv_export_history.rb +14 -0
  112. data/db/migrate/20210201163238_migrate_background_download_policy_to_migrate.rb +7 -0
  113. data/db/seeds.d/104-proxy.rb +1 -1
  114. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  115. data/engines/bastion/app/assets/javascripts/bastion/auth/authorization.service.js +1 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +1 -1
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-os-client.directive.js +17 -0
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -2
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +11 -4
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-deb-client.html +38 -0
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-oracle-client.html +5 -0
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-sles-client.html +28 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +14 -11
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +2 -2
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -2
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +1 -1
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/download-policy.service.js +0 -1
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +1 -1
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +2 -2
  131. data/lib/katello/engine.rb +4 -5
  132. data/lib/katello/middleware/event_daemon.rb +1 -1
  133. data/lib/katello/permission_creator.rb +3 -2
  134. data/lib/katello/plugin.rb +2 -2
  135. data/lib/katello/tasks/jenkins.rake +1 -1
  136. data/lib/katello/tasks/pulp3_content_switchover.rake +20 -31
  137. data/lib/katello/tasks/pulp3_migration.rake +25 -45
  138. data/lib/katello/tasks/pulp3_migration_abort.rake +0 -8
  139. data/lib/katello/tasks/pulp3_migration_stats.rake +3 -46
  140. data/lib/katello/tasks/upgrades/4.0/remove_ostree_puppet_content.rake +16 -0
  141. data/lib/katello/version.rb +1 -1
  142. data/lib/proxy_api/container_gateway.rb +21 -0
  143. data/locale/bn/katello.edit.po +0 -0
  144. data/locale/cs/katello.edit.po +0 -0
  145. data/locale/de/katello.edit.po +0 -0
  146. data/locale/en/katello.edit.po +0 -0
  147. data/locale/es/katello.edit.po +0 -0
  148. data/locale/fr/katello.edit.po +0 -0
  149. data/locale/gu/katello.edit.po +0 -0
  150. data/locale/hi/katello.edit.po +0 -0
  151. data/locale/it/katello.edit.po +0 -0
  152. data/locale/ja/katello.edit.po +0 -0
  153. data/locale/kn/katello.edit.po +0 -0
  154. data/locale/ko/katello.edit.po +0 -0
  155. data/locale/mr/katello.edit.po +0 -0
  156. data/locale/or/katello.edit.po +0 -0
  157. data/locale/pa/katello.edit.po +0 -0
  158. data/locale/pt/katello.edit.po +0 -0
  159. data/locale/pt_BR/katello.edit.po +0 -0
  160. data/locale/ru/katello.edit.po +0 -0
  161. data/locale/ta/katello.edit.po +0 -0
  162. data/locale/te/katello.edit.po +0 -0
  163. data/locale/zh_CN/katello.edit.po +0 -0
  164. data/locale/zh_TW/katello.edit.po +0 -0
  165. data/package.json +1 -1
  166. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +0 -1
  167. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationHooks.js +2 -0
  168. data/webpack/__mocks__/foremanReact/components/common/dates/LongDateTime.js +5 -0
  169. data/webpack/{scenes/ContentViews/Details/Repositories → components/SelectableDropdown}/SelectableDropdown.js +20 -3
  170. data/webpack/components/SelectableDropdown/__tests__/SelectableDropdown.test.js +45 -0
  171. data/webpack/components/SelectableDropdown/index.js +3 -0
  172. data/webpack/components/Table/TableWrapper.js +2 -1
  173. data/webpack/components/Table/helpers.js +14 -0
  174. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +0 -1
  175. data/webpack/containers/Application/overrides.scss +6 -0
  176. data/webpack/index.js +6 -0
  177. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
  178. data/webpack/scenes/ContentViews/ContentViewsActions.js +31 -2
  179. data/webpack/scenes/ContentViews/ContentViewsConstants.js +5 -1
  180. data/webpack/scenes/ContentViews/Copy/ContentViewCopySelectors.js +16 -0
  181. data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +77 -0
  182. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +44 -0
  183. data/webpack/scenes/ContentViews/Copy/__tests__/contentViewCopyResult.fixtures.json +42 -0
  184. data/webpack/scenes/ContentViews/Copy/__tests__/copyContentView.test.js +39 -0
  185. data/webpack/scenes/ContentViews/Copy/index.js +4 -0
  186. data/webpack/scenes/ContentViews/Create/ContentViewCreateSelectors.js +16 -0
  187. data/webpack/scenes/ContentViews/Create/ContentViewFormComponents.js +58 -0
  188. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +175 -0
  189. data/webpack/scenes/ContentViews/Create/CreateContentViewModal.js +27 -0
  190. data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +42 -0
  191. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +92 -0
  192. data/webpack/scenes/ContentViews/Create/index.js +4 -0
  193. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +16 -0
  194. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +20 -1
  195. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +17 -7
  196. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +19 -13
  197. data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +40 -0
  198. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +124 -0
  199. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.fixtures.json +134 -0
  200. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +92 -0
  201. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +44 -25
  202. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +17 -7
  203. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +24 -0
  204. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +53 -3
  205. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +4 -3
  206. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +41 -0
  207. data/webpack/scenes/ContentViews/helpers.js +13 -0
  208. data/webpack/scenes/SmartProxy/Content.js +17 -0
  209. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +11 -0
  210. data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +3 -0
  211. data/webpack/scenes/SmartProxy/SmartProxyContentSelectors.js +16 -0
  212. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +152 -0
  213. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentResult.fixtures.json +140 -0
  214. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +38 -0
  215. data/webpack/scenes/SmartProxy/index.js +4 -0
  216. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +2 -7
  217. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +3 -3
  218. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +2 -2
  219. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +2 -2
  220. data/webpack/scenes/Subscriptions/Manifest/index.js +0 -1
  221. data/webpack/test-utils/react-testing-lib-wrapper.js +5 -2
  222. data/webpack/utils/helpers.js +3 -0
  223. metadata +103 -63
  224. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +0 -114
  225. data/app/lib/actions/pulp3/content_migration_reset.rb +0 -22
  226. data/app/lib/katello/util/hostgroup_facets_helper.rb +0 -126
  227. data/app/overrides/disable_turbolinks_on_proxies_index.rb +0 -5
  228. data/app/services/katello/event_daemon.rb +0 -135
  229. data/app/services/katello/pulp/content_counts_calculator.rb +0 -60
  230. data/db/migrate/20210201165835_add_migration_missing_content.rb +0 -12
  231. data/db/migrate/20210420140050_add_pulp3_hrefs_to_content_types_deb.rb +0 -5
  232. data/lib/katello/tasks/check_config.rake +0 -11
  233. data/lib/katello/tasks/fix_hostgroup_facets.rake +0 -8
  234. data/lib/katello/tasks/pulp3_migration_approve_corrupted.rake +0 -21
  235. data/lib/katello/tasks/pulp3_migration_reset.rake +0 -26
  236. data/lib/katello/tasks/reports.rake +0 -7
  237. data/lib/katello/tasks/upgrades/3.10/update_gpg_key_urls.rake +0 -32
  238. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.scss +0 -5
  239. data/webpack/scenes/ContentViews/Table/actionResolver.js +0 -28
@@ -48,6 +48,10 @@ module Katello
48
48
  nil
49
49
  end
50
50
 
51
+ def published?
52
+ !repo.publication_href.nil?
53
+ end
54
+
51
55
  def skip_types
52
56
  nil
53
57
  end
@@ -158,7 +162,10 @@ module Katello
158
162
  end
159
163
 
160
164
  def compute_remote_options(computed_options = remote_options)
161
- computed_options.except(:name, :client_key)
165
+ [:client_cert, :client_key, :ca_cert].each do |key|
166
+ computed_options[key] = Digest::SHA256.hexdigest(computed_options[key].chomp) if computed_options[key]
167
+ end
168
+ computed_options.except(:name)
162
169
  end
163
170
 
164
171
  def create
@@ -218,38 +225,11 @@ module Katello
218
225
  end
219
226
 
220
227
  def refresh_distributions
221
- if repo.docker?
222
- dist = lookup_distributions(base_path: repo.container_repository_name).first
228
+ dist_ref = distribution_reference
229
+ if dist_ref
230
+ update_distribution
223
231
  else
224
- dist = lookup_distributions(base_path: repo.relative_path).first
225
- end
226
-
227
- # First check if the distribution exists
228
- if dist
229
- dist_ref = distribution_reference
230
- # If we have a DistributionReference, update the distribution
231
- if dist_ref
232
- return update_distribution
233
- # If no DistributionReference, create a DistributionReference and return
234
- else
235
- save_distribution_references([dist.pulp_href])
236
- return []
237
- end
238
- end
239
-
240
- # So far, it looks like there is no distribution. Try to create one.
241
- begin
242
232
  create_distribution(relative_path)
243
- rescue api.class.client_module::ApiError => e
244
- # Now it seems there is a distribution. Fetch it and save the reference.
245
- if e.message.include?("\"base_path\":[\"This field must be unique.\"]") ||
246
- e.message.include?("\"base_path\":[\"Overlaps with existing distribution\"")
247
- dist = lookup_distributions(base_path: repo.relative_path).first
248
- save_distribution_references([dist.pulp_href])
249
- return []
250
- else
251
- raise e
252
- end
253
233
  end
254
234
  end
255
235
 
@@ -299,8 +279,7 @@ module Katello
299
279
  pulp3_distribution_data = api.get_distribution(href)
300
280
  path, content_guard_href = pulp3_distribution_data&.base_path, pulp3_distribution_data&.content_guard
301
281
  unless distribution_reference
302
- # Ensure that duplicates won't be created in the case of a race condition
303
- DistributionReference.where(path: path, href: href, repository_id: repo.id, content_guard_href: content_guard_href).first_or_create!
282
+ DistributionReference.create!(path: path, href: href, repository_id: repo.id, content_guard_href: content_guard_href)
304
283
  end
305
284
  end
306
285
  end
@@ -330,7 +309,7 @@ module Katello
330
309
  }
331
310
  remote_options[:url] = root.url unless root.url.blank?
332
311
  remote_options[:download_concurrency] = root.download_concurrency unless root.download_concurrency.blank?
333
- if !root.upstream_username.blank? && !root.upstream_password.blank?
312
+ if root.upstream_username && root.upstream_password
334
313
  remote_options.merge!(username: root.upstream_username,
335
314
  password: root.upstream_password)
336
315
  end
@@ -111,10 +111,6 @@ module Katello
111
111
  backend_data['rpm_license']
112
112
  end
113
113
 
114
- def parse_filename(path)
115
- File.split(path).last unless path.blank?
116
- end
117
-
118
114
  def update_model(model)
119
115
  custom_json = {}
120
116
  custom_json['modular'] = backend_data['is_modular']
@@ -123,7 +119,7 @@ module Katello
123
119
  each { |field| custom_json[field] = backend_data[field] }
124
120
  custom_json['release_sortable'] = Util::Package.sortable_version(backend_data['release'])
125
121
  custom_json['version_sortable'] = Util::Package.sortable_version(backend_data['version'])
126
- custom_json['filename'] = parse_filename(backend_data['location_href']) #location_href is the relative path of the rpm in the upstream repo
122
+ custom_json['filename'] = backend_data['location_href']
127
123
  custom_json['checksum'] = backend_data['pkgId']
128
124
  custom_json['sourcerpm'] = backend_data['rpm_sourcerpm']
129
125
  model.assign_attributes(custom_json)
@@ -56,10 +56,8 @@ module Katello
56
56
  @pulp_data ||= tasks_api.read(@href).as_json.with_indifferent_access
57
57
  end
58
58
 
59
- delegate :tasks_api, to: :core_api
60
-
61
- def core_api
62
- ::Katello::Pulp3::Api::Core.new(@smart_proxy)
59
+ def tasks_api
60
+ ::Katello::Pulp3::Api::Core.new(@smart_proxy).tasks_api
63
61
  end
64
62
 
65
63
  def task_group_href
@@ -96,11 +94,10 @@ module Katello
96
94
  end
97
95
 
98
96
  def cancel
99
- core_api.cancel_task(task_data['pulp_href'])
97
+ data = PulpcoreClient::TaskResponse.new(state: 'canceled')
98
+ tasks_api.tasks_cancel(task_data['pulp_href'], data)
100
99
  #the main task may have completed, so cancel spawned tasks too
101
- task_data['spawned_tasks']&.each do |spawned|
102
- core_api.cancel_task(spawned['pulp_href'])
103
- end
100
+ task_data['spawned_tasks']&.each { |spawned| tasks_api.tasks_cancel(spawned['pulp_href'], data) }
104
101
  end
105
102
  end
106
103
  end
@@ -71,25 +71,17 @@ module Katello
71
71
  end
72
72
 
73
73
  def error
74
- return if task_group_data[WAITING] > 0 || task_group_data[RUNNING] > 0
75
74
  if task_group_data[FAILED] > 0
76
75
  "#{task_group_data[FAILED]} subtask(s) failed for task group #{@href}."
77
- elsif task_group_data[CANCELLED] > 0
78
- "#{task_group_data[CANCELLED]} subtask(s) cancelled for task group #{@href}."
79
76
  end
80
77
  end
81
78
 
82
- def core_api
83
- ::Katello::Pulp3::Api::Core.new(@smart_proxy)
84
- end
85
-
86
79
  def cancel
87
- tasks_api = core_api.tasks_api
88
- tasks_response = core_api.class.fetch_from_list do |page_opts|
89
- tasks_api.list(page_opts.merge(task_group: task_group_data['pulp_href'], state__in: 'running,waiting'))
90
- end
91
- tasks_response.collect do |result|
92
- ::Katello::Pulp3::Api::Core.new(@smart_proxy).cancel_task(result.pulp_href)
80
+ tasks_api = ::Katello::Pulp3::Api::Core.new(@smart_proxy).tasks_api
81
+ tasks_response = tasks_api.list(task_group: task_group_data['pulp_href'])
82
+ data = PulpcoreClient::TaskResponse.new(state: 'canceled')
83
+ tasks_response.results.collect do |result|
84
+ tasks_api.tasks_cancel(result.pulp_href, data)
93
85
  end
94
86
  end
95
87
  end
@@ -33,7 +33,7 @@ module Katello
33
33
  end
34
34
 
35
35
  def content_types_to_index
36
- if SmartProxy.pulp_primary.pulp3_repository_type_support?(self)
36
+ if SmartProxy.pulp_primary&.pulp3_repository_type_support?(self)
37
37
  # type.index being false supersedes type.index_on_pulp3 being true
38
38
  @content_types.select { |type| type.index && type.index_on_pulp3 }
39
39
  else
@@ -1,48 +1,5 @@
1
- <br />
1
+ <%= javascript_include_tag *webpack_asset_paths('katello', extension: 'js') %>
2
2
 
3
- <table class="table table-bordered">
4
- <thead>
5
- <tr>
6
- <th translate>Content View Name</th>
7
- <th translate>Composite</th>
8
- <th translate>Last Published</th>
9
- <th translate>Hosts</th>
10
- <th translate>Products</th>
11
- <th translate>Apt repos</th>
12
- <th translate>Yum repos</th>
13
- <th translate>Container Image repos</th>
14
- <th translate>Deb Packages</th>
15
- <th translate>RPM Packages</th>
16
- <th translate>Errata</th>
17
- <th translate>Puppet modules</th>
18
- </tr>
19
- </thead>
20
- <tbody>
21
- <tr ng-repeat-start="env in syncStatus.lifecycle_environments">
22
- <td colspan="10"
23
- ng-click="toggleExpandEnvironment(env)"
24
- class="expander {{isEnvronmentExpanded(env) ? '' : 'collapsed'}}">
25
- <span class="caret"></span>
26
- {{ env.name }}
27
- </td>
28
- </tr>
29
- <tr ng-repeat-end ng-repeat="cv in env.content_views" ng-show="isEnvronmentExpanded(env)">
30
- <td>
31
- <a href="{{ productsOrVersionUrl(cv.default, cv.id) }}" target="_self">
32
- {{ cv.name }}
33
- </a>
34
- </td>
35
- <td>{{ cv.composite | booleanToYesNo }}</td>
36
- <td>{{ cv.last_published }}</td>
37
- <td>{{ cv.counts.content_hosts }}</td>
38
- <td>{{ cv.counts.products }}</td>
39
- <td>{{ cv.counts.apt_repositories }}</td>
40
- <td>{{ cv.counts.yum_repositories }}</td>
41
- <td>{{ cv.counts.docker_repositories }}</td>
42
- <td>{{ cv.counts.deb_packages }}</td>
43
- <td>{{ cv.counts.packages }}</td>
44
- <td>{{ cv.counts.errata }}</td>
45
- <td>{{ cv.counts.puppet_modules }}</td>
46
- </td>
47
- </tbody>
48
- </table>
3
+ <br />
4
+ <% @smartProxyId= @smart_proxy.id %>
5
+ <%= react_component('Content', smartProxyId: @smartProxyId,) %>
@@ -1,4 +1,4 @@
1
- <% if @smart_proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE) -%>
1
+ <% if @smart_proxy.pulp_mirror? -%>
2
2
  <div ng-controller="CapsuleContentController">
3
3
  <%= render :file => 'smart_proxies/show' %>
4
4
  </div>
@@ -17,33 +17,30 @@ child @lifecycle_environments => :lifecycle_environments do
17
17
  node :syncable do |env|
18
18
  @capsule.environment_syncable?(env)
19
19
  end
20
- node :counts do |env|
21
- counts = {
22
- :content_hosts => env.hosts.authorized("view_hosts").count,
23
- :content_views => env.content_views.non_default.count,
24
- :products => env.products.enabled.count
25
- }
26
- repo_data = @capsule.smart_proxy_service.current_repositories_data(env)
27
- counts.merge!(Katello::Pulp::ContentCountsCalculator.new(repo_data).calculate)
28
- end
29
20
 
30
- node :content_views do |env|
31
- env.content_views.map do |content_view|
32
- attributes = {
33
- :id => content_view.id,
34
- :label => content_view.label,
35
- :name => content_view.name,
36
- :composite => content_view.composite,
37
- :last_published => content_view.versions.empty? ? nil : content_view.versions.last.created_at,
38
- :default => content_view.default,
39
- :counts => {
40
- :content_hosts => content_view.hosts.authorized("view_hosts").count,
41
- :products => content_view.products.enabled.count
42
- }
21
+ if @capsule.has_feature?(SmartProxy::PULP_NODE_FEATURE) || @capsule.has_feature?(SmartProxy::PULP3_FEATURE)
22
+ node :counts do |env|
23
+ {
24
+ :content_views => env.content_views.non_default.count
43
25
  }
44
- repo_data = @capsule.smart_proxy_service.current_repositories_data(env, content_view)
45
- attributes[:counts].merge!(Katello::Pulp::ContentCountsCalculator.new(repo_data).calculate)
46
- attributes
26
+ end
27
+
28
+ node :content_views do |env|
29
+ env.content_views.map do |content_view|
30
+ attributes = {
31
+ :id => content_view.id,
32
+ :label => content_view.label,
33
+ :name => content_view.name,
34
+ :composite => content_view.composite,
35
+ :last_published => content_view.versions.empty? ? nil : content_view.versions.last.created_at,
36
+ :default => content_view.default,
37
+ :up_to_date => @capsule.repos_pending_sync(env, content_view).empty?,
38
+ :counts => {
39
+ :repositories => @capsule.current_repositories_data(env, content_view).try(:count)
40
+ }
41
+ }
42
+ attributes
43
+ end
47
44
  end
48
45
  end
49
46
  end
@@ -1,6 +1,7 @@
1
1
  object @resource
2
2
 
3
3
  attributes :destination_server, :path, :id, :metadata
4
+ attributes :export_type => :type
4
5
 
5
6
  node :content_view_version do |h|
6
7
  h.content_view_version.name
@@ -4,17 +4,15 @@ extends "api/v2/taxonomies/show"
4
4
 
5
5
  attributes :task_id, :label, :redhat_repository_url
6
6
 
7
- if ::SETTINGS[:katello][:use_cp]
8
- attributes :system_purposes, :system_purposes
9
- attributes :service_levels, :service_level
7
+ attributes :system_purposes, :system_purposes
8
+ attributes :service_levels, :service_level
10
9
 
11
- node :simple_content_access do |org|
12
- org.simple_content_access?
13
- end
10
+ node :simple_content_access do |org|
11
+ org.simple_content_access?
12
+ end
14
13
 
15
- node :owner_details do |org|
16
- partial('katello/api/v2/organizations/owner_details', object: OpenStruct.new(org.owner_details))
17
- end
14
+ node :owner_details do |org|
15
+ partial('katello/api/v2/organizations/owner_details', object: OpenStruct.new(org.owner_details))
18
16
  end
19
17
 
20
18
  node :default_content_view_id do |org|
@@ -42,5 +42,5 @@
42
42
  </tbody>
43
43
  </table>
44
44
 
45
- <%= submit_tag _('Synchronize Now'), :class => 'btn btn-default fr', :id => 'sync_button' %>
45
+ <%= submit_tag _('Synchronize Now'), :class => 'button fr', :id => 'sync_button' %>
46
46
  <% end %>
@@ -3,10 +3,7 @@
3
3
  <%= javascript_include_tag 'katello/organizations/download_certificate' %>
4
4
 
5
5
  <%= text_f f, :label, :disabled => true, :class => 'input-xlarge' %>
6
-
7
- <% if ::SETTINGS[:katello][:use_cp] %>
8
- <%= selectable_f(f, :service_level, options_for_select(service_level_options, service_level_selected), {}, :label => _('Default System SLA')) %>
9
- <% end %>
6
+ <%= selectable_f(f, :service_level, options_for_select(service_level_options, service_level_selected), {}, :label => _('Default System SLA')) %>
10
7
 
11
8
  <%= field(f, _('Debug Certificate'),
12
9
  :help_inline => _('This certificate allows a user to view the repositories in any environment from a browser.')) do
@@ -1,4 +1,4 @@
1
- <% if !@smart_proxy.new_record? && @smart_proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE) -%>
1
+ <% if !@smart_proxy.new_record? && @smart_proxy.pulp_mirror? -%>
2
2
  <li id="kt_environments_tab">
3
3
  <a href="#kt_environments" data-toggle="tab"><%= _('Lifecycle Environments') %></a>
4
4
  </li>
@@ -1,4 +1,4 @@
1
- <% if !@smart_proxy.new_record? && @smart_proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE) -%>
1
+ <% if !@smart_proxy.new_record? && @smart_proxy.pulp_mirror? -%>
2
2
  <div class="tab-pane" id="kt_environments">
3
3
  <%= multiple_selects f, :lifecycle_environments, Katello::KTEnvironment.completer_scope(:organization_id => ::Organization.current.try(:id)), @smart_proxy.lifecycle_environment_ids, {:label => _('Lifecycle Environments')}, @smart_proxy.default_capsule? ? {:disabled => :disabled } : {} %>
4
4
 
@@ -10,9 +10,6 @@
10
10
  :ostree: true
11
11
  :ansible_collection: true
12
12
 
13
- :use_cp: true # set to true/false if you want to override default
14
- :use_pulp: true # set to true/false if you want to override default
15
-
16
13
  :rest_client_timeout: 30
17
14
  :gpg_strict_validation: false
18
15
 
@@ -207,14 +207,6 @@ Katello::Engine.routes.draw do
207
207
  end
208
208
  end
209
209
 
210
- api_resources :gpg_keys, :only => [:index, :show, :create, :update, :destroy] do
211
- member do
212
- get :content
213
- post :content, :action => :set_content
214
- end
215
- get :auto_complete_search, :on => :collection
216
- end
217
-
218
210
  api_resources :host_collections, :only => [:index, :show, :create, :update, :destroy] do
219
211
  member do
220
212
  post :copy
@@ -360,8 +352,6 @@ Katello::Engine.routes.draw do
360
352
  end
361
353
  end
362
354
 
363
- api_resources :gpg_keys, :only => [:index]
364
-
365
355
  api_resources :content_views, :only => [:index, :create]
366
356
  api_resources :subscriptions, :only => [:index, :upload, :delete_manifest, :refresh_manifest, :show] do
367
357
  collection do
@@ -371,6 +361,14 @@ Katello::Engine.routes.draw do
371
361
  end
372
362
  end
373
363
 
364
+ api_resources :simple_content_access, only: [] do
365
+ collection do
366
+ put :enable
367
+ put :disable
368
+ get :eligible
369
+ end
370
+ end
371
+
374
372
  api_resources :upstream_subscriptions, only: [:index, :create] do
375
373
  collection do
376
374
  delete :destroy
@@ -2,6 +2,5 @@ class AddContentViewVersionCounts < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :katello_content_view_versions, :content_counts, :text
4
4
  Katello::ContentViewVersion.reset_column_information
5
- Katello::ContentViewVersion.all.each(&:update_content_counts!)
6
5
  end
7
6
  end
@@ -46,7 +46,7 @@ class MoveKatelloFieldsFromHostgroups < ActiveRecord::Migration[6.0]
46
46
  content_facet.kickstart_repository_id = kickstart_repository_id
47
47
  content_facet.content_view_id = content_view_id
48
48
  content_facet.lifecycle_environment_id = lifecycle_environment_id
49
- unless content_facet.save(validate: false)
49
+ unless content_facet.save
50
50
  Rails.logger.warn("Unable to save content facet hostgroup for #{content_facet.inspect} ")
51
51
  Rails.logger.warn(content_facet.errors.full_messages.join("\n"))
52
52
  end
@@ -0,0 +1,56 @@
1
+ class DeletePuppetAndOstreeRepos < ActiveRecord::Migration[6.0]
2
+ class FakeContentViewPuppetModule < Katello::Model
3
+ self.table_name = 'katello_content_view_puppet_modules'
4
+ end
5
+
6
+ class FakeContentViewPuppetEnvironmentPuppetModule < Katello::Model
7
+ self.table_name = 'katello_content_view_puppet_environment_puppet_modules'
8
+ end
9
+
10
+ class FakeRepositoryPuppetModule < Katello::Model
11
+ self.table_name = 'katello_repository_puppet_modules'
12
+ end
13
+
14
+ class FakeContentViewPuppetEnvironment < Katello::Model
15
+ self.table_name = 'katello_content_view_puppet_environments'
16
+ end
17
+ class FakePuppetModule < Katello::Model
18
+ self.table_name = 'katello_puppet_modules'
19
+ end
20
+ class FakeRepositoryOstreeBranch < Katello::Model
21
+ self.table_name = 'katello_repository_ostree_branches'
22
+ end
23
+ class FakeOstreeBranch < Katello::Model
24
+ self.table_name = 'katello_ostree_branches'
25
+ end
26
+
27
+ def up
28
+ if Katello::Repository.ostree_type.any? || Katello::Repository.puppet_type.any?
29
+ User.as_anonymous_admin do
30
+ FakeContentViewPuppetModule.delete_all
31
+ FakeContentViewPuppetEnvironmentPuppetModule.delete_all
32
+ FakeRepositoryPuppetModule.delete_all
33
+
34
+ FakeContentViewPuppetEnvironment.delete_all
35
+ FakePuppetModule.delete_all
36
+
37
+ Katello::Repository.puppet_type.delete_all
38
+
39
+ FakeRepositoryOstreeBranch.delete_all
40
+ FakeOstreeBranch.delete_all
41
+ Katello::Repository.ostree_type.where.not(:library_instance_id => nil, :environment_id => nil).destroy_all #CV LCE repos
42
+ Katello::Repository.ostree_type.where.not(:library_instance_id => nil).destroy_all # archive repos
43
+ Katello::Repository.ostree_type.destroy_all #all the rest (should just be library repos)
44
+
45
+ Katello::ContentViewVersion.where.not(:content_counts => nil).each do |version|
46
+ version.content_counts.except!('ostree', 'puppet_module')
47
+ version.save
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ def down
54
+ fail ActiveRecord::IrreversibleMigration
55
+ end
56
+ end
@@ -0,0 +1,14 @@
1
+ class AddTypeAndFromCvvToCvvExportHistory < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :katello_content_view_version_export_histories,
4
+ :export_type, :string,
5
+ :default => ::Katello::ContentViewVersionExportHistory::COMPLETE, :null => false
6
+ add_index :katello_content_view_version_export_histories, :export_type, name: 'katello_cvveh_export_type'
7
+
8
+ ::Katello::ContentViewVersionExportHistory.reset_column_information
9
+ ::Katello::ContentViewVersionExportHistory.all.each do |cvve|
10
+ next if cvve.export_type == cvve.export_type_from_metadata
11
+ cvve.update!(export_type: cvve.export_type_from_metadata)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ class MigrateBackgroundDownloadPolicyToMigrate < ActiveRecord::Migration[6.0]
2
+ def change
3
+ Katello::RootRepository.where(:download_policy => ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND).each do |root_repo|
4
+ root_repo.update_column(:download_policy, ::Runcible::Models::YumImporter::DOWNLOAD_IMMEDIATE)
5
+ end
6
+ end
7
+ end
@@ -16,7 +16,7 @@ User.as(::User.anonymous_api_admin.login) do
16
16
  fail "Unable to create proxy feature: #{format_errors feature}"
17
17
  end
18
18
 
19
- ["Pulp", "Pulp Node", "Pulpcore"].each do |input|
19
+ ["Pulp", "Pulp Node", "Pulpcore", "Container_Gateway"].each do |input|
20
20
  f = Feature.where(:name => input).first_or_create
21
21
  fail "Unable to create proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
22
22
  end
@@ -14,6 +14,7 @@ UpgradeTask.define_tasks(:katello) do
14
14
  {:name => 'katello:upgrades:3.15:set_sub_facet_dmi_uuid'},
15
15
  {:name => 'katello:upgrades:3.15:reindex_rpm_modular'},
16
16
  {:name => 'katello:upgrades:3.16:update_applicable_el8_hosts'},
17
- {:name => 'katello:upgrades:3.18:add_cvv_export_history_metadata'}
17
+ {:name => 'katello:upgrades:3.18:add_cvv_export_history_metadata'},
18
+ {:name => 'katello:upgrades:4.0:remove_ostree_puppet_content'}
18
19
  ]
19
20
  end
@@ -20,7 +20,7 @@ angular.module('Bastion.auth').service('Authorization', ['CurrentUser', 'Permiss
20
20
  allowedTo = model.permissions[permissionName];
21
21
  } else {
22
22
  angular.forEach(Permissions, function (permission) {
23
- if (permission.name === permissionName) {
23
+ if (permission.permission.name === permissionName) {
24
24
  allowedTo = true;
25
25
  }
26
26
  });
@@ -116,7 +116,7 @@ angular.module('Bastion.capsule-content').controller('CapsuleContentController',
116
116
  };
117
117
 
118
118
  $scope.syncState = syncState;
119
-
119
+ $scope.smartProxyId = capsuleId;
120
120
  $scope.expandEnvironments = {};
121
121
 
122
122
  refreshSyncStatus();
@@ -0,0 +1,17 @@
1
+ angular.module('Bastion.content-hosts').directive('registerOsClient', function () {
2
+ return {
3
+ restrict: 'E',
4
+ scope: {
5
+ userOs: '='
6
+ },
7
+ link: function($scope) {
8
+ $scope.$watch('userOs', function(userOs) {
9
+ if (userOs && userOs.length) {
10
+ $scope.dynamicTemplateUrl = 'content-hosts/views/register-' + userOs + '.html';
11
+ }
12
+ });
13
+ },
14
+
15
+ template: '<ng-include src="dynamicTemplateUrl"></ng-include>'
16
+ };
17
+ });
@@ -323,7 +323,7 @@
323
323
 
324
324
  <dl class="dl-horizontal dl-horizontal-left">
325
325
  <dt translate>Registered</dt>
326
- <dd><short-date-time date="host.created_at" /></dd>
326
+ <dd><long-date-time date="host.created_at" /></dd>
327
327
 
328
328
  <dt translate> Registered By</dt>
329
329
  <dd>
@@ -350,7 +350,7 @@
350
350
  </dd>
351
351
 
352
352
  <dt translate>Last Checkin</dt>
353
- <dd><short-date-time date="host.subscription_facet_attributes.last_checkin" default="'Never checked in' | translate" /></dd>
353
+ <dd><long-date-time date="host.subscription_facet_attributes.last_checkin" default="'Never checked in' | translate" /></dd>
354
354
  </dl>
355
355
 
356
356
  <div class="divider"></div>
@@ -131,8 +131,8 @@
131
131
  <td bst-table-cell>{{ host.operatingsystem_name }}</td>
132
132
  <td bst-table-cell>{{ host.content_facet_attributes.lifecycle_environment.name }}</td>
133
133
  <td bst-table-cell>{{ host.content_facet_attributes.content_view.name || "" }}</td>
134
- <td bst-table-cell><short-date-time date="host.subscription_facet_attributes.registered_at" default="'Never registered' | translate" /></td>
135
- <td bst-table-cell><short-date-time date="host.subscription_facet_attributes.last_checkin" default="'Never checked in' | translate" /></td>
134
+ <td bst-table-cell><long-date-time date="host.subscription_facet_attributes.registered_at" default="'Never registered' | translate" /></td>
135
+ <td bst-table-cell><long-date-time date="host.subscription_facet_attributes.last_checkin" default="'Never checked in' | translate" /></td>
136
136
  </tr>
137
137
  </tbody>
138
138
  </table>
@@ -1,3 +1,10 @@
1
+ <div ng-controller="ContentHostRegisterController"><li>
2
+ <p translate>Register using subscription-manager:</p>
3
+ <p translate>Using an Activation Key:</p>
4
+ <pre><code>subscription-manager register --org="{{ organization.label }}" --activationkey="&ltActivation Key Name&gt"</code></pre>
5
+ <p translate>Using a username and password:</p>
6
+ <pre><code>subscription-manager register --org="{{ organization.label }}" --environment="Library"</code></pre>
7
+ </li>
1
8
  <li>
2
9
  <p translate>Install client package:</p>
3
10
 
@@ -7,9 +14,9 @@
7
14
  <p translate>Tracer helps administrators identify applications that need to be restarted after a system is patched. To optionally report tracer information:</p>
8
15
  <pre><code>yum -y install katello-host-tools-tracer</code></pre>
9
16
 
10
- <p translate>For remote actions via katello-agent:</p>
11
- <pre><code>yum -y install katello-agent</code></pre>
12
- <section>
17
+ <p ng-hide="remoteExecutionByDefault" translate>For remote actions via katello-agent:</p>
18
+ <pre ng-hide="remoteExecutionByDefault" ><code>yum -y install katello-agent</code></pre>
19
+ <section ng-hide="remoteExecutionByDefault" >
13
20
  <p bst-alert="warning" >
14
21
  <span translate>
15
22
  Katello-agent is deprecated and will be removed in a future release.
@@ -18,4 +25,4 @@
18
25
  </section>
19
26
 
20
27
  <p translate>Learn more about these packages in the <a href="https://theforeman.org/plugins/katello/">Documentation</a> </p>
21
- </li>
28
+ </li></div>