katello 4.15.0 → 4.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdca2a5e86da6b9dee888fb990127bb2e25604039907a5594fcfd24480908118
4
- data.tar.gz: 6cac835a884d5ace60819762c04b6817e41dc17c0fa4923721cb79f0977d328b
3
+ metadata.gz: 197af1b9f99978a1178cbae74367c297adbf8ba6075164a8b392607396bd5fec
4
+ data.tar.gz: 4dc930d7beb511cff99bf9f18de2bbce228ac6cb30214ccf26498f5659d492e8
5
5
  SHA512:
6
- metadata.gz: 18effa84dce5b6f9feca34e0966997e7b5d85fd834e848d1e7f16115712295ab8c820ac20c8d252e6f7d8b8e9bb07b9d791df0ad6c08aee3f6e76956a2468381
7
- data.tar.gz: b5b004f2358caa23c8a9b27875d3eb378f0b3961bc4b071c1e12702c5eccf439b3eb654557ea948c200fd5b2f7f379d1cc23aef009ab389285a2d25c7ef7b264
6
+ metadata.gz: f82b441dd7dce81a9e570b14c4bdeab6aca2a98a97681000603b9d198515d7f3c5479f6e19f9a583c2a0baf9c02e38e6cd51e54a35b192f23014d5fa95d665e1
7
+ data.tar.gz: 724ff457e264705c0b78057c703f359385bad2db8ac01e93af7a54b35fb34f6c3266eb01cecabb96ba7bfce9f05566940ac439a2137b500481604c75a4910387
@@ -12,9 +12,10 @@ module Katello
12
12
  param :repository_id, :number, :required => true, :desc => N_("repository id")
13
13
  param :size, :number, :required => true, :desc => N_("Size of file to upload")
14
14
  param :checksum, String, :required => false, :desc => N_("Checksum of file to upload")
15
- param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree_ref', 'rpm', 'srpm')")
15
+ param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'file', 'ostree_ref', 'rpm', 'srpm')")
16
16
  def create
17
17
  fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Ansible collections.") if @repository.ansible_collection?
18
+ fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload container content via Hammer/API. Use podman push instead.") if @repository.docker?
18
19
  content_type = params[:content_type] || ::Katello::RepositoryTypeManager.find(@repository.content_type)&.default_managed_content_type&.label
19
20
  RepositoryTypeManager.check_content_matches_repo_type!(@repository, content_type)
20
21
  if ::Katello::RepositoryTypeManager.generic_content_type?(content_type)
@@ -186,7 +186,7 @@ module Katello
186
186
  validate_content_overrides_enabled(override_params)
187
187
  end
188
188
  sync_task(::Actions::Katello::Host::UpdateContentOverrides, @host, content_override_values, false)
189
- fetch_product_content
189
+ fetch_product_content(!params.dig(:content_overrides_search, :search).nil? && Foreman::Cast.to_bool(params.dig(:content_overrides_search, :limit_to_env)))
190
190
  end
191
191
 
192
192
  api :GET, "/hosts/:host_id/subscriptions/available_release_versions", N_("Show releases available for the content host")
@@ -205,8 +205,8 @@ module Katello
205
205
 
206
206
  private
207
207
 
208
- def fetch_product_content
209
- content_finder = ProductContentFinder.new(:consumable => @host.subscription_facet)
208
+ def fetch_product_content(limit_to_env = false)
209
+ content_finder = ProductContentFinder.new(:match_environment => limit_to_env, :consumable => @host.subscription_facet)
210
210
  content = content_finder.presenter_with_overrides(@host.subscription_facet.candlepin_consumer.content_overrides)
211
211
  respond_with_template_collection("index", 'repository_sets', :collection => full_result_response(content))
212
212
  end
@@ -403,6 +403,13 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
403
403
  end
404
404
  end
405
405
 
406
+ additive_policy = ::Katello::RootRepository::MIRRORING_POLICY_ADDITIVE
407
+ is_repo_param_additive = repo_params[:mirroring_policy] == additive_policy
408
+ is_root_additive = @repository.root.mirroring_policy == additive_policy
409
+
410
+ if @repository.yum? && !(is_repo_param_additive || is_root_additive)
411
+ repo_params[:retain_package_versions_count] = nil
412
+ end
406
413
  sync_task(::Actions::Katello::Repository::Update, @repository.root, repo_params)
407
414
  respond_for_show(:resource => @repository)
408
415
  end
@@ -257,17 +257,16 @@ module Katello
257
257
  search_since = since.present? ? "ended_at > \"#{since}\"" : nil
258
258
  search_result = status.present? && status != 'all' ? "result = #{status}" : nil
259
259
  labels = 'label ^ (Actions::Katello::Host::Erratum::Install, Actions::Katello::Host::Erratum::ApplicableErrataInstall)'
260
- select = 'foreman_tasks_tasks.*'
261
260
 
262
261
  new_labels = 'label = Actions::RemoteExecution::RunHostJob AND remote_execution_feature.label ^ (katello_errata_install, katello_errata_install_by_search)'
263
262
  labels = [labels, new_labels].map { |label| "(#{label})" }.join(' OR ')
264
- select += ',template_invocations.id AS template_invocation_id'
265
263
 
266
264
  search = [search_up_to, search_since, search_result, "state = stopped", labels].compact.join(' and ')
267
265
 
268
266
  tasks = load_resource(klass: ForemanTasks::Task,
269
267
  permission: 'view_foreman_tasks',
270
- select: select,
268
+ joins: [:template_invocation],
269
+ preload: [:template_invocation],
271
270
  search: search)
272
271
  only_host_ids = ::Host.search_for(host_filter).pluck(:id) if host_filter
273
272
 
@@ -383,7 +382,7 @@ module Katello
383
382
  found = script.lines.find { |line| line.start_with? '# RESOLVED_ERRATA_IDS=' } || ''
384
383
  (found.chomp.split('=', 2).last || '').split(',')
385
384
  else
386
- TemplateInvocationInputValue.joins(:template_input).where("template_invocation_id = ? AND template_inputs.name = ?", task.template_invocation_id, 'errata')
385
+ TemplateInvocationInputValue.joins(:template_input).where("template_invocation_id = ? AND template_inputs.name = ?", task.template_invocation.id, 'errata')
387
386
  .first&.value&.split(',') || []
388
387
  end
389
388
  end
@@ -4,7 +4,8 @@ module Katello
4
4
  class Product < CandlepinResource
5
5
  class << self
6
6
  def all(owner_label, included = [])
7
- products = JSON.parse(Candlepin::CandlepinResource.get(path(owner_label) + "?#{included_list(included)}", self.default_headers).body)
7
+ url = path(owner_label) + "?active=include" + "&#{included_list(included)}"
8
+ products = JSON.parse(Candlepin::CandlepinResource.get(url, self.default_headers).body)
8
9
  ::Katello::Util::Data.array_with_indifferent_access products
9
10
  end
10
11
 
@@ -27,8 +27,9 @@ module Katello
27
27
  Rails.logger.info "You may want to change the content view / lifecycle environment for these activation keys manually."
28
28
  end
29
29
  (aks_with_no_cve + aks_with_missing_cve).each do |ak|
30
- default_content_view = ak.organization.default_content_view
31
- library = ak.organization.library
30
+ ak_organization = ::Organization.find_by(id: ak.organization_id)
31
+ default_content_view = ak_organization.default_content_view
32
+ library = ak_organization.library
32
33
  Rails.logger.info "Updating activation key #{ak.name} with default content_view_id and lifecycle_environment_id"
33
34
  ak&.update_columns(content_view_id: default_content_view&.id, environment_id: library&.id)
34
35
  end
@@ -112,7 +112,7 @@ module Katello
112
112
  scoped_search :on => :name, :complete_value => true
113
113
  scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
114
114
  scoped_search :on => :label, :complete_value => true
115
- scoped_search :on => :composite, :complete_value => true
115
+ scoped_search :on => :composite, :complete_value => { :true => true, :false => false }
116
116
  scoped_search :on => :generated_for, :complete_value => true
117
117
  scoped_search :on => :default # just for ordering
118
118
  scoped_search :on => :name, :complete_value => true,
@@ -343,6 +343,9 @@ module Katello
343
343
  unless yum?
344
344
  errors.add(:retain_package_versions_count, N_("is only allowed for Yum repositories."))
345
345
  end
346
+ if yum? && self.mirroring_policy != MIRRORING_POLICY_ADDITIVE
347
+ errors.add(:retain_package_versions_count, N_("cannot be set for repositories without 'Additive' mirroring policy."))
348
+ end
346
349
  if self.retain_package_versions_count.to_i < 0
347
350
  errors.add(:retain_package_versions_count, N_("must not be a negative value."))
348
351
  end
@@ -33,6 +33,7 @@ module Katello
33
33
  params[:consumer] = upstream_consumer_id if attachable
34
34
  params[:sort_by] = 'Product.name'
35
35
  params[:order] = 'asc'
36
+ params[:add_future] = true
36
37
  params
37
38
  end
38
39
 
@@ -29,7 +29,7 @@ module Katello
29
29
 
30
30
  root = product.root_repositories.find do |r|
31
31
  if repo.content&.id && repo.redhat
32
- repo_exists = r.content.cp_content_id == repo.content.id &&
32
+ repo_exists = r.library_instance.content.cp_content_id == repo.content.id &&
33
33
  r.arch == repo.arch &&
34
34
  r.major == repo.major &&
35
35
  r.minor == repo.minor
@@ -27,7 +27,6 @@ Katello::RepositoryTypeManager.register(::Katello::Repository::DOCKER_TYPE) do
27
27
  :priority => 1,
28
28
  :pulp3_service_class => ::Katello::Pulp3::DockerManifest,
29
29
  :removable => true,
30
- :uploadable => true,
31
30
  :primary_content => true
32
31
  content_type Katello::DockerManifestList,
33
32
  :priority => 2,
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.15.0".freeze
2
+ VERSION = "4.15.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.15.0
4
+ version: 4.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-02 00:00:00.000000000 Z
11
+ date: 2025-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -101,6 +101,9 @@ dependencies:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 7.1.0
104
+ - - "<"
105
+ - !ruby/object:Gem::Version
106
+ version: '15'
104
107
  type: :runtime
105
108
  prerelease: false
106
109
  version_requirements: !ruby/object:Gem::Requirement
@@ -108,6 +111,9 @@ dependencies:
108
111
  - - ">="
109
112
  - !ruby/object:Gem::Version
110
113
  version: 7.1.0
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '15'
111
117
  - !ruby/object:Gem::Dependency
112
118
  name: dynflow
113
119
  requirement: !ruby/object:Gem::Requirement