katello 4.8.1 → 4.8.3

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +1 -1
  3. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +1 -1
  4. data/app/lib/actions/katello/agent_action.rb +4 -3
  5. data/app/lib/actions/katello/bulk_agent_action.rb +4 -1
  6. data/app/lib/actions/katello/host/update_content_view.rb +4 -2
  7. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +12 -5
  8. data/app/lib/katello/concerns/base_template_scope_extensions.rb +1 -1
  9. data/app/lib/katello/resources/cdn/katello_cdn.rb +8 -4
  10. data/app/lib/katello/util/content_overrides_migrator.rb +2 -2
  11. data/app/models/katello/candlepin/repository_mapper.rb +1 -0
  12. data/app/models/katello/concerns/host_managed_extensions.rb +33 -1
  13. data/app/models/katello/product_content.rb +35 -1
  14. data/app/services/katello/product_content_finder.rb +4 -0
  15. data/app/views/katello/api/v2/content_facet/base.json.rabl +9 -10
  16. data/app/views/katello/api/v2/repository_sets/show.json.rabl +2 -2
  17. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +1 -0
  18. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/katello-agent-notice.html +1 -1
  19. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +0 -2
  20. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +0 -1
  21. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +0 -1
  22. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +0 -2
  23. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  24. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
  25. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
  26. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  27. data/lib/katello/version.rb +1 -1
  28. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +4 -0
  29. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +4 -0
  30. data/webpack/components/extensions/HostDetails/common/KatelloAgentDeprecationAlert.js +23 -0
  31. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +1 -1
  32. metadata +7 -29
  33. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  34. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  35. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  36. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  37. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  38. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  39. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  40. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  41. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  42. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  43. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  44. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  45. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  46. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  47. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  48. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  49. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  50. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  51. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  52. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  53. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  54. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  55. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81c709207089041832e6dd1b447a01d0d40dc228480d4b4e43b536c853242662
4
- data.tar.gz: 94ec8c4161ff3f63d2a48d4be430b5942b7a40684c4bc39a6c734597ed9f39bf
3
+ metadata.gz: 394c0b86328c832286333df0a23a4cdf78b828e1321d16182678a77dd263d919
4
+ data.tar.gz: a5df02b4fa3455885b598649b352f7ccb315cb958ca5346ef5f448544284ceb4
5
5
  SHA512:
6
- metadata.gz: 1923b0ae05a6bb6c92b7b807793ce795e4ed90a26e598124a0441b49cb30270ec4829eb0ae0a95944de20bb4db5366b9219ac247667e194b8de88c6a7a933e82
7
- data.tar.gz: 062cd9f6c371824bbe22b4b686735eba4ac0ee5ebd316fe4e06fa74b942e58da6f891ef6c3d5ed92158e9d32878bfc533574419b63836d4f4078a3b85eca54bb
6
+ metadata.gz: 703fdc37bae22b0b452ae2a144e05f2c5654678e64c0a56291a45047caaf730b6bdcc9da3db0bd4b936322b4634e3f0f5be7a9e5e5c64f719d3dab8e3cab201f
7
+ data.tar.gz: '0914650d9e9c5b7664850fee333422206952ee5b469dbb3058612ddffd40f30d24b436f23b62cea07707ed9682250e3ab39c18a8dc17f0b028cf11984896f0e6'
@@ -81,7 +81,7 @@ module Katello
81
81
  def create
82
82
  rhsm_params = params_to_rhsm_params
83
83
 
84
- host = Katello::RegistrationManager.process_registration(rhsm_params, @content_view_environment)
84
+ host = Katello::RegistrationManager.process_registration(rhsm_params, [@content_view_environment])
85
85
  host.reload
86
86
  ::Katello::Host::SubscriptionFacet.update_facts(host, rhsm_params[:facts]) unless rhsm_params[:facts].blank?
87
87
 
@@ -6,7 +6,7 @@ module Katello
6
6
  before_action :set_up_content_view_environment, only: [:update]
7
7
 
8
8
  def set_up_content_view_environment
9
- return unless params[:host] && params[:host][:content_facet_attributes]
9
+ return unless @host&.content_facet.present? && params[:host]&.[](:content_facet_attributes)&.present?
10
10
  cv_id = params[:host][:content_facet_attributes].delete(:content_view_id)
11
11
  env_id = params[:host][:content_facet_attributes].delete(:lifecycle_environment_id)
12
12
  Rails.logger.info "set_up_content_view_environment: cv_id=#{cv_id}, env_id=#{env_id}"
@@ -14,8 +14,10 @@ module Actions
14
14
 
15
15
  def plan(host, options)
16
16
  action_subject(host, :hostname => host.name, :content => options[:content])
17
-
18
- dispatch_history_id = options.dig(:dispatch_histories, host.id.to_s) || ::Katello::Agent::Dispatcher.create_histories(
17
+ # options[:dispatch_histories] keys might be strings or integers
18
+ dispatch_history_id = options.dig(:dispatch_histories, host.id.to_s) ||
19
+ options.dig(:dispatch_histories, host.id.to_i) ||
20
+ ::Katello::Agent::Dispatcher.create_histories(
19
21
  host_ids: [host.id]
20
22
  ).first.id
21
23
 
@@ -44,7 +46,6 @@ module Actions
44
46
  history.dynflow_execution_plan_id = suspended_action.execution_plan_id
45
47
  history.dynflow_step_id = suspended_action.step_id
46
48
  history.save!
47
-
48
49
  dispatch_message(history) unless input[:bulk]
49
50
 
50
51
  schedule_timeout(timeout, optional: true)
@@ -21,7 +21,10 @@ module Actions
21
21
 
22
22
  def spawn_plans
23
23
  args = input[:args].first
24
- histories = ::Katello::Agent::DispatchHistory.where(id: args[:dispatch_histories].slice(*current_batch.map(&:to_s)).values)
24
+ # args[:dispatch_histories] keys are numeric host ids; they may be integer or string
25
+ # Hash#slice will return a filtered hash only with the specified keys, and ignore keys that don't exist
26
+ possible_keys = [*current_batch.map(&:to_i), *current_batch.map(&:to_s)]
27
+ histories = ::Katello::Agent::DispatchHistory.where(id: args[:dispatch_histories].slice(*possible_keys).values)
25
28
  ::Katello::Agent::Dispatcher.dispatch(
26
29
  args[:type].to_sym,
27
30
  histories,
@@ -4,8 +4,10 @@ module Actions
4
4
  class UpdateContentView < Actions::EntryAction
5
5
  def plan(host, content_view_id, lifecycle_environment_id)
6
6
  if host.content_facet
7
- host.content_facet.content_view = ::Katello::ContentView.find(content_view_id)
8
- host.content_facet.lifecycle_environment = ::Katello::KTEnvironment.find(lifecycle_environment_id)
7
+ host.content_facet.assign_single_environment(
8
+ content_view_id: content_view_id,
9
+ lifecycle_environment_id: lifecycle_environment_id
10
+ )
9
11
  host.update_candlepin_associations
10
12
  plan_self(:hostname => host.name)
11
13
  else
@@ -14,6 +14,8 @@ module Actions
14
14
  plan_self(source_repository_id: options[:source_repository].id, target_repository_id: repository.id, smart_proxy_id: smart_proxy.id)
15
15
  elsif publication_content_type && (force_publication || repository.publication_href.nil? || !repository.using_mirrored_metadata?)
16
16
  plan_action(Actions::Pulp3::Repository::CreatePublication, repository, smart_proxy, options)
17
+ elsif !publication_content_type
18
+ plan_self(target_repository_id: repository.id, contents_changed: options[:contents_changed], skip_publication: true)
17
19
  end
18
20
  plan_action(Actions::Pulp3::ContentGuard::Refresh, smart_proxy) unless repository.unprotected
19
21
  plan_action(Actions::Pulp3::Repository::RefreshDistribution, repository, smart_proxy, :contents_changed => options[:contents_changed]) if Setting[:distribute_archived_cvv] || repository.environment
@@ -21,13 +23,18 @@ module Actions
21
23
  end
22
24
 
23
25
  def run
24
- #we don't have to actually generate a publication, we can reuse the old one
25
26
  target_repo = ::Katello::Repository.find(input[:target_repository_id])
26
- source_repo = ::Katello::Repository.find(input[:source_repository_id])
27
- if (target_repo.publication_href != source_repo.publication_href && smart_proxy.pulp_primary?)
28
- target_repo.clear_smart_proxy_sync_histories
27
+ if input[:skip_publication]
28
+ #Need to clear smart proxy sync histories for non-publication content_types: docker, ansible collection
29
+ target_repo.clear_smart_proxy_sync_histories if input[:contents_changed]
30
+ else
31
+ #we don't have to actually generate a publication, we can reuse the old one
32
+ source_repo = ::Katello::Repository.find(input[:source_repository_id])
33
+ if (target_repo.publication_href != source_repo.publication_href && smart_proxy.pulp_primary?)
34
+ target_repo.clear_smart_proxy_sync_histories
35
+ end
36
+ target_repo.update!(publication_href: source_repo.publication_href)
29
37
  end
30
- target_repo.update!(publication_href: source_repo.publication_href)
31
38
  end
32
39
  end
33
40
  end
@@ -161,7 +161,7 @@ module Katello
161
161
  returns String, desc: 'Package version'
162
162
  end
163
163
  def host_latest_applicable_rpm_version(host, package)
164
- ::Katello::Rpm.latest(host.applicable_rpms.where(name: package)).first.nvra
164
+ ::Katello::Rpm.latest(host.applicable_rpms.where(name: package))&.first&.nvra
165
165
  end
166
166
 
167
167
  apipie :method, 'Loads Pool objects' do
@@ -11,10 +11,14 @@ module Katello
11
11
  super
12
12
  end
13
13
 
14
- def fetch_paths(content_path)
14
+ def fetch_repo_set(content_path)
15
15
  url = "/katello/api/v2/repository_sets?organization_id=#{organization['id']}&search=#{CGI.escape("path = #{content_path}")}"
16
16
  response = get(url)
17
- repo_set = JSON.parse(response)['results'].first
17
+ JSON.parse(response)['results'].first
18
+ end
19
+
20
+ def fetch_paths(content_path)
21
+ repo_set = fetch_repo_set(content_path)
18
22
 
19
23
  fail _("Upstream organization %s does not provide this content path") % @organization_label if repo_set.nil?
20
24
 
@@ -33,8 +37,8 @@ module Katello
33
37
  results = json_body['results']
34
38
 
35
39
  results.map do |repo|
36
- Katello::Content.substitute_content_path(arch: repo[:arch],
37
- releasever: repo[:minor],
40
+ Katello::Content.substitute_content_path(arch: repo['arch'],
41
+ releasever: repo['minor'],
38
42
  content_path: content_path)
39
43
  end
40
44
  end
@@ -12,11 +12,11 @@ module Katello
12
12
  ak_errors = create_disabled_overrides_for_non_sca_org_activation_keys(organization: @organization)
13
13
 
14
14
  total_errors = host_errors + ak_errors
15
- finish_message = "Finished creating overrides in non-SCA orgs; #{total_errors == 0 ? "no errors" : "#{pluralize(total_errors, "error")}"}"
15
+ finish_message = "Finished creating overrides in non-SCA org; #{total_errors == 0 ? "no errors" : "#{pluralize(total_errors, "error")}"}"
16
16
  messages = { result: finish_message, errors: total_errors }
17
17
  messages[:host_errors] = "Hosts - #{pluralize(host_errors, "error")} creating disabled overrides for unsubscribed content; see log messages above" if host_errors > 0
18
18
  messages[:ak_errors] = "Activation keys - #{pluralize(ak_errors, "error")} creating disabled overrides for unsubscribed content; see log messages above" if ak_errors > 0
19
- messages[:success_message] = "You may now switch all organizations to Simple Content Access mode without any change in access to content." if total_errors == 0
19
+ messages[:success_message] = "Organization may now be switched to Simple Content Access mode without any change in access to content." if total_errors == 0
20
20
  Rails.logger.info finish_message
21
21
  Rails.logger.info messages[:host_errors] if messages[:host_errors]
22
22
  Rails.logger.info messages[:ak_errors] if messages[:ak_errors]
@@ -56,6 +56,7 @@ module Katello
56
56
  end
57
57
 
58
58
  def substitutor
59
+ fail _("Manifest does not have a valid subscription") if product.cdn_resource.nil?
59
60
  product.cdn_resource.substitutor
60
61
  end
61
62
 
@@ -6,7 +6,7 @@ module Katello
6
6
  include ForemanTasks::Concerns::ActionSubject
7
7
 
8
8
  module Overrides
9
- def update(attrs)
9
+ def check_cve_attributes(attrs)
10
10
  if attrs[:content_facet_attributes]
11
11
  cv_id = attrs[:content_facet_attributes].delete(:content_view_id)
12
12
  lce_id = attrs[:content_facet_attributes].delete(:lifecycle_environment_id)
@@ -17,6 +17,16 @@ module Katello
17
17
  fail "content_view_id and lifecycle_environment_id must be provided together"
18
18
  end
19
19
  end
20
+ end
21
+
22
+ def attributes=(attrs)
23
+ check_cve_attributes(attrs)
24
+ super
25
+ end
26
+
27
+ def update(attrs)
28
+ return super if self.content_facet.blank?
29
+ check_cve_attributes(attrs)
20
30
  super
21
31
  end
22
32
 
@@ -30,6 +40,28 @@ module Katello
30
40
  inherited_attrs
31
41
  end
32
42
 
43
+ def apply_inherited_attributes(attributes, initialized = true)
44
+ attributes = super(attributes, initialized)
45
+ facet_attrs = attributes['content_facet_attributes']
46
+ return attributes if facet_attrs.blank?
47
+ cv_id = facet_attrs['content_view_id']
48
+ lce_id = facet_attrs['lifecycle_environment_id']
49
+ if initialized && (cv_id.blank? || lce_id.blank?)
50
+ if cv_id.blank?
51
+ Rails.logger.info "Hostgroup has no content view assigned; using host's existing content view"
52
+ facet_attrs['content_view_id'] = content_facet&.single_content_view&.id
53
+ end
54
+ if lce_id.blank?
55
+ Rails.logger.info "Hostgroup has no lifecycle environment assigned; using host's existing lifecycle environment"
56
+ facet_attrs['lifecycle_environment_id'] = content_facet&.single_lifecycle_environment&.id
57
+ end
58
+ attributes['content_facet_attributes'] = facet_attrs
59
+ else
60
+ Rails.logger.info "Hostgroup has content view and lifecycle environment assigned; using those"
61
+ end
62
+ attributes
63
+ end
64
+
33
65
  def smart_proxy_ids
34
66
  ids = super
35
67
  ids << content_source_id
@@ -15,6 +15,10 @@ module Katello
15
15
  where(:product_id => Product.redhat.select(:id))
16
16
  }
17
17
 
18
+ scope :custom, -> {
19
+ where.not(:product_id => Product.redhat.select(:id))
20
+ }
21
+
18
22
  scoped_search :on => :name, :relation => :content
19
23
  scoped_search :relation => :product, :on => :name, :rename => :product
20
24
  scoped_search :on => :content_type, :relation => :content, :complete_value => true
@@ -37,9 +41,39 @@ module Katello
37
41
  where(:product_id => Katello::PoolProduct.where(:pool_id => organization.pools).select(:product_id))
38
42
  end
39
43
 
40
- # used by Katello::Api::V2::RepositorySetsController#index
44
+ # following 4 methods used by Katello::Api::V2::RepositorySetsController#index
41
45
  def repositories
42
46
  Katello::Repository.in_default_view.where(:root_id => product.root_repositories.has_url.where(:content_id => content.cp_content_id))
43
47
  end
48
+
49
+ def unfiltered_repositories
50
+ # don't filter by url, as we want to show all repos in the product
51
+ Katello::Repository.in_default_view.where(:root_id => product.root_repositories.where(:content_id => content.cp_content_id))
52
+ end
53
+
54
+ def arch
55
+ unfiltered_repositories.first&.arch
56
+ end
57
+
58
+ def os_versions
59
+ unfiltered_repositories.first&.os_versions || []
60
+ end
61
+
62
+ def enabled_value_from_candlepin
63
+ cp_product = ::Katello::Resources::Candlepin::Product.get(product.organization.label, product.cp_id).first
64
+ cp_content = cp_product['productContent'].find { |pc| pc['content']['id'] == content.cp_content_id }
65
+ cp_content['enabled']
66
+ end
67
+
68
+ def set_enabled_from_candlepin!
69
+ new_value = enabled_value_from_candlepin
70
+ if self.enabled != new_value
71
+ Rails.logger.info "Setting enabled to #{new_value} for Candlepin content #{content.cp_content_id}, ProductContent #{self.id}"
72
+ self.update!(:enabled => new_value)
73
+ else
74
+ Rails.logger.info "No change in enabled value for Candlepin content #{content.cp_content_id}, ProductContent #{self.id}"
75
+ false
76
+ end
77
+ end
44
78
  end
45
79
  end
@@ -33,6 +33,10 @@ module Katello
33
33
  consumable.organization.enabled_product_content_for(roots)
34
34
  end
35
35
 
36
+ def custom_content_labels
37
+ product_content.custom.map { |pc| pc.product.root_repositories.map(&:custom_content_label) }.flatten.uniq
38
+ end
39
+
36
40
  def self.wrap_with_overrides(product_contents:, overrides:, status: nil)
37
41
  pc_with_overrides = product_contents.map { |pc| ProductContentPresenter.new(pc, overrides) }
38
42
  if status
@@ -1,6 +1,4 @@
1
1
  attributes :id, :uuid
2
- attributes :content_view_id, :content_view_name
3
- attributes :lifecycle_environment_id, :lifecycle_environment_name
4
2
  attributes :content_source_id, :content_source_name
5
3
  attributes :kickstart_repository_id, :kickstart_repository_name
6
4
  attributes :errata_counts
@@ -10,6 +8,15 @@ attributes :applicable_rpm_count => :applicable_package_count
10
8
  attributes :upgradable_rpm_count => :upgradable_package_count
11
9
  attributes :applicable_module_stream_count, :upgradable_module_stream_count
12
10
 
11
+ child :content_view_environments => :content_view_environments do
12
+ node :content_view do |cve|
13
+ { id: cve.content_view.id, name: cve.content_view.name, composite: cve.content_view.composite }
14
+ end
15
+ node :lifecycle_environment do |cve|
16
+ { id: cve.lifecycle_environment.id, name: cve.lifecycle_environment.name }
17
+ end
18
+ end
19
+
13
20
  node :content_view do |content_facet|
14
21
  content_view = content_facet.single_content_view
15
22
  if content_view.present?
@@ -31,14 +38,6 @@ node :lifecycle_environment do |content_facet|
31
38
  end
32
39
  end
33
40
 
34
- child :content_views => :content_views do
35
- attributes :id, :name, :composite
36
- end
37
-
38
- child :lifecycle_environments => :lifecycle_environments do
39
- attributes :id, :name
40
- end
41
-
42
41
  child :content_source => :content_source do
43
42
  attributes :id, :name, :url
44
43
  end
@@ -38,11 +38,11 @@ child @resource.repositories => :repositories do
38
38
  end
39
39
 
40
40
  node :archRestricted do |pc|
41
- pc.repositories&.first&.arch
41
+ pc.arch
42
42
  end
43
43
 
44
44
  node :osRestricted do |pc|
45
- pc.repositories&.first&.os_versions&.first
45
+ pc.os_versions&.first
46
46
  end
47
47
 
48
48
  node :override do |pc|
@@ -6,6 +6,7 @@ class RemoveDrpmFromIgnorableContent < ActiveRecord::Migration[6.0]
6
6
  else
7
7
  root.ignorable_content = []
8
8
  end
9
+ root.checksum_type = nil if root.download_policy == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
9
10
  root.save!
10
11
  end
11
12
  end
@@ -1,7 +1,7 @@
1
1
  <section>
2
2
  <p bst-alert="warning" >
3
3
  <span translate>
4
- Katello-agent is deprecated and will be removed in a future release.
4
+ Katello-agent is deprecated and will be removed in Katello 4.10.
5
5
  </span>
6
6
  </p>
7
7
  </section>
@@ -5,8 +5,6 @@
5
5
  <h3 translate ng-show="selectedErrataOption === 'current'">Installable Errata</h3>
6
6
  </div>
7
7
 
8
- <div ng-show="katelloAgentPresent" data-extend-template="common/views/katello-agent-notice.html"></div>
9
-
10
8
  <div ng-hide="host.hasContent()">
11
9
  <div data-extend-template="common/views/registration.html"></div>
12
10
  </div>
@@ -2,7 +2,6 @@
2
2
 
3
3
  <section ng-hide="denied('edit_hosts', host)" bst-feature-flag="remote_actions">
4
4
  <h4 translate>Package Actions</h4>
5
- <div ng-show="katelloAgentPresent" data-extend-template="common/views/katello-agent-notice.html"></div>
6
5
  <p bst-alert="warning" ng-hide="hostToolingEnabled">
7
6
  <span translate>
8
7
  Performing host package actions is disabled because Katello is not configured for Remote Execution or Katello Agent.
@@ -1,7 +1,6 @@
1
1
  <span page-title ng-model="host">{{ 'Packages for: ' | translate }} {{ host.name }}</span>
2
2
 
3
3
  <h3 translate>Applicable Packages</h3>
4
- <div ng-show="katelloAgentPresent" data-extend-template="common/views/katello-agent-notice.html"></div>
5
4
 
6
5
  <section ng-hide="denied('edit_hosts', host)" bst-feature-flag="remote_actions">
7
6
  <p bst-alert="warning" ng-hide="hostToolingEnabled">
@@ -2,8 +2,6 @@
2
2
 
3
3
  <h3 translate>Installed Packages</h3>
4
4
 
5
- <div ng-show="katelloAgentPresent" data-extend-template="common/views/katello-agent-notice.html"></div>
6
-
7
5
  <section ng-hide="denied('edit_hosts', host)" bst-feature-flag="remote_actions">
8
6
  <p bst-alert="warning" ng-hide="hostToolingEnabled">
9
7
  <span translate>
@@ -15,6 +15,7 @@
15
15
  * @requires ContentHostsHelper
16
16
  * @requires simpleContentAccessEnabled
17
17
  * @requires newHostDetailsUI
18
+ * @requires BastionConfig
18
19
  *
19
20
  * @description
20
21
  * Provides the functionality specific to Content Hosts for use with the Nutupane UI pattern.
@@ -22,8 +23,8 @@
22
23
  * within the table.
23
24
  */
24
25
  angular.module('Bastion.content-hosts').controller('ContentHostsController',
25
- ['$scope', '$q', '$state', '$location', '$uibModal', 'translate', 'Nutupane', 'Host', 'HostBulkAction', 'Notification', 'CurrentOrganization', 'ContentHostsHelper', 'ContentHostsModalHelper', '$httpParamSerializer', 'simpleContentAccessEnabled', 'newHostDetailsUI',
26
- function ($scope, $q, $state, $location, $uibModal, translate, Nutupane, Host, HostBulkAction, Notification, CurrentOrganization, ContentHostsHelper, ContentHostsModalHelper, $httpParamSerializer, simpleContentAccessEnabled, newHostDetailsUI) {
26
+ ['$scope', '$q', '$state', '$location', '$uibModal', 'translate', 'Nutupane', 'Host', 'HostBulkAction', 'Notification', 'CurrentOrganization', 'ContentHostsHelper', 'ContentHostsModalHelper', '$httpParamSerializer', 'simpleContentAccessEnabled', 'newHostDetailsUI', 'BastionConfig',
27
+ function ($scope, $q, $state, $location, $uibModal, translate, Nutupane, Host, HostBulkAction, Notification, CurrentOrganization, ContentHostsHelper, ContentHostsModalHelper, $httpParamSerializer, simpleContentAccessEnabled, newHostDetailsUI, BastionConfig) {
27
28
  var nutupane, params, query;
28
29
 
29
30
  if ($location.search().search) {
@@ -51,6 +52,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsController',
51
52
  $scope.nutupane = nutupane;
52
53
  $scope.simpleContentAccessEnabled = simpleContentAccessEnabled;
53
54
  $scope.newHostDetailsUI = newHostDetailsUI;
55
+ $scope.katelloAgentPresent = BastionConfig.katelloAgentPresent;
54
56
 
55
57
  // @TODO begin hack necessary because of foreman API bug http://projects.theforeman.org/issues/13877
56
58
  $scope.table.sortBy = function (column) {
@@ -14,13 +14,14 @@
14
14
  * @requires deleteHostOnUnregister
15
15
  * @requires ContentHostsHelper
16
16
  * @requires simpleContentAccessEnabled
17
+ * @requires BastionConfig
17
18
  *
18
19
  * @description
19
20
  * Provides the functionality for the content host details action pane.
20
21
  */
21
22
  angular.module('Bastion.content-hosts').controller('ContentHostDetailsController',
22
- ['$scope', '$state', '$q', '$location', 'translate', 'Host', 'HostSubscription', 'Organization', 'CurrentOrganization', 'Notification', 'MenuExpander', 'ApiErrorHandler', 'deleteHostOnUnregister', 'ContentHostsHelper', 'simpleContentAccessEnabled',
23
- function ($scope, $state, $q, $location, translate, Host, HostSubscription, Organization, CurrentOrganization, Notification, MenuExpander, ApiErrorHandler, deleteHostOnUnregister, ContentHostsHelper, simpleContentAccessEnabled) {
23
+ ['$scope', '$state', '$q', '$location', 'translate', 'Host', 'HostSubscription', 'Organization', 'CurrentOrganization', 'Notification', 'MenuExpander', 'ApiErrorHandler', 'deleteHostOnUnregister', 'ContentHostsHelper', 'simpleContentAccessEnabled', 'BastionConfig',
24
+ function ($scope, $state, $q, $location, translate, Host, HostSubscription, Organization, CurrentOrganization, Notification, MenuExpander, ApiErrorHandler, deleteHostOnUnregister, ContentHostsHelper, simpleContentAccessEnabled, BastionConfig) {
24
25
  $scope.menuExpander = MenuExpander;
25
26
 
26
27
  $scope.getHostStatusIcon = ContentHostsHelper.getHostStatusIcon;
@@ -36,6 +37,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsController
36
37
 
37
38
  $scope.purposeAddonsCount = 0;
38
39
  $scope.simpleContentAccessEnabled = simpleContentAccessEnabled;
40
+ $scope.katelloAgentPresent = BastionConfig.katelloAgentPresent;
39
41
 
40
42
  $scope.panel = {
41
43
  error: false,
@@ -54,6 +54,7 @@
54
54
 
55
55
  <nav data-block="navigation">
56
56
  <div content-access-mode-banner></div>
57
+ <div ng-show="katelloAgentPresent" data-extend-template="common/views/katello-agent-notice.html"></div>
57
58
  <ul class="nav nav-tabs">
58
59
  <li ng-class="{active: isState('content-host.info')}">
59
60
  <a translate
@@ -66,6 +66,10 @@
66
66
  </span>
67
67
  </div>
68
68
 
69
+ <span data-block="messages">
70
+ <div ng-show="katelloAgentPresent" data-extend-template="common/views/katello-agent-notice.html"></div>
71
+ </span>
72
+
69
73
  <span data-block="no-rows-message" translate>
70
74
  You currently don't have any Content Hosts, you can register one by clicking the button on the right and following the instructions.
71
75
  </span>
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.8.1".freeze
2
+ VERSION = "4.8.3".freeze
3
3
  end
@@ -44,6 +44,7 @@ import { defaultRemoteActionMethod,
44
44
  import SortableColumnHeaders from '../../../../Table/components/SortableColumnHeaders';
45
45
  import { useRexJobPolling } from '../RemoteExecutionHooks';
46
46
  import { errataStatusContemplation, friendlyErrataStatus } from '../../../../Errata/errataHelpers';
47
+ import KatelloAgentDeprecationAlert from '../../common/KatelloAgentDeprecationAlert';
47
48
 
48
49
  const recalculateApplicability = ['edit_hosts'];
49
50
  const invokeRexJobs = ['create_job_invocations'];
@@ -465,6 +466,9 @@ export const ErrataTab = () => {
465
466
  return (
466
467
  <div>
467
468
  <div id="errata-tab">
469
+ {defaultRemoteAction === KATELLO_AGENT && (
470
+ <KatelloAgentDeprecationAlert />
471
+ )}
468
472
  <TableWrapper
469
473
  {...{
470
474
  metadata,
@@ -48,6 +48,7 @@ import { defaultRemoteActionMethod,
48
48
  userPermissionsFromHostDetails } from '../../hostDetailsHelpers';
49
49
  import SortableColumnHeaders from '../../../../Table/components/SortableColumnHeaders';
50
50
  import { useRexJobPolling } from '../RemoteExecutionHooks';
51
+ import KatelloAgentDeprecationAlert from '../../common/KatelloAgentDeprecationAlert';
51
52
 
52
53
  const invokeRexJobs = ['create_job_invocations'];
53
54
  const doKatelloAgentActions = ['edit_hosts'];
@@ -491,6 +492,9 @@ export const PackagesTab = () => {
491
492
  return (
492
493
  <div>
493
494
  <div id="packages-tab">
495
+ {showKatelloAgent && (
496
+ <KatelloAgentDeprecationAlert />
497
+ )}
494
498
  <TableWrapper
495
499
  {...{
496
500
  metadata,
@@ -0,0 +1,23 @@
1
+ import React, { useState } from 'react';
2
+ import {
3
+ Alert,
4
+ AlertActionCloseButton,
5
+ } from '@patternfly/react-core';
6
+ import { translate as __ } from 'foremanReact/common/I18n';
7
+
8
+ const KatelloAgentDeprecationAlert = () => {
9
+ const [kAgentAlertShowing, setKAgentAlertShowing] = useState(true);
10
+
11
+ return kAgentAlertShowing ? (
12
+ <Alert
13
+ variant="warning"
14
+ className="katello-agent-deprecation-alert"
15
+ ouiaId="katello-agent-deprecation-alert"
16
+ isInline
17
+ title={__('Katello-agent is deprecated and will be removed in Katello 4.10.')}
18
+ actionClose={<AlertActionCloseButton ouiaId="katello-agent-alert-close-button" onClose={() => setKAgentAlertShowing(false)} />}
19
+ />
20
+ ) : null;
21
+ };
22
+
23
+ export default KatelloAgentDeprecationAlert;
@@ -137,7 +137,7 @@ export default ({
137
137
  selectRPMPackagesComparison(state, versionOneId, versionTwoId, viewBy),
138
138
  statusSelector: state =>
139
139
  selectRPMPackagesComparisonStatus(state, versionOneId, versionTwoId, viewBy),
140
- autocompleteEndpoint: 'katello/api/v2/packages',
140
+ autocompleteEndpoint: '/katello/api/v2/packages',
141
141
  bookmarkController: 'katello_content_view_components',
142
142
  fetchItems: params => getRPMPackagesComparison(
143
143
  versionOneId,
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.8.1
4
+ version: 4.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-25 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -412,16 +412,16 @@ dependencies:
412
412
  name: pulp_ostree_client
413
413
  requirement: !ruby/object:Gem::Requirement
414
414
  requirements:
415
- - - ">="
415
+ - - '='
416
416
  - !ruby/object:Gem::Version
417
- version: '0'
417
+ version: 2.0.0
418
418
  type: :runtime
419
419
  prerelease: false
420
420
  version_requirements: !ruby/object:Gem::Requirement
421
421
  requirements:
422
- - - ">="
422
+ - - '='
423
423
  - !ruby/object:Gem::Version
424
- version: '0'
424
+ version: 2.0.0
425
425
  - !ruby/object:Gem::Dependency
426
426
  name: deface
427
427
  requirement: !ruby/object:Gem::Requirement
@@ -4434,53 +4434,30 @@ files:
4434
4434
  - locale/Makefile
4435
4435
  - locale/README
4436
4436
  - locale/action_names.rb
4437
- - locale/bn/LC_MESSAGES/katello.mo
4438
4437
  - locale/bn/katello.po
4439
- - locale/cs/LC_MESSAGES/katello.mo
4440
4438
  - locale/cs/katello.po
4441
- - locale/de/LC_MESSAGES/katello.mo
4442
4439
  - locale/de/katello.po
4443
- - locale/en/LC_MESSAGES/katello.mo
4444
4440
  - locale/en/katello.po
4445
- - locale/es/LC_MESSAGES/katello.mo
4446
4441
  - locale/es/katello.po
4447
- - locale/fr/LC_MESSAGES/katello.mo
4448
4442
  - locale/fr/katello.po
4449
- - locale/gu/LC_MESSAGES/katello.mo
4450
4443
  - locale/gu/katello.po
4451
- - locale/hi/LC_MESSAGES/katello.mo
4452
4444
  - locale/hi/katello.po
4453
- - locale/it/LC_MESSAGES/katello.mo
4454
4445
  - locale/it/katello.po
4455
- - locale/ja/LC_MESSAGES/katello.mo
4456
4446
  - locale/ja/katello.po
4457
- - locale/ka/LC_MESSAGES/katello.mo
4458
4447
  - locale/ka/katello.po
4459
4448
  - locale/katello.pot
4460
- - locale/kn/LC_MESSAGES/katello.mo
4461
4449
  - locale/kn/katello.po
4462
- - locale/ko/LC_MESSAGES/katello.mo
4463
4450
  - locale/ko/katello.po
4464
- - locale/mr/LC_MESSAGES/katello.mo
4465
4451
  - locale/mr/katello.po
4466
- - locale/or/LC_MESSAGES/katello.mo
4467
4452
  - locale/or/katello.po
4468
- - locale/pa/LC_MESSAGES/katello.mo
4469
4453
  - locale/pa/katello.po
4470
- - locale/pt/LC_MESSAGES/katello.mo
4471
4454
  - locale/pt/katello.po
4472
- - locale/pt_BR/LC_MESSAGES/katello.mo
4473
4455
  - locale/pt_BR/katello.po
4474
- - locale/ru/LC_MESSAGES/katello.mo
4475
4456
  - locale/ru/katello.po
4476
- - locale/ta/LC_MESSAGES/katello.mo
4477
4457
  - locale/ta/katello.po
4478
- - locale/te/LC_MESSAGES/katello.mo
4479
4458
  - locale/te/katello.po
4480
4459
  - locale/update-i18n
4481
- - locale/zh_CN/LC_MESSAGES/katello.mo
4482
4460
  - locale/zh_CN/katello.po
4483
- - locale/zh_TW/LC_MESSAGES/katello.mo
4484
4461
  - locale/zh_TW/katello.po
4485
4462
  - package.json
4486
4463
  - vendor/assets/images/katello/add2.png
@@ -4722,6 +4699,7 @@ files:
4722
4699
  - webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js
4723
4700
  - webpack/components/extensions/HostDetails/Tabs/__tests__/yumInstallablePackages.fixtures.json
4724
4701
  - webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js
4702
+ - webpack/components/extensions/HostDetails/common/KatelloAgentDeprecationAlert.js
4725
4703
  - webpack/components/extensions/HostDetails/hostDetailsHelpers.js
4726
4704
  - webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageConstants.js
4727
4705
  - webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageHelpers.js
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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file