katello 4.12.1 → 4.13.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/locale/bn/katello.js +3365 -3350
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/ca/katello.js +3588 -3576
- data/app/assets/javascripts/katello/locale/cs/katello.js +3499 -3487
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +4186 -4186
- data/app/assets/javascripts/katello/locale/de/katello.js +5553 -5562
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +3066 -3051
- data/app/assets/javascripts/katello/locale/el/katello.js +3376 -3370
- data/app/assets/javascripts/katello/locale/en/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +3076 -3073
- data/app/assets/javascripts/katello/locale/en_US/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/es/katello.js +5366 -5372
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/fr/katello.js +5975 -5984
- data/app/assets/javascripts/katello/locale/gl/katello.js +3125 -3113
- data/app/assets/javascripts/katello/locale/gu/katello.js +3119 -3104
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +3020 -3005
- data/app/assets/javascripts/katello/locale/hi/katello.js +3137 -3122
- data/app/assets/javascripts/katello/locale/id/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/it/katello.js +4469 -4466
- data/app/assets/javascripts/katello/locale/ja/katello.js +5969 -5978
- data/app/assets/javascripts/katello/locale/ka/katello.js +5649 -5652
- data/app/assets/javascripts/katello/locale/kn/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/ko/katello.js +4717 -4720
- data/app/assets/javascripts/katello/locale/locale/katello.js +1050 -1084
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/mr/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +3116 -3101
- data/app/assets/javascripts/katello/locale/or/katello.js +3137 -3122
- data/app/assets/javascripts/katello/locale/pa/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/pl/katello.js +3210 -3195
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/pt/katello.js +3009 -2994
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +5362 -5368
- data/app/assets/javascripts/katello/locale/ro/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/ru/katello.js +4638 -4641
- data/app/assets/javascripts/katello/locale/sl/katello.js +3051 -3036
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +3156 -3144
- data/app/assets/javascripts/katello/locale/ta/katello.js +3365 -3350
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +3121 -3106
- data/app/assets/javascripts/katello/locale/te/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/tr/katello.js +3025 -3010
- data/app/assets/javascripts/katello/locale/vi/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/zh/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +5968 -5977
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +4694 -4697
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +51 -124
- data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +12 -20
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -4
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +24 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +9 -2
- data/app/controllers/katello/api/v2/debs_controller.rb +1 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +12 -4
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +3 -3
- data/app/controllers/katello/api/v2/organizations_controller.rb +0 -11
- data/app/controllers/katello/api/v2/packages_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +18 -12
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +2 -1
- data/app/controllers/katello/api/v2/simple_content_access_controller.rb +9 -22
- data/app/controllers/katello/concerns/api/v2/authorization.rb +1 -1
- data/app/helpers/katello/subscription_mailer_helper.rb +1 -1
- data/app/jobs/create_manifest_expire_soon_warning_notifications.rb +11 -0
- data/app/lib/actions/candlepin/owner/regenerate_upstream_identity_cert.rb +21 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/verify_checksum.rb +75 -0
- data/app/lib/actions/katello/content_view/promote.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +1 -1
- data/app/lib/actions/katello/content_view_version/verify_checksum.rb +29 -0
- data/app/lib/actions/katello/host/hypervisors_update.rb +1 -0
- data/app/lib/actions/katello/host/update_content_view.rb +2 -2
- data/app/lib/actions/katello/organization/manifest_import.rb +5 -0
- data/app/lib/actions/katello/organization/manifest_refresh.rb +3 -0
- data/app/lib/actions/katello/repository/metadata_generate.rb +7 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -0
- data/app/lib/actions/katello/repository/sync.rb +2 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/pulp3/capsule_content/verify_checksum.rb +27 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -9
- data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +5 -4
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +7 -2
- data/app/lib/katello/http_resource.rb +6 -1
- data/app/lib/katello/resources/candlepin/consumer.rb +1 -1
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +18 -6
- data/app/lib/katello/resources/candlepin/upstream_job.rb +1 -1
- data/app/lib/katello/resources/registry.rb +25 -0
- data/app/mailers/katello/subscription_mailer.rb +3 -6
- data/app/models/katello/concerns/organization_extensions.rb +42 -3
- data/app/models/katello/content_view.rb +28 -0
- data/app/models/katello/content_view_environment_content_facet.rb +4 -2
- data/app/models/katello/glue/provider.rb +19 -12
- data/app/models/katello/glue/pulp/repos.rb +3 -2
- data/app/models/katello/host/content_facet.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +1 -1
- data/app/models/katello/ping.rb +1 -1
- data/app/models/katello/repository.rb +27 -0
- data/app/models/katello/root_repository.rb +0 -4
- data/app/services/katello/content_unit_indexer.rb +9 -0
- data/app/services/katello/pulp3/alternate_content_source.rb +4 -6
- data/app/services/katello/pulp3/api/core.rb +13 -0
- data/app/services/katello/pulp3/api/yum.rb +11 -0
- data/app/services/katello/pulp3/docker_manifest.rb +5 -1
- data/app/services/katello/pulp3/repository/generic.rb +1 -1
- data/app/services/katello/pulp3/repository.rb +26 -6
- data/app/services/katello/pulp3/repository_mirror.rb +13 -12
- data/app/services/katello/pulp3/service_common.rb +2 -10
- data/app/services/katello/pulp3/smart_proxy_repository.rb +0 -2
- data/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb +75 -0
- data/app/views/foreman/job_templates/update_package_-_katello_ansible_default.erb +5 -1
- data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +2 -2
- data/app/views/foreman/job_templates/upload_profile.erb +16 -0
- data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +9 -0
- data/app/views/katello/api/v2/docker_manifests/show.json.rabl +1 -0
- data/app/views/katello/api/v2/organizations/show.json.rabl +9 -1
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +1 -1
- data/app/views/overrides/activation_keys/_host_media_type_select.html.erb +15 -5
- data/config/routes/api/registry.rb +4 -8
- data/config/routes/api/v2.rb +2 -0
- data/db/migrate/20240423112842_add_fields_to_katello_docker_manifest.rb +8 -0
- data/db/migrate/20240502192021_change_katello_repository_rpms_id_seq_to_big_int.rb +9 -0
- data/db/seeds.d/109-katello-notification-blueprints.rb +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +0 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +8 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +12 -10
- data/lib/katello/permission_creator.rb +3 -3
- data/lib/katello/permissions/registry_permissions.rb +4 -7
- data/lib/katello/plugin.rb +9 -8
- data/lib/katello/repository_types/ostree.rb +7 -0
- data/lib/katello/scheduled_jobs.rb +7 -1
- data/lib/katello/tasks/clean_backend_objects.rake +1 -1
- data/lib/katello/tasks/repository.rake +22 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +4 -3
- data/locale/bn/katello.po +166 -151
- data/locale/bn_IN/katello.po +166 -151
- data/locale/ca/katello.po +166 -151
- data/locale/cs/katello.po +166 -151
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po +172 -157
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +178 -163
- data/locale/de_AT/katello.po +166 -151
- data/locale/de_DE/katello.po +166 -151
- data/locale/el/katello.po +166 -151
- data/locale/en/katello.po +166 -151
- data/locale/en_GB/katello.po +166 -151
- data/locale/en_US/katello.po +166 -151
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +178 -163
- data/locale/et_EE/katello.po +166 -151
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +179 -164
- data/locale/gl/katello.po +166 -151
- data/locale/gu/katello.po +166 -151
- data/locale/he_IL/katello.po +166 -151
- data/locale/hi/katello.po +166 -151
- data/locale/id/katello.po +166 -151
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +169 -154
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +179 -164
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +177 -162
- data/locale/katello.pot +1119 -1062
- data/locale/kn/katello.po +166 -151
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +174 -159
- data/locale/ml_IN/katello.po +166 -151
- data/locale/mr/katello.po +166 -151
- data/locale/nl_NL/katello.po +166 -151
- data/locale/or/katello.po +166 -151
- data/locale/pa/katello.po +166 -151
- data/locale/pl/katello.po +166 -151
- data/locale/pl_PL/katello.po +166 -151
- data/locale/pt/katello.po +166 -151
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +178 -163
- data/locale/ro/katello.po +166 -151
- data/locale/ro_RO/katello.po +166 -151
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +171 -156
- data/locale/sl/katello.po +166 -151
- data/locale/sv_SE/katello.po +166 -151
- data/locale/ta/katello.po +166 -151
- data/locale/ta_IN/katello.po +166 -151
- data/locale/te/katello.po +166 -151
- data/locale/tr/katello.po +166 -151
- data/locale/vi/katello.po +166 -151
- data/locale/vi_VN/katello.po +166 -151
- data/locale/zh/katello.po +166 -151
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +179 -164
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +171 -156
- data/webpack/ForemanColumnExtensions/index.js +129 -0
- data/webpack/components/Table/TableWrapper.js +14 -0
- data/webpack/components/extensions/HostDetails/ActionsBar/index.js +1 -1
- data/webpack/components/extensions/Hosts/ActionsBar/index.js +20 -1
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/BulkChangeHostCVModal.js +220 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/actions.js +23 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js +25 -0
- data/webpack/components/extensions/Hosts/BulkActions/__tests__/bulkChangeHostCVModal.test.js +133 -0
- data/webpack/global_index.js +9 -0
- data/webpack/scenes/Hosts/ChangeContentSource/actions.js +3 -1
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +62 -24
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +24 -16
- data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +64 -5
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +16 -13
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +14 -8
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -1
- metadata +59 -41
- data/app/lib/actions/katello/host/upload_package_profile.rb +0 -45
- data/app/lib/actions/katello/host/upload_profiles.rb +0 -47
@@ -4,14 +4,16 @@ module Katello
|
|
4
4
|
before_action :disable_strong_params
|
5
5
|
before_action :confirm_settings
|
6
6
|
before_action :confirm_push_settings, only: [:start_upload_blob, :upload_blob, :finish_upload_blob,
|
7
|
-
:
|
7
|
+
:push_manifest]
|
8
8
|
skip_before_action :authorize
|
9
9
|
before_action :optional_authorize, only: [:token, :catalog]
|
10
10
|
before_action :registry_authorize, except: [:token, :v1_search, :catalog]
|
11
11
|
before_action :authorize_repository_read, only: [:pull_manifest, :tags_list]
|
12
|
-
|
12
|
+
# TODO: authorize_repository_write commented out until Katello indexes Pulp container push repositories.
|
13
|
+
# before_action :authorize_repository_write, only: [:start_upload_blob, :upload_blob, :finish_upload_blob,
|
14
|
+
# :push_manifest]
|
13
15
|
skip_before_action :check_media_type, only: [:start_upload_blob, :upload_blob, :finish_upload_blob,
|
14
|
-
:
|
16
|
+
:push_manifest]
|
15
17
|
|
16
18
|
wrap_parameters false
|
17
19
|
|
@@ -182,15 +184,8 @@ module Katello
|
|
182
184
|
end
|
183
185
|
|
184
186
|
def check_blob
|
185
|
-
|
186
|
-
|
187
|
-
response.header['Content-Length'] = "#{r.body.size}"
|
188
|
-
rescue RestClient::NotFound
|
189
|
-
digest_file = tmp_file("#{params[:digest][7..-1]}.tar")
|
190
|
-
raise unless File.exist? digest_file
|
191
|
-
response.header['Content-Length'] = "#{File.size digest_file}"
|
192
|
-
end
|
193
|
-
render json: {}
|
187
|
+
pulp_response = Resources::Registry::Proxy.get(@_request.fullpath, 'Accept' => request.headers['Accept'])
|
188
|
+
head pulp_response.code
|
194
189
|
end
|
195
190
|
|
196
191
|
def redirect_client
|
@@ -210,94 +205,67 @@ module Katello
|
|
210
205
|
redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers, max_redirects: 0) }
|
211
206
|
end
|
212
207
|
|
213
|
-
# FIXME: Reimplement for Pulp 3.
|
214
208
|
def push_manifest
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
begin
|
222
|
-
files = get_manifest_files(repository, manifest)
|
223
|
-
return if files.nil?
|
224
|
-
|
225
|
-
tar_file = create_tar_file(files, repository, tag)
|
226
|
-
return if tar_file.nil?
|
227
|
-
|
228
|
-
digest = upload_manifest(tar_file)
|
229
|
-
return if digest.nil?
|
230
|
-
|
231
|
-
tag = upload_tag(digest, tag)
|
232
|
-
return if tag.nil?
|
233
|
-
ensure
|
234
|
-
File.delete(tmp_file('manifest.json')) if File.exist? tmp_file('manifest.json')
|
209
|
+
headers = translated_headers_for_proxy
|
210
|
+
headers['Content-Type'] = request.headers['Content-Type'] if request.headers['Content-Type']
|
211
|
+
body = @_request.body.read
|
212
|
+
pulp_response = Resources::Registry::Proxy.put(@_request.fullpath, body, headers)
|
213
|
+
pulp_response.headers.each do |key, value|
|
214
|
+
response.header[key.to_s] = value
|
235
215
|
end
|
236
|
-
|
237
|
-
render json: {}
|
238
|
-
end
|
239
|
-
|
240
|
-
# FIXME: This is referring to a non-existent Pulp 2 server.
|
241
|
-
# Pulp 3 container push support is needed instead.
|
242
|
-
def pulp_content
|
243
|
-
Katello.pulp_server.resources.content
|
216
|
+
head pulp_response.code
|
244
217
|
end
|
245
218
|
|
246
219
|
def start_upload_blob
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
head 202
|
252
|
-
end
|
220
|
+
headers = translated_headers_for_proxy
|
221
|
+
headers['Content-Type'] = request.headers['Content-Type'] if request.headers['Content-Type']
|
222
|
+
headers['Content-Length'] = request.headers['Content-Length'] if request.headers['Content-Length']
|
223
|
+
pulp_response = Resources::Registry::Proxy.post(@_request.fullpath, @_request.body, headers)
|
253
224
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
render plain: '', status: :no_content
|
225
|
+
pulp_response.headers.each do |key, value|
|
226
|
+
response.header[key.to_s] = value
|
227
|
+
end
|
228
|
+
head pulp_response.code
|
259
229
|
end
|
260
230
|
|
261
|
-
def
|
262
|
-
|
263
|
-
|
231
|
+
def translated_headers_for_proxy
|
232
|
+
current_headers = {}
|
233
|
+
env = request.env.select do |key, _value|
|
234
|
+
key.match("^HTTP_.*")
|
235
|
+
end
|
236
|
+
env.each do |header|
|
237
|
+
current_headers[header[0].split('_')[1..-1].join('-')] = header[1]
|
238
|
+
end
|
239
|
+
current_headers
|
264
240
|
end
|
265
241
|
|
266
242
|
def upload_blob
|
267
|
-
|
268
|
-
|
243
|
+
headers = translated_headers_for_proxy
|
244
|
+
headers['Content-Type'] = request.headers['Content-Type'] if request.headers['Content-Type']
|
245
|
+
headers['Content-Range'] = request.headers['Content-Range'] if request.headers['Content-Range']
|
246
|
+
headers['Content-Length'] = request.headers['Content-Length'] if request.headers['Content-Length']
|
247
|
+
body = @_request.body.read
|
248
|
+
pulp_response = Resources::Registry::Proxy.patch(@_request.fullpath, body, headers)
|
249
|
+
|
250
|
+
pulp_response.headers.each do |key, value|
|
251
|
+
response.header[key.to_s] = value
|
269
252
|
end
|
270
253
|
|
271
|
-
|
272
|
-
if request.headers['Content-Range']
|
273
|
-
render_error 'unprocessable_entity', :status => :unprocessable_entity
|
274
|
-
end
|
275
|
-
|
276
|
-
response.header['Location'] = "#{request_url}/v2/#{params[:repository]}/blobs/uploads/#{params[:uuid]}"
|
277
|
-
response.header['Range'] = "1-#{request.body.size}"
|
278
|
-
response.header['Docker-Upload-UUID'] = params[:uuid]
|
279
|
-
head 204
|
254
|
+
head pulp_response.code
|
280
255
|
end
|
281
256
|
|
282
257
|
def finish_upload_blob
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
response.header['Docker-Content-Digest'] = params[:digest]
|
293
|
-
response.header['Content-Range'] = "1-#{File.size(digest_file)}"
|
294
|
-
response.header['Content-Length'] = "0"
|
295
|
-
response.header['Docker-Upload-UUID'] = params[:uuid]
|
296
|
-
head 201
|
297
|
-
end
|
258
|
+
headers = translated_headers_for_proxy
|
259
|
+
headers['Content-Type'] = request.headers['Content-Type'] if request.headers['Content-Type']
|
260
|
+
headers['Content-Range'] = request.headers['Content-Range'] if request.headers['Content-Range']
|
261
|
+
headers['Content-Length'] = request.headers['Content-Length'] if request.headers['Content-Length']
|
262
|
+
pulp_response = Resources::Registry::Proxy.put(@_request.fullpath, @_request.body, headers)
|
263
|
+
|
264
|
+
pulp_response.headers.each do |key, value|
|
265
|
+
response.header[key.to_s] = value
|
266
|
+
end
|
298
267
|
|
299
|
-
|
300
|
-
render plain: '', status: :ok
|
268
|
+
head pulp_response.code
|
301
269
|
end
|
302
270
|
|
303
271
|
def ping
|
@@ -411,47 +379,6 @@ module Katello
|
|
411
379
|
tar_file
|
412
380
|
end
|
413
381
|
|
414
|
-
# FIXME: Reimplement for Pulp 3.
|
415
|
-
def upload_manifest(tar_file)
|
416
|
-
upload_id = pulp_content.create_upload_request['upload_id']
|
417
|
-
filename = tmp_file(tar_file)
|
418
|
-
uploads = []
|
419
|
-
|
420
|
-
File.open(filename, 'rb') do |file|
|
421
|
-
content = file.read
|
422
|
-
pulp_content.upload_bits(upload_id, 0, content)
|
423
|
-
|
424
|
-
uploads << {
|
425
|
-
id: upload_id,
|
426
|
-
name: filename,
|
427
|
-
size: file.size,
|
428
|
-
checksum: Digest::SHA256.hexdigest(content)
|
429
|
-
}
|
430
|
-
end
|
431
|
-
|
432
|
-
File.delete(filename)
|
433
|
-
task = sync_task(::Actions::Katello::Repository::ImportUpload,
|
434
|
-
@repository, uploads, generate_metadata: true, sync_capsule: true)
|
435
|
-
task.output['upload_results'][0]['digest']
|
436
|
-
ensure
|
437
|
-
pulp_content.delete_upload_request(upload_id) if upload_id
|
438
|
-
end
|
439
|
-
|
440
|
-
# FIXME: Reimplement for Pulp 3.
|
441
|
-
def upload_tag(digest, tag)
|
442
|
-
upload_id = pulp_content.create_upload_request['upload_id']
|
443
|
-
uploads = [{
|
444
|
-
id: upload_id,
|
445
|
-
name: tag,
|
446
|
-
digest: digest
|
447
|
-
}]
|
448
|
-
sync_task(::Actions::Katello::Repository::ImportUpload, @repository, uploads,
|
449
|
-
:generate_metadata => true, :sync_capsule => true)
|
450
|
-
tag
|
451
|
-
ensure
|
452
|
-
pulp_content.delete_upload_request(upload_id) if upload_id
|
453
|
-
end
|
454
|
-
|
455
382
|
def tmp_dir
|
456
383
|
"#{Rails.root}/tmp"
|
457
384
|
end
|
@@ -15,16 +15,12 @@ module Katello
|
|
15
15
|
#param :id, String, :desc => N_("UUID of the consumer"), :required => true
|
16
16
|
def upload_package_profile
|
17
17
|
User.as_anonymous_admin do
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
uploader.trigger_applicability_generation
|
25
|
-
else
|
26
|
-
async_task(::Actions::Katello::Host::UploadPackageProfile, @host, request.raw_post)
|
27
|
-
end
|
18
|
+
uploader = ::Katello::Host::PackageProfileUploader.new(
|
19
|
+
host: @host,
|
20
|
+
profile_string: request.raw_post
|
21
|
+
)
|
22
|
+
uploader.upload
|
23
|
+
uploader.trigger_applicability_generation
|
28
24
|
end
|
29
25
|
render :json => Resources::Candlepin::Consumer.get(@host.subscription_facet.uuid)
|
30
26
|
end
|
@@ -33,16 +29,12 @@ module Katello
|
|
33
29
|
param :id, String, :desc => N_("UUID of the consumer"), :required => true
|
34
30
|
def upload_profiles
|
35
31
|
User.as_anonymous_admin do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
uploader.trigger_applicability_generation
|
43
|
-
else
|
44
|
-
async_task(::Actions::Katello::Host::UploadProfiles, @host, request.raw_post)
|
45
|
-
end
|
32
|
+
uploader = ::Katello::Host::ProfilesUploader.new(
|
33
|
+
host: @host,
|
34
|
+
profile_string: request.raw_post
|
35
|
+
)
|
36
|
+
uploader.upload
|
37
|
+
uploader.trigger_applicability_generation
|
46
38
|
end
|
47
39
|
render :json => Resources::Candlepin::Consumer.get(@host.subscription_facet.uuid)
|
48
40
|
end
|
@@ -40,7 +40,7 @@ module Katello
|
|
40
40
|
param :unlimited_hosts, :bool, :desc => N_("can the activation key have unlimited hosts")
|
41
41
|
param :release_version, String, :desc => N_("content release version")
|
42
42
|
param :service_level, String, :desc => N_("service level")
|
43
|
-
param :auto_attach, :bool, :desc => N_("auto attach subscriptions upon registration")
|
43
|
+
param :auto_attach, :bool, :desc => N_("auto attach subscriptions upon registration"), deprecated: true
|
44
44
|
param :purpose_usage, String, :desc => N_("Sets the system purpose usage")
|
45
45
|
param :purpose_role, String, :desc => N_("Sets the system purpose usage")
|
46
46
|
param :purpose_addons, Array, :desc => N_("Sets the system add-ons")
|
@@ -163,7 +163,11 @@ module Katello
|
|
163
163
|
respond_for_show(:resource => @activation_key)
|
164
164
|
end
|
165
165
|
|
166
|
-
|
166
|
+
def deprecate_entitlement_mode_endpoint
|
167
|
+
::Foreman::Deprecation.api_deprecation_warning(N_("This endpoint is deprecated and will be removed in an upcoming release. Simple Content Access is the only supported content access mode."))
|
168
|
+
end
|
169
|
+
|
170
|
+
api :PUT, "/activation_keys/:id/add_subscriptions", N_("Attach a subscription"), deprecated: true
|
167
171
|
param :id, :number, :desc => N_("ID of the activation key"), :required => true
|
168
172
|
param :subscription_id, :number, :desc => N_("Subscription identifier"), :required => false
|
169
173
|
param :quantity, :number, :desc => N_("Quantity of this subscription to add"), :required => false
|
@@ -172,6 +176,7 @@ module Katello
|
|
172
176
|
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => false
|
173
177
|
end
|
174
178
|
def add_subscriptions
|
179
|
+
deprecate_entitlement_mode_endpoint
|
175
180
|
if params[:subscriptions]
|
176
181
|
params[:subscriptions].each { |subscription| @activation_key.subscribe(subscription[:id], subscription[:quantity]) }
|
177
182
|
elsif params[:subscription_id]
|
@@ -181,13 +186,14 @@ module Katello
|
|
181
186
|
respond_for_index(:collection => subscription_index, :template => 'subscriptions')
|
182
187
|
end
|
183
188
|
|
184
|
-
api :PUT, "/activation_keys/:id/remove_subscriptions", N_("Unattach a subscription")
|
189
|
+
api :PUT, "/activation_keys/:id/remove_subscriptions", N_("Unattach a subscription"), deprecated: true
|
185
190
|
param :id, :number, :desc => N_("ID of the activation key"), :required => true
|
186
191
|
param :subscription_id, String, :desc => N_("Subscription ID"), :required => false
|
187
192
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => false do
|
188
193
|
param :id, String, :desc => N_("Subscription Pool uuid"), :required => false
|
189
194
|
end
|
190
195
|
def remove_subscriptions
|
196
|
+
deprecate_entitlement_mode_endpoint
|
191
197
|
if params[:subscriptions]
|
192
198
|
params[:subscriptions].each { |subscription| @activation_key.unsubscribe(subscription[:id]) }
|
193
199
|
elsif params[:subscription_id]
|
@@ -229,7 +235,7 @@ module Katello
|
|
229
235
|
|
230
236
|
api :GET, "/activation_keys/:id/product_content", N_("Show content available for an activation key")
|
231
237
|
param :id, String, :desc => N_("ID of the activation key"), :required => true
|
232
|
-
param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions")
|
238
|
+
param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions"), deprecated: true, default: true
|
233
239
|
param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the activation key's content view version")
|
234
240
|
param_group :search, Api::V2::ApiController
|
235
241
|
def product_content
|
@@ -112,6 +112,30 @@ module Katello
|
|
112
112
|
respond_for_async :resource => task
|
113
113
|
end
|
114
114
|
|
115
|
+
api :POST, '/capsules/:id/content/verify_checksum', N_('Check for missing or corrupted artifacts, and attempt to redownload them.')
|
116
|
+
param :id, :number, :required => true, :desc => N_('Id of the smart proxy')
|
117
|
+
param :environment_id, Integer, :desc => N_('Id of the environment to limit verifying checksum on')
|
118
|
+
param :content_view_id, Integer, :desc => N_('Id of the content view to limit verifying checksum on')
|
119
|
+
param :repository_id, Integer, :desc => N_('Id of the repository to limit verifying checksum on')
|
120
|
+
def verify_checksum
|
121
|
+
find_capsule(false)
|
122
|
+
find_environment if params[:environment_id]
|
123
|
+
find_content_view if params[:content_view_id]
|
124
|
+
find_repository if params[:repository_id]
|
125
|
+
|
126
|
+
repair_options = {
|
127
|
+
:environment_id => @environment.try(:id),
|
128
|
+
:content_view_id => @content_view.try(:id),
|
129
|
+
:repository_id => @repository.try(:id)
|
130
|
+
}
|
131
|
+
repair_options[:environment_ids] = @capsule.lifecycle_environments&.pluck(:id) unless (@environment || @content_view || @repository)
|
132
|
+
|
133
|
+
task = async_task(::Actions::Katello::CapsuleContent::VerifyChecksum,
|
134
|
+
@capsule,
|
135
|
+
repair_options)
|
136
|
+
respond_for_async :resource => task
|
137
|
+
end
|
138
|
+
|
115
139
|
protected
|
116
140
|
|
117
141
|
def respond_for_lifecycle_environments_index(environments)
|
@@ -3,8 +3,8 @@ module Katello
|
|
3
3
|
include ::Api::V2::BulkHostsExtension
|
4
4
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
5
|
|
6
|
-
before_action :find_authorized_katello_resource, :only => [:show, :update, :promote, :destroy, :republish_repositories]
|
7
|
-
before_action :find_content_view_from_version, :only => [:show, :update, :promote, :destroy, :republish_repositories]
|
6
|
+
before_action :find_authorized_katello_resource, :only => [:show, :update, :promote, :destroy, :republish_repositories, :verify_checksum]
|
7
|
+
before_action :find_content_view_from_version, :only => [:show, :update, :promote, :destroy, :republish_repositories, :verify_checksum]
|
8
8
|
before_action :find_optional_readable_content_view, :only => [:index]
|
9
9
|
|
10
10
|
before_action :find_environment, :only => [:index]
|
@@ -141,6 +141,13 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. New ver
|
|
141
141
|
respond_for_async :resource => task
|
142
142
|
end
|
143
143
|
|
144
|
+
api :POST, "/content_view_versions/:id/verify_checksum", N_("Verify checksum of repository contents in the content view version")
|
145
|
+
param :id, :number, :required => true, :desc => N_("Content view version identifier")
|
146
|
+
def verify_checksum
|
147
|
+
task = async_task(::Actions::Katello::ContentViewVersion::VerifyChecksum, @content_view_version)
|
148
|
+
respond_for_async :resource => task
|
149
|
+
end
|
150
|
+
|
144
151
|
private
|
145
152
|
|
146
153
|
def calculate_hosts_for_incremental(bulk_params, use_composites)
|
@@ -37,7 +37,7 @@ module Katello
|
|
37
37
|
api :GET, "/repositories/:repository_id/debs", N_("List deb packages")
|
38
38
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
39
39
|
param :content_view_version_id, :number, :desc => N_("Content View Version identifier")
|
40
|
-
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier")
|
40
|
+
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier. Use to filter by ID")
|
41
41
|
param :repository_id, :number, :desc => N_("Repository identifier")
|
42
42
|
param :environment_id, :number, :desc => N_("Environment identifier")
|
43
43
|
param :ids, Array, :desc => N_("Deb package identifiers to filter content by")
|
@@ -9,7 +9,7 @@ module Katello
|
|
9
9
|
api :GET, "/errata", N_("List errata")
|
10
10
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
11
11
|
param :content_view_version_id, :number, :desc => N_("Content View Version identifier")
|
12
|
-
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier")
|
12
|
+
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier. Use to filter by ID")
|
13
13
|
param :repository_id, :number, :desc => N_("Repository identifier")
|
14
14
|
param :environment_id, :number, :desc => N_("Environment identifier")
|
15
15
|
param :cve, String, :desc => N_("CVE identifier")
|
@@ -33,9 +33,14 @@ module Katello
|
|
33
33
|
api_base_url "/api"
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
def deprecate_entitlement_mode_endpoint
|
37
|
+
::Foreman::Deprecation.api_deprecation_warning(N_("This endpoint is deprecated and will be removed in an upcoming release. Simple Content Access is the only supported content access mode."))
|
38
|
+
end
|
39
|
+
|
40
|
+
api :GET, "/hosts/:host_id/subscriptions", N_("List a host's subscriptions"), deprecated: true
|
37
41
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
38
42
|
def index
|
43
|
+
deprecate_entitlement_mode_endpoint
|
39
44
|
@collection = index_response
|
40
45
|
respond_for_index :collection => @collection
|
41
46
|
end
|
@@ -47,9 +52,10 @@ module Katello
|
|
47
52
|
full_result_response(presenter.subscriptions)
|
48
53
|
end
|
49
54
|
|
50
|
-
api :PUT, "/hosts/:host_id/subscriptions/auto_attach", N_("Trigger an auto-attach of subscriptions")
|
55
|
+
api :PUT, "/hosts/:host_id/subscriptions/auto_attach", N_("Trigger an auto-attach of subscriptions"), deprecated: true
|
51
56
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
52
57
|
def auto_attach
|
58
|
+
deprecate_entitlement_mode_endpoint
|
53
59
|
if @host.organization.simple_content_access?
|
54
60
|
fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Auto-attach is disabled")
|
55
61
|
end
|
@@ -111,13 +117,14 @@ module Katello
|
|
111
117
|
rhsm_params
|
112
118
|
end
|
113
119
|
|
114
|
-
api :PUT, "/hosts/:host_id/subscriptions/remove_subscriptions"
|
120
|
+
api :PUT, "/hosts/:host_id/subscriptions/remove_subscriptions", N_("Remove subscriptions from a host"), deprecated: true
|
115
121
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
116
122
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
|
117
123
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
118
124
|
param :quantity, Integer, :desc => N_("If specified, remove the first instance of a subscription with matching id and quantity"), :required => false
|
119
125
|
end
|
120
126
|
def remove_subscriptions
|
127
|
+
deprecate_entitlement_mode_endpoint
|
121
128
|
#combine the quantities for duplicate pools into PoolWithQuantities objects
|
122
129
|
pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
|
123
130
|
new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.with_identifier(subscription['id']))
|
@@ -129,13 +136,14 @@ module Katello
|
|
129
136
|
respond_for_index(:collection => index_response(reload_host: true), :template => "index")
|
130
137
|
end
|
131
138
|
|
132
|
-
api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host")
|
139
|
+
api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host"), deprecated: true
|
133
140
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
134
141
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
|
135
142
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
136
143
|
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
|
137
144
|
end
|
138
145
|
def add_subscriptions
|
146
|
+
deprecate_entitlement_mode_endpoint
|
139
147
|
if @host.organization.simple_content_access?
|
140
148
|
fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Attaching subscriptions is disabled.")
|
141
149
|
end
|
@@ -106,7 +106,7 @@ module Katello
|
|
106
106
|
respond_for_async :resource => task
|
107
107
|
end
|
108
108
|
|
109
|
-
api :PUT, "/hosts/bulk/remove_subscriptions", N_("Remove subscriptions from one or more hosts")
|
109
|
+
api :PUT, "/hosts/bulk/remove_subscriptions", N_("Remove subscriptions from one or more hosts"), deprecated: true
|
110
110
|
param_group :bulk_params
|
111
111
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
|
112
112
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
@@ -123,7 +123,7 @@ module Katello
|
|
123
123
|
respond_for_async :resource => task
|
124
124
|
end
|
125
125
|
|
126
|
-
api :PUT, "/hosts/bulk/add_subscriptions", N_("Add subscriptions to one or more hosts")
|
126
|
+
api :PUT, "/hosts/bulk/add_subscriptions", N_("Add subscriptions to one or more hosts"), deprecated: true
|
127
127
|
param_group :bulk_params
|
128
128
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
|
129
129
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
@@ -142,7 +142,7 @@ module Katello
|
|
142
142
|
respond_for_async :resource => task
|
143
143
|
end
|
144
144
|
|
145
|
-
api :PUT, "/hosts/bulk/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts")
|
145
|
+
api :PUT, "/hosts/bulk/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts"), deprecated: true
|
146
146
|
param_group :bulk_params
|
147
147
|
def auto_attach
|
148
148
|
task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AutoAttachSubscriptions, @hosts)
|
@@ -56,22 +56,11 @@ module Katello
|
|
56
56
|
api :PUT, '/organizations/:id', N_('Update organization')
|
57
57
|
param :id, :number, :desc => N_("organization ID"), :required => true
|
58
58
|
param :redhat_repository_url, String, :desc => N_("Red Hat CDN URL"), deprecated: true
|
59
|
-
param :simple_content_access, :bool, :desc => N_('Whether Simple Content Access should be enabled for the organization.'), :required => false, :default => true, deprecated: true
|
60
59
|
param_group :resource
|
61
60
|
def update
|
62
61
|
if params[:redhat_repository_url]
|
63
62
|
sync_task(::Actions::Katello::CdnConfiguration::Update, @organization.cdn_configuration, url: params[:redhat_repository_url])
|
64
63
|
end
|
65
|
-
unless params[:simple_content_access].nil?
|
66
|
-
sca_param = ::Foreman::Cast.to_bool(params[:simple_content_access])
|
67
|
-
if sca_param && !@taxonomy.simple_content_access?(cached: false)
|
68
|
-
# user has requested SCA enable
|
69
|
-
sync_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:id])
|
70
|
-
elsif !sca_param && @taxonomy.simple_content_access?(cached: false)
|
71
|
-
# user has requested SCA disable
|
72
|
-
sync_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:id])
|
73
|
-
end
|
74
|
-
end
|
75
64
|
super
|
76
65
|
end
|
77
66
|
|
@@ -32,7 +32,7 @@ module Katello
|
|
32
32
|
api :GET, "/repositories/:repository_id/:resource_id", N_("List :resource_id")
|
33
33
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
34
34
|
param :content_view_version_id, :number, :desc => N_("Content View Version identifier")
|
35
|
-
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier")
|
35
|
+
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier. Use to filter by ID")
|
36
36
|
param :repository_id, :number, :desc => N_("Repository identifier")
|
37
37
|
param :environment_id, :number, :desc => N_("Environment identifier")
|
38
38
|
param :ids, Array, :desc => N_("Package identifiers to filter content by")
|
@@ -58,7 +58,7 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
|
|
58
58
|
param :verify_ssl_on_sync, :bool, :desc => N_("if true, Katello will verify the upstream url's SSL certifcates are signed by a trusted CA")
|
59
59
|
param :upstream_username, String, :desc => N_("Username of the upstream repository user used for authentication")
|
60
60
|
param :upstream_password, String, :desc => N_("Password of the upstream repository user used for authentication")
|
61
|
-
param :upstream_authentication_token, String, :desc => N_("
|
61
|
+
param :upstream_authentication_token, String, :desc => N_("Upstream authentication token string for yum repositories.")
|
62
62
|
param :deb_releases, String, :desc => N_("whitespace-separated list of releases to be synced from deb-archive")
|
63
63
|
param :deb_components, String, :desc => N_("whitespace-separated list of repo components to be synced from deb-archive")
|
64
64
|
param :deb_architectures, String, :desc => N_("whitespace-separated list of architectures to be synced from deb-archive")
|
@@ -576,13 +576,15 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
|
|
576
576
|
end
|
577
577
|
|
578
578
|
# rubocop:disable Metrics/CyclomaticComplexity
|
579
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
579
580
|
def repository_params
|
580
581
|
keys = [:download_policy, :mirroring_policy, :sync_policy, :arch, :verify_ssl_on_sync, :upstream_password,
|
581
|
-
:upstream_username, :download_concurrency, :
|
582
|
+
:upstream_username, :download_concurrency, :metadata_expire,
|
582
583
|
{:os_versions => []}, :deb_releases, :deb_components, :deb_architectures, :description,
|
583
584
|
:http_proxy_policy, :http_proxy_id, :retain_package_versions_count, {:ignorable_content => []}
|
584
585
|
]
|
585
586
|
keys += [{:include_tags => []}, {:exclude_tags => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
|
587
|
+
keys += [:upstream_authentication_token] if params[:action] == 'create' || @repository&.yum?
|
586
588
|
keys += [:ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token] if params[:action] == 'create' || @repository&.ansible_collection?
|
587
589
|
keys += [:label, :content_type] if params[:action] == "create"
|
588
590
|
|
@@ -614,27 +616,31 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
|
|
614
616
|
credential_value
|
615
617
|
end
|
616
618
|
|
617
|
-
# rubocop:disable Metrics/
|
619
|
+
# rubocop:disable Metrics/MethodLength
|
618
620
|
def construct_repo_from_params(repo_params) # rubocop:disable Metrics/AbcSize
|
619
621
|
root = @product.add_repo(repo_params.slice(:label, :name, :description, :url, :content_type, :arch, :unprotected,
|
620
622
|
:gpg_key, :ssl_ca_cert, :ssl_client_cert, :ssl_client_key,
|
621
623
|
:checksum_type, :download_policy, :http_proxy_policy,
|
622
624
|
:metadata_expire).to_h.with_indifferent_access)
|
623
|
-
root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
624
|
-
if root.docker?
|
625
|
-
root.include_tags = repo_params.fetch(:include_tags, [])
|
626
|
-
end
|
627
|
-
root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source']) if root.docker?
|
628
625
|
root.verify_ssl_on_sync = ::Foreman::Cast.to_bool(repo_params[:verify_ssl_on_sync]) if repo_params.key?(:verify_ssl_on_sync)
|
629
626
|
root.mirroring_policy = repo_params[:mirroring_policy] || Katello::RootRepository::MIRRORING_POLICY_CONTENT
|
630
627
|
root.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
|
631
628
|
root.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
|
632
|
-
root.upstream_authentication_token = repo_params[:upstream_authentication_token] if repo_params.key?(:upstream_authentication_token)
|
633
|
-
root.ignorable_content = repo_params[:ignorable_content] if root.yum? && repo_params.key?(:ignorable_content)
|
634
629
|
root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
|
635
630
|
root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
|
636
|
-
|
637
|
-
|
631
|
+
|
632
|
+
if root.yum?
|
633
|
+
root.upstream_authentication_token = repo_params[:upstream_authentication_token] if repo_params.key?(:upstream_authentication_token)
|
634
|
+
root.retain_package_versions_count = repo_params[:retain_package_versions_count] if repo_params.key?(:retain_package_versions_count)
|
635
|
+
root.ignorable_content = repo_params[:ignorable_content] if repo_params.key?(:ignorable_content)
|
636
|
+
root.os_versions = repo_params.fetch(:os_versions, [])
|
637
|
+
end
|
638
|
+
|
639
|
+
if root.docker?
|
640
|
+
root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
641
|
+
root.include_tags = repo_params.fetch(:include_tags, [])
|
642
|
+
root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source'])
|
643
|
+
end
|
638
644
|
|
639
645
|
if root.generic?
|
640
646
|
generic_remote_options = generic_remote_options_hash(repo_params)
|
@@ -29,7 +29,7 @@ module Katello
|
|
29
29
|
param :with_custom, :bool, :required => false, :desc => N_("If true, return custom repository sets along with redhat repos. Will be ignored if repository_type is supplied.")
|
30
30
|
param :activation_key_id, :number, :desc => N_("activation key identifier"), :required => false
|
31
31
|
param :host_id, :number, :desc => N_("Id of the host"), :required => false
|
32
|
-
param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions.")
|
32
|
+
param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions."), deprecated: true, default: true
|
33
33
|
param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the host's or activation key's content view version and lifecycle environment.")
|
34
34
|
param :status, [:enabled, :disabled, :overridden],
|
35
35
|
:desc => N_("Limit content to enabled / disabled / overridden"),
|
@@ -225,6 +225,7 @@ module Katello
|
|
225
225
|
|
226
226
|
def setup_params
|
227
227
|
return unless params[:id]
|
228
|
+
params[:content_access_mode_all] = true
|
228
229
|
if params[:entity] == :activation_key
|
229
230
|
params[:activation_key_id] ||= params[:id]
|
230
231
|
else
|