katello 4.17.0 → 4.17.2

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.

Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +2 -0
  3. data/app/lib/actions/helpers/smart_proxy_sync_helper.rb +12 -0
  4. data/app/lib/actions/katello/content_view/add_rolling_repo_clone.rb +4 -4
  5. data/app/lib/actions/katello/content_view/remove_rolling_repo_clone.rb +9 -1
  6. data/app/lib/actions/katello/repository/destroy.rb +6 -2
  7. data/app/lib/actions/katello/repository/import_upload.rb +2 -3
  8. data/app/lib/actions/katello/repository/sync.rb +2 -1
  9. data/app/lib/actions/katello/repository/upload_files.rb +2 -1
  10. data/app/models/katello/deb.rb +0 -2
  11. data/app/views/foreman/job_templates/install_packages_by_search_query_-_katello_ansible_default.erb +6 -14
  12. data/app/views/foreman/job_templates/remove_packages_by_search_query_-_katello_ansible_default.erb +2 -15
  13. data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +5 -13
  14. data/db/migrate/20240924161240_katello_recreate_evr_constructs.rb +20 -0
  15. data/db/migrate/20250714190050_add_missing_rpms_evr_index.rb +14 -0
  16. data/lib/katello/version.rb +1 -1
  17. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  18. data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
  19. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  20. data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
  21. data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
  22. data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
  23. data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
  24. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  25. data/locale/ro/LC_MESSAGES/katello.mo +0 -0
  26. data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
  27. data/locale/vi/LC_MESSAGES/katello.mo +0 -0
  28. data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
  29. data/locale/zh/LC_MESSAGES/katello.mo +0 -0
  30. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c680d70aff055930ae2682d03f339d169d0e8925bd750b3589814aa575b38ae6
4
- data.tar.gz: 9bc9ea09232f58f7a34fee366d45d0769bfbe8678833e63f3c533e001b23c20d
3
+ metadata.gz: 89755fa3c2987395a5af752bbf273da998d09d4f0f45029915596c04ecf60eb1
4
+ data.tar.gz: 18d7cebcfd3dc55158d2eaec48db546d9b6253ddd9d645c4560a4182dd68e19f
5
5
  SHA512:
6
- metadata.gz: d866d7231780c82c6f437d23367cfd72292db1ba8ed5e4bfb32c9f323b8454be3f06833cb15823f9147afdff35f828d1d07363f83a9f0b2421e6f74de9f49f40
7
- data.tar.gz: 328ff0812895e6201f486b5ae01459b1710dbf6532a6ac1c5164c5263a8a3843d24d1fa9301471498c623e4edcbaabd16d955ba06985af02a0a1de4918145b6e
6
+ metadata.gz: 9e1649be7b107364a96ddd4cd07b82b048dc50ef7046e2570ea0ca38bd5bd787360d9a072cdb77fc62fa20f20ed129f6940d9ebfbebfd50f3972c2f4bffb866d
7
+ data.tar.gz: cd12cfad7c854933a4a8418715b0d86bd920f0840d4acf42c314790e89ad531a21b258cf2fdad84c8808aa138f7f236d143c65d1d60bc1ca8a479536496ad7b8
@@ -560,6 +560,8 @@ module Katello
560
560
 
561
561
  def check_blob
562
562
  pulp_response = Resources::Registry::Proxy.get(@_request.fullpath, 'Accept' => request.headers['Accept'])
563
+ response.headers['Content-Type'] = pulp_response.headers[:content_type] if pulp_response.headers[:content_type]
564
+ response.headers['Content-Length'] = pulp_response.headers[:content_length] if pulp_response.headers[:content_length]
563
565
  head pulp_response.code
564
566
  end
565
567
 
@@ -0,0 +1,12 @@
1
+ module Actions
2
+ module Helpers
3
+ module SmartProxySyncHelper
4
+ def schedule_async_repository_proxy_sync(repository)
5
+ return unless Setting[:foreman_proxy_content_auto_sync]
6
+ if SmartProxy.unscoped.pulpcore_proxies_with_environment(repository.environment).exists?
7
+ ForemanTasks.async_task(::Actions::Katello::Repository::CapsuleSync, repository)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,6 +2,8 @@ module Actions
2
2
  module Katello
3
3
  module ContentView
4
4
  class AddRollingRepoClone < Actions::EntryAction
5
+ include Helpers::SmartProxySyncHelper
6
+
5
7
  def plan(content_view, repository_ids)
6
8
  library = content_view.organization.library
7
9
  clone_ids = []
@@ -27,10 +29,8 @@ module Actions
27
29
  end
28
30
 
29
31
  def run
30
- if Setting[:foreman_proxy_content_auto_sync]
31
- ::Katello::Repository.where(id: input[:repository_ids]).each do |repo|
32
- ForemanTasks.async_task(::Actions::Katello::Repository::CapsuleSync, repo)
33
- end
32
+ ::Katello::Repository.where(id: input[:repository_ids]).each do |repository|
33
+ schedule_async_repository_proxy_sync(repository)
34
34
  end
35
35
  end
36
36
  end
@@ -20,7 +20,15 @@ module Actions
20
20
  end
21
21
 
22
22
  def run
23
- ::Katello::Repository.where(id: input[:repository_ids]).destroy_all
23
+ ::Katello::Repository.where(id: input[:repository_ids]).each do |repository|
24
+ SmartProxy.unscoped.with_repo(repository).each do |smart_proxy|
25
+ next if smart_proxy.pulp_primary?
26
+
27
+ smart_proxy.content_counts&.dig("content_view_versions", repository.content_view_version_id.to_s, "repositories")&.delete(repository.id.to_s)
28
+ smart_proxy.save
29
+ end
30
+ repository.destroy!
31
+ end
24
32
  end
25
33
  end
26
34
  end
@@ -88,13 +88,17 @@ module Actions
88
88
  def handle_custom_content(repository, remove_from_content_view_versions)
89
89
  #if this is the last instance of a custom repo or a deb repo using structured APT, destroy the content
90
90
  if remove_from_content_view_versions || repository.root.repositories.where.not(id: repository.id).empty? || repository.deb_using_structured_apt?
91
+ # Never destroy content for structured apt rolling repo clones, because it belongs to the library instance
92
+ return if repository.deb_using_structured_apt? && repository.content_view.rolling?
93
+
91
94
  plan_action(::Actions::Katello::Product::ContentDestroy, repository)
92
95
  end
93
96
  end
94
97
 
95
98
  def handle_redhat_content(repository)
96
- if repository.content_view.content_view_environment(repository.environment)
97
- plan_action(Candlepin::Environment::SetContent, repository.content_view, repository.environment, repository.content_view.content_view_environment(repository.environment))
99
+ content_view_environment = repository.content_view.content_view_environment(repository.environment)
100
+ if content_view_environment && !repository.content_view.rolling?
101
+ plan_action(Candlepin::Environment::SetContent, repository.content_view, repository.environment, content_view_environment)
98
102
  end
99
103
  end
100
104
 
@@ -4,6 +4,7 @@ module Actions
4
4
  module Repository
5
5
  class ImportUpload < Actions::EntryAction
6
6
  include Helpers::RollingCVRepos
7
+ include Helpers::SmartProxySyncHelper
7
8
 
8
9
  # rubocop:disable Metrics/MethodLength
9
10
  def plan(repository, uploads, options = {})
@@ -63,9 +64,7 @@ module Actions
63
64
 
64
65
  def run
65
66
  repository = ::Katello::Repository.find(input[:repository_id])
66
- if input[:sync_capsule] && (Setting[:foreman_proxy_content_auto_sync])
67
- ForemanTasks.async_task(Katello::Repository::CapsuleSync, repository)
68
- end
67
+ schedule_async_repository_proxy_sync(repository) if input[:sync_capsule]
69
68
  output[:upload_results] = results_to_json(input[:upload_results])
70
69
  rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
71
70
  end
@@ -6,6 +6,7 @@ module Actions
6
6
  extend ApipieDSL::Class
7
7
  include Helpers::Presenter
8
8
  include Helpers::RollingCVRepos
9
+ include Helpers::SmartProxySyncHelper
9
10
  include ::Actions::ObservableAction
10
11
  middleware.use Actions::Middleware::ExecuteIfContentsChanged
11
12
 
@@ -72,7 +73,7 @@ module Actions
72
73
  update_rolling_content_views_async(repo, input[:contents_changed])
73
74
  end
74
75
  repo.clear_smart_proxy_sync_histories if input[:contents_changed]
75
- ForemanTasks.async_task(Repository::CapsuleSync, repo) if Setting[:foreman_proxy_content_auto_sync]
76
+ schedule_async_repository_proxy_sync(repo)
76
77
  rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
77
78
  end
78
79
 
@@ -7,6 +7,7 @@ module Actions
7
7
  module Repository
8
8
  class UploadFiles < Actions::EntryAction
9
9
  include Helpers::RollingCVRepos
10
+ include Helpers::SmartProxySyncHelper
10
11
 
11
12
  def plan(repository, files, content_type = nil, options = {})
12
13
  action_subject(repository)
@@ -52,7 +53,7 @@ module Actions
52
53
 
53
54
  def run
54
55
  repository = ::Katello::Repository.find(input[:repository][:id])
55
- ForemanTasks.async_task(Repository::CapsuleSync, repository) if Setting[:foreman_proxy_content_auto_sync]
56
+ schedule_async_repository_proxy_sync(repository)
56
57
  rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
57
58
  end
58
59
 
@@ -4,8 +4,6 @@ module Katello
4
4
 
5
5
  CONTENT_TYPE = 'deb'.freeze
6
6
 
7
- has_many :repository_debs, :class_name => "Katello::RepositoryDeb", :dependent => :destroy, :inverse_of => :deb
8
- has_many :repositories, :through => :repository_debs, :class_name => "Katello::Repository"
9
7
  has_many :content_facet_applicable_debs, :class_name => "Katello::ContentFacetApplicableDeb",
10
8
  :dependent => :destroy, :inverse_of => :deb
11
9
  has_many :content_facets, :through => :content_facet_applicable_debs, :class_name => "Katello::Host::ContentFacet"
@@ -19,23 +19,15 @@ template_inputs:
19
19
  - hosts: all
20
20
  tasks:
21
21
  <%= indent(4) { snippet('check_bootc_status') } %>
22
- - name: Enable bootc overlay
23
- shell:
24
- cmd: 'bootc usr-overlay'
25
- register: out
26
- ignore_errors: true
27
- when: is_bootc_host
28
- - debug: var=out
29
- - name: Install packages via dnf for image mode machines
30
- package:
31
- use: 'dnf'
32
22
  <% if package_names.empty? -%>
33
- name: []
23
+ - name: Install all packages transiently for image mode machines
24
+ shell: "dnf --transient install -y '*'"
25
+ when: is_bootc_host
34
26
  <% else -%>
35
- name: <%= indent(10) { to_yaml(package_names).gsub(/---/, "") } -%>
36
- state: present
37
- <% end -%>
27
+ - name: Install packages transiently for image mode machines
28
+ shell: "dnf --transient install -y <%= package_names.join(' ') %>"
38
29
  when: is_bootc_host
30
+ <% end -%>
39
31
  - name: Install packages normally
40
32
  package:
41
33
  <% if package_names.empty? -%>
@@ -19,21 +19,8 @@ template_inputs:
19
19
  - hosts: all
20
20
  tasks:
21
21
  <%= indent(4) { snippet('check_bootc_status') } %>
22
- - name: Enable bootc overlay
23
- shell:
24
- cmd: 'bootc usr-overlay'
25
- register: out
26
- ignore_errors: true
27
- when: is_bootc_host
28
- - debug: var=out
29
- - name: Remove packages via dnf for image mode machines
30
- package:
31
- name:
32
- <% package_names.each do |package_name| -%>
33
- - <%= package_name %>
34
- <% end -%>
35
- state: absent
36
- use: 'dnf'
22
+ - name: Remove packages transiently for image mode machines
23
+ shell: "dnf --transient remove -y <%= package_names.join(' ') %>"
37
24
  when: is_bootc_host
38
25
  - name: Remove packages normally
39
26
  package:
@@ -28,20 +28,12 @@ template_inputs:
28
28
  - hosts: all
29
29
  tasks:
30
30
  <%= indent(4) { snippet('check_bootc_status') } %>
31
- - name: Enable bootc overlay
32
- shell:
33
- cmd: 'bootc usr-overlay'
34
- register: out
35
- ignore_errors: true
31
+ - name: Update packages transiently for image mode machines
32
+ shell: |
33
+ dnf --transient install -y <%= package_names.join(' ') %>
34
+ dnf --transient upgrade -y --best <%= package_names.join(' ') %>
36
35
  when: is_bootc_host
37
- - debug: var=out
38
- - name: Install packages via dnf for image mode machines
39
- package:
40
- name: <%= indent(10) { to_yaml(package_names).gsub(/---/, "") } -%>
41
- state: latest
42
- use: 'dnf'
43
- when: is_bootc_host
44
- - name: Install packages normally
36
+ - name: Update packages normally
45
37
  package:
46
38
  name: <%= indent(10) { to_yaml(package_names).gsub(/---/, "") } -%>
47
39
  state: latest
@@ -1,5 +1,23 @@
1
1
  class KatelloRecreateEvrConstructs < ActiveRecord::Migration[6.1]
2
+ def fix_installed_package_dupes
3
+ # Remove duplicate installed packages and host installed packages.
4
+ duplicated_nvreas = ::Katello::InstalledPackage.group(:nvrea).having('count(*) > 1').pluck(:nvrea)
5
+ duplicated_nvreas.each do |nvrea|
6
+ packages_relation = ::Katello::InstalledPackage.where(nvrea: nvrea).order(:id)
7
+ original_package = packages_relation.first
8
+ duplicate_package_ids = packages_relation.offset(1).pluck(:id)
9
+ hosts_with_original_package = ::Katello::HostInstalledPackage.where(installed_package_id: original_package.id).pluck(:host_id)
10
+ if hosts_with_original_package.any?
11
+ ::Katello::HostInstalledPackage.where(host_id: hosts_with_original_package, installed_package_id: duplicate_package_ids).delete_all
12
+ end
13
+ ::Katello::HostInstalledPackage.where(installed_package_id: duplicate_package_ids).update_all(installed_package_id: original_package.id)
14
+ ::Katello::InstalledPackage.where(id: duplicate_package_ids).delete_all
15
+ end
16
+ end
17
+
2
18
  def up
19
+ fix_installed_package_dupes
20
+
3
21
  if !extension_enabled?('evr')
4
22
  return
5
23
  else
@@ -147,6 +165,8 @@ class KatelloRecreateEvrConstructs < ActiveRecord::Migration[6.1]
147
165
  rpmver_array(coalesce(release,'empty'))::evr_array_item[])::evr_t);
148
166
  SQL
149
167
 
168
+ add_index :katello_rpms, [:name, :arch, :evr]
169
+
150
170
  create_trigger :evr_insert_trigger_katello_rpms, on: :katello_rpms
151
171
  create_trigger :evr_update_trigger_katello_rpms, on: :katello_rpms
152
172
  create_trigger :evr_insert_trigger_katello_installed_packages, on: :katello_installed_packages
@@ -0,0 +1,14 @@
1
+ class AddMissingRpmsEvrIndex < ActiveRecord::Migration[7.0]
2
+ def up
3
+ # Re-add the katello_rpms EVR index dropped erroneously by 20240924161240.
4
+ unless index_exists?(:katello_rpms, [:name, :arch, :evr])
5
+ add_index :katello_rpms, [:name, :arch, :evr]
6
+ end
7
+ end
8
+
9
+ def down
10
+ if index_exists?(:katello_rpms, [:name, :arch, :evr])
11
+ remove_index :katello_rpms, [:name, :arch, :evr]
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.17.0".freeze
2
+ VERSION = "4.17.2".freeze
3
3
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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.17.0
4
+ version: 4.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-10 00:00:00.000000000 Z
11
+ date: 2025-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,6 +87,9 @@ dependencies:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '9.1'
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: 11.0.1
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
@@ -94,6 +97,9 @@ dependencies:
94
97
  - - ">="
95
98
  - !ruby/object:Gem::Version
96
99
  version: '9.1'
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: 11.0.1
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: foreman_remote_execution
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +107,9 @@ dependencies:
101
107
  - - ">="
102
108
  - !ruby/object:Gem::Version
103
109
  version: 7.1.0
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: 16.2.0
104
113
  type: :runtime
105
114
  prerelease: false
106
115
  version_requirements: !ruby/object:Gem::Requirement
@@ -108,6 +117,9 @@ dependencies:
108
117
  - - ">="
109
118
  - !ruby/object:Gem::Version
110
119
  version: 7.1.0
120
+ - - "<"
121
+ - !ruby/object:Gem::Version
122
+ version: 16.2.0
111
123
  - !ruby/object:Gem::Dependency
112
124
  name: dynflow
113
125
  requirement: !ruby/object:Gem::Requirement
@@ -800,6 +812,7 @@ files:
800
812
  - app/lib/actions/helpers/output_propagator.rb
801
813
  - app/lib/actions/helpers/presenter.rb
802
814
  - app/lib/actions/helpers/rolling_cv_repos.rb
815
+ - app/lib/actions/helpers/smart_proxy_sync_helper.rb
803
816
  - app/lib/actions/helpers/smart_proxy_sync_history_helper.rb
804
817
  - app/lib/actions/katello/activation_key/create.rb
805
818
  - app/lib/actions/katello/activation_key/destroy.rb
@@ -2160,6 +2173,7 @@ files:
2160
2173
  - db/migrate/20250215143303_drop_katello_yum_metadata_file.rb
2161
2174
  - db/migrate/20250409120843_fix_file_download_policy.rb
2162
2175
  - db/migrate/20250410155300_change_ansible_templates_category.rb
2176
+ - db/migrate/20250714190050_add_missing_rpms_evr_index.rb
2163
2177
  - db/seeds.d/101-locations.rb
2164
2178
  - db/seeds.d/102-organizations.rb
2165
2179
  - db/seeds.d/104-proxy.rb
@@ -5548,7 +5562,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
5548
5562
  - !ruby/object:Gem::Version
5549
5563
  version: '0'
5550
5564
  requirements: []
5551
- rubygems_version: 3.5.22
5565
+ rubygems_version: 3.1.6
5552
5566
  signing_key:
5553
5567
  specification_version: 4
5554
5568
  summary: Content and Subscription Management plugin for Foreman