katello 3.9.0 → 3.9.1
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/lib/actions/katello/repository/clone_to_version.rb +25 -15
- data/app/models/katello/repository.rb +1 -1
- data/app/models/katello/sync_plan.rb +3 -2
- data/app/views/katello/api/v2/host_collections/create.json.rabl +1 -1
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +1 -0
- data/db/migrate/20180814202747_add_recurring_logic_to_sync_plan.rb +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-publish.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/new-sync-plan-modal.controller.js +9 -5
- data/lib/katello/tasks/upgrades/3.9/migrate_sync_plans.rake +2 -0
- data/lib/katello/version.rb +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +2 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +8 -4
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +2 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +2 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/EntitlementsInlineEditFormatter.test.js +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e80194e98966a9f7d9942fdd36fb5996718cca
|
4
|
+
data.tar.gz: 6daa564d8872d33964d3cda0c1f6f9268b603aa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e6df8ffbe7dd816c21f438efe12b4a6973b2d2be4e37da959799ea7285ad7b38f49dff638432f2075c82b02185c3f69e473b66ac3d1a2f250fc57e3f3f923cf
|
7
|
+
data.tar.gz: 1f2b5d16fac33a4b81da05bd320bfcd68eed769d28b79c41adf273ffebe5533f68ff560b8112743873fd5234dd7c86bba6d6e9ff883c70d73c5f5a03ef5429b2
|
@@ -23,21 +23,31 @@ module Actions
|
|
23
23
|
plan_action(Repository::CloneYumMetadata, repositories[0], new_repository,
|
24
24
|
:force_yum_metadata_regeneration => true)
|
25
25
|
else
|
26
|
-
repositories
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
26
|
+
clone_repository_content(repositories, new_repository, filters, incremental, rpm_filenames)
|
27
|
+
end
|
28
|
+
|
29
|
+
plan_action(Katello::Repository::MetadataGenerate, new_repository) if repositories.length > 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def clone_repository_content(repositories, new_repository, filters, incremental, rpm_filenames)
|
34
|
+
repositories.each do |repository|
|
35
|
+
if new_repository.yum?
|
36
|
+
# If there is more than one repository passed here, that means that there are duplicate repos in a composite content view.
|
37
|
+
# We skip generating metadata in this case and generate it later to prevent conflicting data, such as filters.
|
38
|
+
skip_metadata = incremental || repositories.length > 1
|
39
|
+
plan_action(Repository::CloneYumContent, repository, new_repository, filters, :purge_empty_units => !incremental,
|
40
|
+
:generate_metadata => !skip_metadata, :index_content => !incremental,
|
41
|
+
:simple_clone => incremental, :rpm_filenames => rpm_filenames)
|
42
|
+
elsif new_repository.deb?
|
43
|
+
plan_action(Repository::CloneDebContent, repository, new_repository, filters, !incremental,
|
44
|
+
:generate_metadata => !incremental, :index_content => !incremental, :simple_clone => incremental)
|
45
|
+
elsif new_repository.docker?
|
46
|
+
plan_action(Repository::CloneDockerContent, repository, new_repository, filters)
|
47
|
+
elsif new_repository.ostree?
|
48
|
+
plan_action(Repository::CloneOstreeContent, repository, new_repository)
|
49
|
+
elsif new_repository.file?
|
50
|
+
plan_action(Repository::CloneFileContent, repository, new_repository)
|
41
51
|
end
|
42
52
|
end
|
43
53
|
end
|
@@ -661,7 +661,7 @@ module Katello
|
|
661
661
|
end
|
662
662
|
|
663
663
|
def self.safe_render_container_name(repository, pattern = nil)
|
664
|
-
if pattern || (repository.environment && !repository.environment.registry_name_pattern.empty?)
|
664
|
+
if (pattern && !pattern.blank?) || (repository.environment && !repository.environment.registry_name_pattern.empty?)
|
665
665
|
pattern ||= repository.environment.registry_name_pattern
|
666
666
|
allowed_methods = {}
|
667
667
|
allowed_vars = {}
|
@@ -46,6 +46,7 @@ module Katello
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def save_with_logic!
|
49
|
+
self.cron_expression = '' if (self.cron_expression && !(self.interval.eql? CUSTOM_CRON))
|
49
50
|
associate_recurring_logic
|
50
51
|
self.save!
|
51
52
|
start_recurring_logic
|
@@ -117,8 +118,8 @@ module Katello
|
|
117
118
|
end
|
118
119
|
|
119
120
|
def next_sync_date
|
120
|
-
return nil unless
|
121
|
-
self.foreman_tasks_recurring_logic
|
121
|
+
return nil unless self.enabled
|
122
|
+
self.foreman_tasks_recurring_logic&.tasks&.order(:start_at)&.last&.start_at
|
122
123
|
end
|
123
124
|
|
124
125
|
def next_sync
|
@@ -17,6 +17,7 @@ attributes :unmapped_guest
|
|
17
17
|
attributes :virt_only
|
18
18
|
attributes :virt_who
|
19
19
|
attributes :upstream? => :upstream
|
20
|
+
attributes :upstream_pool_id
|
20
21
|
|
21
22
|
node :hypervisor, :if => lambda { |sub| sub && sub.respond_to?(:hypervisor) && sub.hypervisor } do |subscription|
|
22
23
|
{
|
@@ -3,11 +3,5 @@ class AddRecurringLogicToSyncPlan < ActiveRecord::Migration[5.1]
|
|
3
3
|
add_column :katello_sync_plans, :foreman_tasks_recurring_logic_id, :integer
|
4
4
|
add_column :katello_sync_plans, :cron_expression, :string
|
5
5
|
add_foreign_key :katello_sync_plans, :foreman_tasks_recurring_logics, :name => "katello_sync_plan_foreman_tasks_recurring_logic_fk", :column => "foreman_tasks_recurring_logic_id"
|
6
|
-
Katello::SyncPlan.find_each do |sync_plan|
|
7
|
-
User.as_anonymous_admin do
|
8
|
-
sync_plan.associate_recurring_logic
|
9
|
-
sync_plan.save!
|
10
|
-
end
|
11
|
-
end
|
12
6
|
end
|
13
7
|
end
|
@@ -14,7 +14,9 @@
|
|
14
14
|
<div class="row">
|
15
15
|
<div class="col-sm-5">
|
16
16
|
<div bst-alert="info" ng-show="contentView.duplicate_repositories_to_publish.length > 0">
|
17
|
-
|
17
|
+
<p translate>
|
18
|
+
You have selected more than one component Content View Version with the same repository resulting in slower publishing:
|
19
|
+
</p>
|
18
20
|
<ul>
|
19
21
|
<li ng-repeat="repository in contentView.duplicate_repositories_to_publish">
|
20
22
|
{{ repository.name }}
|
@@ -23,6 +25,10 @@
|
|
23
25
|
</ul>
|
24
26
|
</li>
|
25
27
|
</ul>
|
28
|
+
<p translate>
|
29
|
+
For the duplicate repositories, the packages in each Content View Version will combine regardless of the filters that
|
30
|
+
were applied to the individual Content View Version.
|
31
|
+
</p>
|
26
32
|
</div>
|
27
33
|
|
28
34
|
<form name="versionForm" role="form" novalidate>
|
@@ -11,36 +11,40 @@
|
|
11
11
|
* A controller for creating a new sync plan in a modal.
|
12
12
|
*/
|
13
13
|
angular.module('Bastion.products').controller('NewSyncPlanModalController',
|
14
|
-
['$scope', '$uibModalInstance', 'SyncPlan', 'SyncPlanHelper',
|
15
|
-
function ($scope, $uibModalInstance, SyncPlan, SyncPlanHelper) {
|
14
|
+
['$scope', '$uibModalInstance', 'SyncPlan', 'SyncPlanHelper', 'Notification', 'translate',
|
15
|
+
function ($scope, $uibModalInstance, SyncPlan, SyncPlanHelper, Notification, translate) {
|
16
16
|
function success(syncPlan) {
|
17
|
+
Notification.setSuccessMessage(translate("Sync Plan saved"));
|
18
|
+
$scope.isWorking = false;
|
17
19
|
$uibModalInstance.close(syncPlan);
|
18
20
|
}
|
19
21
|
|
20
22
|
function error(response) {
|
21
23
|
var form = SyncPlanHelper.getForm();
|
22
|
-
|
24
|
+
$scope.isWorking = false;
|
23
25
|
angular.forEach(response.data.errors, function (errors, field) {
|
24
26
|
if (form[field]) {
|
25
27
|
form[field].$setValidity('server', false);
|
26
28
|
form[field].$error.messages = errors;
|
27
29
|
} else {
|
28
|
-
Notification.setErrorMessage("Error saving the Sync Plan: " + " " + errors);
|
30
|
+
Notification.setErrorMessage(translate("Error saving the Sync Plan: " + " " + errors));
|
29
31
|
}
|
30
32
|
});
|
31
33
|
}
|
32
34
|
|
33
35
|
$scope.ok = function (syncPlan) {
|
36
|
+
$scope.isWorking = true;
|
34
37
|
SyncPlanHelper.createSyncPlan(syncPlan, success, error);
|
35
38
|
};
|
36
39
|
|
37
40
|
$scope.cancel = function () {
|
41
|
+
$scope.isWorking = true;
|
38
42
|
$uibModalInstance.dismiss('cancel');
|
39
43
|
};
|
40
44
|
|
41
45
|
$scope.isFormDisabled = function () {
|
42
46
|
var form = SyncPlanHelper.getForm();
|
43
|
-
return form &&
|
47
|
+
return form && $scope.isWorking;
|
44
48
|
};
|
45
49
|
|
46
50
|
$scope.intervals = SyncPlanHelper.getIntervals();
|
@@ -7,6 +7,8 @@ namespace :katello do
|
|
7
7
|
puts "Starting recurring logic for migrated sync plans and deleting Pulp schedules"
|
8
8
|
|
9
9
|
Katello::SyncPlan.find_each do |sync_plan|
|
10
|
+
sync_plan.associate_recurring_logic
|
11
|
+
sync_plan.save!
|
10
12
|
if sync_plan.foreman_tasks_recurring_logic.state.nil?
|
11
13
|
sync_plan.start_recurring_logic
|
12
14
|
sync_plan.foreman_tasks_recurring_logic.enabled = false unless sync_plan.enabled
|
data/lib/katello/version.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
// eslint-disable-next-line import/prefer-default-export
|
2
2
|
export const filterRHSubscriptions = subscriptions =>
|
3
|
-
subscriptions.filter(sub =>
|
3
|
+
subscriptions.filter(sub =>
|
4
|
+
sub.available >= 0 && sub.upstream_pool_id);
|
4
5
|
|
5
6
|
export const manifestExists = organization =>
|
6
7
|
organization.owner_details && organization.owner_details.upstreamConsumer;
|
@@ -51,21 +51,25 @@ describe('recordsValid', () => {
|
|
51
51
|
expect(recordsValid([])).toBe(true);
|
52
52
|
});
|
53
53
|
|
54
|
+
/* eslint-disable object-curly-newline */
|
54
55
|
it('accepts valid array', () => {
|
55
56
|
const rows = [
|
56
|
-
{ quantity: 10, available: 10, availableQuantity: 100 },
|
57
|
+
{ quantity: 10, available: 10, availableQuantity: 100, upstream_pool_id: ' ' },
|
57
58
|
{ quantity: 10, available: 10, availableQuantity: -1 },
|
58
59
|
{ quantity: -1, available: -1 },
|
59
|
-
{ quantity: 10, available: 10 },
|
60
|
+
{ quantity: 10, available: 10, upstream_pool_id: ' ' },
|
60
61
|
];
|
61
62
|
expect(recordsValid(rows)).toBe(true);
|
62
63
|
});
|
64
|
+
/* eslint-enable object-curly-newline */
|
63
65
|
|
64
66
|
it('detects invalid record', () => {
|
67
|
+
/* eslint-disable object-curly-newline */
|
65
68
|
const rows = [
|
66
|
-
{ quantity: 10, available: 10, availableQuantity: 100 },
|
67
|
-
{ quantity: 10, available: 10, availableQuantity: 5 },
|
69
|
+
{ quantity: 10, available: 10, availableQuantity: 100, upstream_pool_id: ' ' },
|
70
|
+
{ quantity: 10, available: 10, availableQuantity: 5, upstream_pool_id: ' ' },
|
68
71
|
];
|
72
|
+
/* eslint-enable object-curly-newline */
|
69
73
|
expect(recordsValid(rows)).toBe(false);
|
70
74
|
});
|
71
75
|
});
|
data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js
CHANGED
@@ -10,9 +10,9 @@ export const entitlementsInlineEditFormatter =
|
|
10
10
|
inlineEditController.isEditing(additionalData),
|
11
11
|
renderValue: (value, additionalData) => {
|
12
12
|
const { rowData } = additionalData;
|
13
|
-
if (rowData.available < 0) {
|
13
|
+
if (rowData.available < 0 || !rowData.upstream_pool_id) {
|
14
14
|
return (
|
15
|
-
<td>{__('Unlimited')}</td>
|
15
|
+
<td>{rowData.available < 0 ? __('Unlimited') : rowData.available}</td>
|
16
16
|
);
|
17
17
|
}
|
18
18
|
return (
|
@@ -151,7 +151,8 @@ class SubscriptionsTable extends Component {
|
|
151
151
|
};
|
152
152
|
|
153
153
|
const inlineEditController = {
|
154
|
-
isEditing: ({ rowData }) =>
|
154
|
+
isEditing: ({ rowData }) =>
|
155
|
+
(this.state.editing && rowData.available >= 0 && rowData.upstream_pool_id),
|
155
156
|
hasChanged: ({ rowData }) => {
|
156
157
|
const editedValue = this.state.updatedQuantity[rowData.id];
|
157
158
|
return this.hasQuantityChanged(rowData, editedValue);
|
@@ -92,7 +92,9 @@ describe('EntitlementsInlineEditFormatter', () => {
|
|
92
92
|
it('renders the value', async () => {
|
93
93
|
const controller = mockController({ editing: false });
|
94
94
|
const value = 200;
|
95
|
-
const formatter = editFormatter(controller)(value, data({
|
95
|
+
const formatter = editFormatter(controller)(value, data({
|
96
|
+
upstream_pool_id: ' ',
|
97
|
+
}));
|
96
98
|
|
97
99
|
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
98
100
|
});
|
@@ -102,6 +104,7 @@ describe('EntitlementsInlineEditFormatter', () => {
|
|
102
104
|
const value = 200;
|
103
105
|
const formatter = editFormatter(controller)(value, data({
|
104
106
|
available: -1,
|
107
|
+
upstream_pool_id: ' ',
|
105
108
|
}));
|
106
109
|
|
107
110
|
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
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: 3.9.
|
4
|
+
version: 3.9.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: 2018-11-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|