katello 4.1.1 → 4.1.2
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/pulp3/capsule_content/generate_metadata.rb +5 -0
- data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +3 -2
- data/app/lib/actions/pulp3/capsule_content/sync.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -0
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/repository/create_publication.rb +6 -3
- data/app/lib/actions/pulp3/repository/refresh_remote.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +9 -2
- data/app/models/katello/concerns/smart_proxy_extensions.rb +9 -0
- data/app/services/katello/pulp3/repository.rb +9 -16
- data/app/services/katello/pulp3/task.rb +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +1 -1
- data/lib/katello/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1df4c90d3b97976268e14d23a3a58a006ef9659059f029f4c5eff51099dca23
|
4
|
+
data.tar.gz: 228835f2dff702bcef05b93738aca3248e94e03d7f1f8874eabf7648964f7d3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73cff67750374c2235cbe78cfe11a3a0d8d1f86982d05bba2288eda2a416ff622466d089ea3a3633fa59b3cad27a28dfaf022c917e0809ebfdf741580d2199da
|
7
|
+
data.tar.gz: b5478182ea63c8a1c0386c9952c40481bea38a549b7e93c7566016a39a08c43f7ac495a175d473ee9cf39fb85279725949326a1f8179dc20edfe05d195883d7a
|
@@ -22,6 +22,11 @@ module Actions
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def invoke_external_task
|
25
|
+
if input[:options][:sync_task_output] &&
|
26
|
+
::Katello::Pulp3::Task.publication_href(input[:options][:sync_task_output]).present?
|
27
|
+
return input[:options][:sync_task_output]
|
28
|
+
end
|
29
|
+
|
25
30
|
repository = ::Katello::Repository.find(input[:repository_id])
|
26
31
|
smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
|
27
32
|
output[:response] = repository.backend_service(smart_proxy).with_mirror_adapter.create_publication
|
@@ -19,9 +19,10 @@ module Actions
|
|
19
19
|
if options[:use_repository_version]
|
20
20
|
repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:use_repository_version => true)
|
21
21
|
elsif tasks && tasks[:pulp_tasks] && tasks[:pulp_tasks].first
|
22
|
-
publication_href = tasks[:pulp_tasks]
|
23
|
-
if publication_href
|
22
|
+
if (publication_href = ::Katello::Pulp3::Task.publication_href(tasks[:pulp_tasks]))
|
24
23
|
repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:publication => publication_href)
|
24
|
+
else
|
25
|
+
fail "Unable to refresh distribution for repo #{repository.id}, could not find a publication_href"
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -5,7 +5,8 @@ module Actions
|
|
5
5
|
include ::Actions::Helpers::SmartProxySyncHistoryHelper
|
6
6
|
def plan(repository, smart_proxy, options = {})
|
7
7
|
sequence do
|
8
|
-
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :options => options)
|
8
|
+
sync_task = plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :options => options)
|
9
|
+
options[:sync_task_output] = sync_task.output[:pulp_tasks]
|
9
10
|
plan_action(GenerateMetadata, repository, smart_proxy, options)
|
10
11
|
end
|
11
12
|
end
|
@@ -6,6 +6,7 @@ module Actions
|
|
6
6
|
def plan(repository, smart_proxy, options = {})
|
7
7
|
options[:contents_changed] = (options && options.key?(:contents_changed)) ? options[:contents_changed] : true
|
8
8
|
publication_content_type = !::Katello::RepositoryTypeManager.find(repository.content_type).pulp3_skip_publication
|
9
|
+
|
9
10
|
sequence do
|
10
11
|
if options[:source_repository] && publication_content_type
|
11
12
|
plan_self(source_repository_id: options[:source_repository].id, target_repository_id: repository.id, smart_proxy_id: smart_proxy.id)
|
@@ -11,7 +11,7 @@ module Actions
|
|
11
11
|
|
12
12
|
force_fetch_version = true if options[:optimize] == false
|
13
13
|
version_output = plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks], :force_fetch_version => force_fetch_version).output
|
14
|
-
plan_action(Pulp3::Orchestration::Repository::GenerateMetadata, repository, smart_proxy, :contents_changed => version_output[:contents_changed])
|
14
|
+
plan_action(Pulp3::Orchestration::Repository::GenerateMetadata, repository, smart_proxy, :contents_changed => version_output[:contents_changed], :skip_publication_creation => version_output[:publication_provided])
|
15
15
|
plan_self(:subaction_output => version_output)
|
16
16
|
end
|
17
17
|
end
|
@@ -5,14 +5,17 @@ module Actions
|
|
5
5
|
middleware.use Actions::Middleware::ExecuteIfContentsChanged
|
6
6
|
def plan(repository, smart_proxy, options)
|
7
7
|
sequence do
|
8
|
-
action = plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :contents_changed => options[:contents_changed],
|
8
|
+
action = plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :contents_changed => options[:contents_changed],
|
9
|
+
:skip_publication_creation => options[:skip_publication_creation])
|
9
10
|
plan_action(SavePublication, repository, action.output, :contents_changed => options[:contents_changed])
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
13
14
|
def invoke_external_task
|
14
|
-
|
15
|
-
|
15
|
+
unless input[:skip_publication_creation]
|
16
|
+
repository = ::Katello::Repository.find(input[:repository_id])
|
17
|
+
output[:response] = repository.backend_service(smart_proxy).with_mirror_adapter.create_publication
|
18
|
+
end
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -9,17 +9,24 @@ module Actions
|
|
9
9
|
|
10
10
|
def run
|
11
11
|
repo = ::Katello::Repository.find(input[:repository_id])
|
12
|
-
|
13
12
|
if input[:force_fetch_version]
|
14
13
|
version_href = fetch_version_href(repo)
|
15
14
|
elsif input[:repository_details].present?
|
16
15
|
version_href = input[:repository_details][:latest_version_href]
|
17
16
|
elsif input[:tasks].present?
|
18
|
-
version_href = input[:tasks]
|
17
|
+
version_href = ::Katello::Pulp3::Task.version_href(input[:tasks])
|
19
18
|
else
|
20
19
|
version_href = fetch_version_href(repo)
|
21
20
|
end
|
22
21
|
|
22
|
+
output[:publication_provided] = false
|
23
|
+
if input[:tasks].present?
|
24
|
+
if (publication_href = ::Katello::Pulp3::Task.publication_href(input[:tasks]))
|
25
|
+
repo.update(:publication_href => publication_href)
|
26
|
+
output[:publication_provided] = true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
23
30
|
if version_href
|
24
31
|
if repo.version_href != version_href || input[:force_fetch_version]
|
25
32
|
output[:contents_changed] = true
|
@@ -89,6 +89,10 @@ module Katello
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def self.with_environment(environment, include_default = false)
|
92
|
+
(pulp2_proxies_with_environment(environment, include_default) + pulpcore_proxies_with_environment(environment)).try(:uniq)
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.pulp2_proxies_with_environment(environment, include_default = false)
|
92
96
|
features = [PULP_NODE_FEATURE]
|
93
97
|
features << PULP_FEATURE if include_default
|
94
98
|
|
@@ -96,6 +100,11 @@ module Katello
|
|
96
100
|
where(katello_capsule_lifecycle_environments: { lifecycle_environment_id: environment.id })
|
97
101
|
end
|
98
102
|
|
103
|
+
def self.pulpcore_proxies_with_environment(environment)
|
104
|
+
unscoped.where(id: unscoped.select { |p| p.pulp_mirror? }.pluck(:id)).joins(:capsule_lifecycle_environments).
|
105
|
+
where(katello_capsule_lifecycle_environments: { lifecycle_environment_id: environment.id })
|
106
|
+
end
|
107
|
+
|
99
108
|
def self.sync_needed?(environment)
|
100
109
|
Setting[:foreman_proxy_content_auto_sync] && unscoped.with_environment(environment).any?
|
101
110
|
end
|
@@ -16,6 +16,14 @@ module Katello
|
|
16
16
|
@smart_proxy = smart_proxy
|
17
17
|
end
|
18
18
|
|
19
|
+
def self.version_href?(href)
|
20
|
+
/.*\/versions\/\d*\//.match(href)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.publication_href?(href)
|
24
|
+
href.include?('/publications/')
|
25
|
+
end
|
26
|
+
|
19
27
|
def partial_repo_path
|
20
28
|
fail NotImplementedError
|
21
29
|
end
|
@@ -124,7 +132,7 @@ module Katello
|
|
124
132
|
|
125
133
|
def refresh_if_needed
|
126
134
|
tasks = []
|
127
|
-
tasks << update_remote
|
135
|
+
tasks << update_remote #always update remote
|
128
136
|
tasks << update_distribution if distribution_needs_update?
|
129
137
|
tasks.compact
|
130
138
|
end
|
@@ -133,21 +141,6 @@ module Katello
|
|
133
141
|
api.remotes_api.read(href)
|
134
142
|
end
|
135
143
|
|
136
|
-
def remote_needs_updates?
|
137
|
-
if repo.remote_href
|
138
|
-
remote = get_remote
|
139
|
-
# The proxy auth creds are not returned by the Pulp API.
|
140
|
-
# The creds don't need to be checked here because they
|
141
|
-
# won't be updated outside of UpdateRemote.
|
142
|
-
computed = compute_remote_options.slice!(:proxy_username, :proxy_password)
|
143
|
-
computed.keys.any? { |key| remote.send(key) != computed[key] }
|
144
|
-
elsif repo.url
|
145
|
-
true
|
146
|
-
else
|
147
|
-
false
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
144
|
def get_distribution(href = distribution_reference.href)
|
152
145
|
api.get_distribution(href)
|
153
146
|
end
|
@@ -51,6 +51,22 @@ module Katello
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
def self.version_href(tasks)
|
55
|
+
tasks = [tasks] unless tasks.is_a?(Array)
|
56
|
+
version_hrefs = tasks.map { |task| task[:created_resources] }.flatten
|
57
|
+
version_hrefs = version_hrefs.select { |href| ::Katello::Pulp3::Repository.version_href?(href) }
|
58
|
+
Rails.logger.error("Got multiple version_hrefs for pulp task: #{tasks}") if version_hrefs.length > 2
|
59
|
+
version_hrefs.last
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.publication_href(tasks)
|
63
|
+
tasks = [tasks] unless tasks.is_a?(Array)
|
64
|
+
publication_hrefs = tasks.map { |task| task[:created_resources] }.flatten
|
65
|
+
publication_hrefs = publication_hrefs.select { |href| ::Katello::Pulp3::Repository.publication_href?(href) }
|
66
|
+
Rails.logger.error("Got multiple publication hrefs for pulp task: #{tasks}") if publication_hrefs.length > 2
|
67
|
+
publication_hrefs.last #return the last href to workaround https://pulp.plan.io/issues/9098
|
68
|
+
end
|
69
|
+
|
54
70
|
def task_data(force_refresh = false)
|
55
71
|
@pulp_data = nil if force_refresh
|
56
72
|
@pulp_data ||= tasks_api.read(@href).as_json.with_indifferent_access
|
@@ -126,7 +126,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostErrataController'
|
|
126
126
|
|
127
127
|
$scope.performViaKatelloAgent = function () {
|
128
128
|
var errataIds = $scope.selectedErrataIds();
|
129
|
-
HostErratum.apply({id: $scope.host.id, 'bulk_errata_ids': errataIds},
|
129
|
+
HostErratum.apply({id: $scope.host.id, 'bulk_errata_ids': angular.toJson(errataIds)},
|
130
130
|
function (task) {
|
131
131
|
$scope.table.selectAll(false);
|
132
132
|
$scope.transitionTo('content-host.tasks.details', {taskId: task.id});
|
data/lib/katello/version.rb
CHANGED
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.1.
|
4
|
+
version: 4.1.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: 2021-07-
|
11
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "<"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 13.0.4
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "<"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 13.0.4
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rabl
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -405,7 +391,7 @@ dependencies:
|
|
405
391
|
version: 3.13.0
|
406
392
|
- - "<"
|
407
393
|
- !ruby/object:Gem::Version
|
408
|
-
version: 3.
|
394
|
+
version: 3.15.0
|
409
395
|
type: :runtime
|
410
396
|
prerelease: false
|
411
397
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -415,7 +401,7 @@ dependencies:
|
|
415
401
|
version: 3.13.0
|
416
402
|
- - "<"
|
417
403
|
- !ruby/object:Gem::Version
|
418
|
-
version: 3.
|
404
|
+
version: 3.15.0
|
419
405
|
- !ruby/object:Gem::Dependency
|
420
406
|
name: pulp_certguard_client
|
421
407
|
requirement: !ruby/object:Gem::Requirement
|