katello 4.8.2 → 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 (22) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +1 -1
  3. data/app/lib/actions/katello/agent_action.rb +4 -3
  4. data/app/lib/actions/katello/bulk_agent_action.rb +4 -1
  5. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +12 -5
  6. data/app/models/katello/candlepin/repository_mapper.rb +1 -0
  7. data/app/views/katello/api/v2/content_facet/base.json.rabl +9 -10
  8. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +1 -0
  9. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/katello-agent-notice.html +1 -1
  10. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +0 -2
  11. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +0 -1
  12. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +0 -1
  13. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +0 -2
  14. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  15. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
  16. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
  17. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  18. data/lib/katello/version.rb +1 -1
  19. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +4 -0
  20. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +4 -0
  21. data/webpack/components/extensions/HostDetails/common/KatelloAgentDeprecationAlert.js +23 -0
  22. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50dbc6ac50280ac62f64e850e0d16444abed94953b491ac51db4530e8e377edb
4
- data.tar.gz: e5d4e0fb485fcbdfd73d56c3f7e1d9952bdec57110447c683d55c2e81784a0f1
3
+ metadata.gz: 394c0b86328c832286333df0a23a4cdf78b828e1321d16182678a77dd263d919
4
+ data.tar.gz: a5df02b4fa3455885b598649b352f7ccb315cb958ca5346ef5f448544284ceb4
5
5
  SHA512:
6
- metadata.gz: 56f172e039b743a27fddb7af888d01bfd42699da833b1afddeea3ea5d44b96abf38870d1fcc95481c538725974ccf343bfef35230a51ba916352054d9f0f8eee
7
- data.tar.gz: 7ac8d7121b1d41d28417ed65904cb29444935f429c02d285766a8ada60c2f76d29f4015291045c583e4729c7ac5d9839a5d6bec50beaae06d09c7dcff2461ccc
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
 
@@ -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,
@@ -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
@@ -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
 
@@ -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
@@ -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.2".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;
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.2
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-06-21 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
@@ -4699,6 +4699,7 @@ files:
4699
4699
  - webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js
4700
4700
  - webpack/components/extensions/HostDetails/Tabs/__tests__/yumInstallablePackages.fixtures.json
4701
4701
  - webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js
4702
+ - webpack/components/extensions/HostDetails/common/KatelloAgentDeprecationAlert.js
4702
4703
  - webpack/components/extensions/HostDetails/hostDetailsHelpers.js
4703
4704
  - webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageConstants.js
4704
4705
  - webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageHelpers.js