katello 3.14.1 → 3.15.0.rc1
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/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +3 -3
- data/app/controllers/katello/api/v2/repositories_controller.rb +1 -1
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +2 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -0
- data/app/lib/actions/katello/host/reassign.rb +1 -2
- data/app/lib/actions/katello/host/update_content_view.rb +1 -1
- data/app/lib/actions/katello/host/update_release_version.rb +1 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
- data/app/lib/actions/katello/product/update_http_proxy.rb +1 -1
- data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
- data/app/lib/actions/katello/repository/clone_to_environment.rb +2 -1
- data/app/lib/actions/katello/repository/create.rb +1 -1
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -8
- data/app/lib/actions/katello/repository/refresh_repository.rb +5 -1
- data/app/lib/actions/katello/repository/sync.rb +6 -1
- data/app/lib/actions/middleware/execute_if_contents_changed.rb +1 -1
- data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +1 -1
- data/app/lib/actions/pulp/repository/clear.rb +1 -1
- data/app/lib/actions/pulp/repository/remove_units.rb +1 -1
- data/app/lib/actions/pulp3/abstract_async_task.rb +1 -2
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +2 -2
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -1
- data/app/lib/actions/pulp3/content_migration.rb +17 -0
- data/app/lib/actions/pulp3/import_migration.rb +14 -0
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +4 -1
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +3 -3
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +0 -2
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/refresh_if_needed.rb +18 -0
- data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/remove_units.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +1 -1
- data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_distributions.rb +16 -0
- data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_remotes.rb +16 -0
- data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +1 -6
- data/app/lib/actions/pulp3/orphan_cleanup/remove_orphans.rb +15 -0
- data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +2 -2
- data/app/lib/actions/pulp3/repository/create.rb +1 -1
- data/app/lib/actions/pulp3/repository/create_publication.rb +1 -1
- data/app/lib/actions/pulp3/repository/presenters/content_unit_presenter.rb +1 -0
- data/app/lib/actions/pulp3/repository/refresh_distribution.rb +4 -2
- data/app/lib/actions/pulp3/repository/save_version.rb +12 -8
- data/app/lib/actions/pulp3/repository/upload_file.rb +2 -2
- data/app/lib/katello/api/v2/rendering.rb +1 -0
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -1
- data/app/lib/katello/http_resource.rb +4 -1
- data/app/lib/katello/resources/registry.rb +9 -2
- data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -0
- data/app/models/katello/concerns/organization_extensions.rb +4 -4
- data/app/models/katello/concerns/smart_proxy_extensions.rb +33 -7
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +34 -12
- data/app/models/katello/content_view_docker_filter.rb +1 -1
- data/app/models/katello/content_view_version.rb +20 -47
- data/app/models/katello/glue/candlepin/owner.rb +4 -0
- data/app/models/katello/glue/candlepin/product.rb +12 -6
- data/app/models/katello/glue/pulp/repos.rb +6 -3
- data/app/models/katello/host/subscription_facet.rb +4 -5
- data/app/models/katello/ping.rb +3 -4
- data/app/models/katello/pool.rb +1 -1
- data/app/models/katello/pulp3/distribution_reference.rb +1 -1
- data/app/models/katello/repository.rb +14 -0
- data/app/models/katello/root_repository.rb +0 -2
- data/app/models/katello/subscription_status.rb +7 -0
- data/app/models/setting/content.rb +10 -3
- data/app/services/katello/candlepin/consumer.rb +1 -0
- data/app/services/katello/pulp/repository.rb +1 -1
- data/app/services/katello/pulp/repository/deb.rb +2 -0
- data/app/services/katello/pulp/repository/docker.rb +2 -0
- data/app/services/katello/pulp/repository/file.rb +2 -0
- data/app/services/katello/pulp/repository/yum.rb +9 -5
- data/app/services/katello/pulp3/ansible_collection.rb +1 -1
- data/app/services/katello/pulp3/api/ansible_collection.rb +46 -0
- data/app/services/katello/pulp3/api/core.rb +159 -0
- data/app/services/katello/pulp3/api/docker.rb +62 -0
- data/app/services/katello/pulp3/api/file.rb +54 -0
- data/app/services/katello/pulp3/api/yum.rb +54 -0
- data/app/services/katello/pulp3/distribution.rb +17 -0
- data/app/services/katello/pulp3/docker_blob.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
- data/app/services/katello/pulp3/docker_tag.rb +1 -1
- data/app/services/katello/pulp3/erratum.rb +109 -0
- data/app/services/katello/pulp3/file_unit.rb +1 -1
- data/app/services/katello/pulp3/migration.rb +71 -0
- data/app/services/katello/pulp3/migration_plan.rb +27 -0
- data/app/services/katello/pulp3/module_stream.rb +47 -0
- data/app/services/katello/pulp3/package_group.rb +66 -0
- data/app/services/katello/pulp3/pulp_content_unit.rb +9 -1
- data/app/services/katello/pulp3/repository.rb +118 -348
- data/app/services/katello/pulp3/repository/ansible_collection.rb +1 -29
- data/app/services/katello/pulp3/repository/docker.rb +23 -43
- data/app/services/katello/pulp3/repository/file.rb +1 -37
- data/app/services/katello/pulp3/repository/yum.rb +36 -37
- data/app/services/katello/pulp3/repository_mirror.rb +171 -0
- data/app/services/katello/pulp3/rpm.rb +143 -0
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +92 -0
- data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -9
- data/app/services/katello/pulp3/srpm.rb +74 -0
- data/app/services/katello/pulp3/yum_metadata_file.rb +20 -0
- data/app/services/katello/registration_manager.rb +12 -11
- data/app/services/katello/repository_type.rb +11 -3
- data/app/services/katello/repository_type_manager.rb +11 -0
- data/app/views/dashboard/_subscription_widget.html.erb +6 -1
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +4 -11
- data/app/views/katello/api/v2/docker_manifest_lists/show.json.rabl +2 -1
- data/app/views/katello/api/v2/docker_manifests/show.json.rabl +2 -1
- data/app/views/katello/api/v2/package_groups/show.json.rabl +1 -1
- data/app/views/katello/api/v2/packages/show.json.rabl +2 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +2 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +2 -1
- data/app/views/katello/api/v2/smart_proxies/pulp_info.json.rabl +2 -0
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +1 -1
- data/app/views/smart_proxies/plugins/_pulp3.html.erb +19 -0
- data/app/views/smart_proxies/pulp_status.html.erb +10 -0
- data/db/migrate/20190930192813_add_pulp3_hrefs_to_content_types.rb +10 -0
- data/db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb +22 -0
- data/db/migrate/20191204214919_add_content_view_version_counts.rb +7 -0
- data/db/migrate/20191213161248_add_dmi_uuid_to_katello_subscription_facets.rb +6 -0
- data/db/migrate/20200109162354_drop_host_update_lock_setting.rb +5 -0
- data/db/seeds.d/104-proxy.rb +1 -1
- data/db/seeds.d/111-upgrade_tasks.rb +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +8 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-http-proxy-modal.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/lib/katello/engine.rb +25 -25
- data/lib/katello/plugin.rb +1 -1
- data/lib/katello/repository_types/ansible_collection.rb +1 -0
- data/lib/katello/repository_types/docker.rb +2 -1
- data/lib/katello/repository_types/file.rb +1 -1
- data/lib/katello/repository_types/yum.rb +29 -7
- data/lib/katello/tasks/pulp3_content_switchover.rake +21 -0
- data/lib/katello/tasks/pulp3_migration.rake +21 -0
- data/lib/katello/tasks/reset.rake +43 -16
- data/lib/katello/tasks/update_content_default_http_proxy.rake +3 -3
- data/lib/katello/tasks/upgrades/3.15/reindex_rpm_modular.rake +23 -0
- data/lib/katello/tasks/upgrades/3.15/set_sub_facet_dmi_uuid.rake +16 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +9 -10
- data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +0 -63
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +17 -2
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +1 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +2 -3
- data/webpack/scenes/RedHatRepositories/components/__tests__/RepositorySetRepositories.test.js +44 -28
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositorySetRepositories.test.js.snap +77 -45
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +2 -6
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +0 -1
- data/webpack/test_setup.js +3 -1
- metadata +62 -24
- data/app/lib/actions/katello/host/update.rb +0 -84
- data/app/lib/actions/pulp3/repository/create_version.rb +0 -19
- data/app/views/katello/api/v2/smart_proxies/download_policy.json.rabl +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
<div bst-alert="info" ng-show="contentAccessMode === 'org_environment'">
|
2
2
|
<span translate>
|
3
|
-
|
3
|
+
This organization has Simple Content Access enabled. Hosts can consume from all repositories in their Content View regardless of subscription status.
|
4
4
|
</span>
|
5
5
|
</div>
|
data/lib/katello/engine.rb
CHANGED
@@ -117,9 +117,9 @@ module Katello
|
|
117
117
|
end
|
118
118
|
|
119
119
|
initializer "katello.helpers" do |_app|
|
120
|
-
ActionView::Base.
|
121
|
-
ActionView::Base.
|
122
|
-
ActionView::Base.
|
120
|
+
ActionView::Base.include Katello::TaxonomyHelper
|
121
|
+
ActionView::Base.include Katello::HostsAndHostgroupsHelper
|
122
|
+
ActionView::Base.include Katello::KatelloUrlsHelper
|
123
123
|
end
|
124
124
|
|
125
125
|
config.to_prepare do
|
@@ -132,26 +132,26 @@ module Katello
|
|
132
132
|
FastGettext.default_text_domain = 'katello'
|
133
133
|
|
134
134
|
# Lib Extensions
|
135
|
-
::Foreman::Renderer::Scope::Variables::Base.
|
136
|
-
::Foreman::Renderer::Scope::Base.
|
135
|
+
::Foreman::Renderer::Scope::Variables::Base.include Katello::Concerns::RendererExtensions
|
136
|
+
::Foreman::Renderer::Scope::Base.include Katello::Concerns::BaseTemplateScopeExtensions
|
137
137
|
|
138
138
|
# Model extensions
|
139
|
-
::Environment.
|
140
|
-
::Host::Managed.
|
141
|
-
::Hostgroup.
|
142
|
-
::Location.
|
143
|
-
::Redhat.
|
144
|
-
::Operatingsystem.
|
145
|
-
::Organization.
|
146
|
-
::User.
|
147
|
-
::Setting.
|
148
|
-
::HttpProxy.
|
149
|
-
ForemanTasks::RecurringLogic.
|
139
|
+
::Environment.include Katello::Concerns::EnvironmentExtensions
|
140
|
+
::Host::Managed.include Katello::Concerns::HostManagedExtensions
|
141
|
+
::Hostgroup.include Katello::Concerns::HostgroupExtensions
|
142
|
+
::Location.include Katello::Concerns::LocationExtensions
|
143
|
+
::Redhat.include Katello::Concerns::RedhatExtensions
|
144
|
+
::Operatingsystem.include Katello::Concerns::OperatingsystemExtensions
|
145
|
+
::Organization.include Katello::Concerns::OrganizationExtensions
|
146
|
+
::User.include Katello::Concerns::UserExtensions
|
147
|
+
::Setting.include Katello::Concerns::SettingExtensions
|
148
|
+
::HttpProxy.include Katello::Concerns::HttpProxyExtensions
|
149
|
+
ForemanTasks::RecurringLogic.include Katello::Concerns::RecurringLogicExtensions
|
150
150
|
|
151
151
|
#Controller extensions
|
152
|
-
::HostsController.
|
153
|
-
::SmartProxiesController.
|
154
|
-
::SmartProxiesController.
|
152
|
+
::HostsController.include Katello::Concerns::HostsControllerExtensions
|
153
|
+
::SmartProxiesController.include Katello::Concerns::SmartProxiesControllerExtensions
|
154
|
+
::SmartProxiesController.include Katello::Concerns::SmartProxiesControllerExtensions
|
155
155
|
::FactImporter.register_fact_importer(Katello::RhsmFactName::FACT_TYPE, Katello::RhsmFactImporter)
|
156
156
|
::FactParser.register_fact_parser(Katello::RhsmFactName::FACT_TYPE, Katello::RhsmFactParser)
|
157
157
|
|
@@ -165,13 +165,13 @@ module Katello
|
|
165
165
|
end
|
166
166
|
#Handle Smart Proxy items separately
|
167
167
|
begin
|
168
|
-
::SmartProxy.
|
168
|
+
::SmartProxy.include Katello::Concerns::SmartProxyExtensions
|
169
169
|
rescue ActiveRecord::StatementInvalid
|
170
170
|
Rails.logger.info('Database was not initialized yet: skipping smart proxy katello extension')
|
171
171
|
end
|
172
172
|
|
173
173
|
# Organization controller extensions
|
174
|
-
::OrganizationsController.
|
174
|
+
::OrganizationsController.include Katello::Concerns::OrganizationsControllerExtensions
|
175
175
|
|
176
176
|
# Service extensions
|
177
177
|
require "#{Katello::Engine.root}/app/services/katello/puppet_class_importer_extensions"
|
@@ -186,12 +186,12 @@ module Katello
|
|
186
186
|
require_dependency "#{Katello::Engine.root}/app/controllers/katello/api/v2/api_controller"
|
187
187
|
require_dependency "#{Katello::Engine.root}/app/services/katello/proxy_status/pulp"
|
188
188
|
require_dependency "#{Katello::Engine.root}/app/services/katello/proxy_status/pulp_node"
|
189
|
-
::PuppetClassImporter.
|
189
|
+
::PuppetClassImporter.include Katello::Services::PuppetClassImporterExtensions
|
190
190
|
|
191
191
|
#Api controller extensions
|
192
|
-
::Api::V2::HostsController.
|
193
|
-
::Api::V2::HostgroupsController.
|
194
|
-
::Api::V2::SmartProxiesController.
|
192
|
+
::Api::V2::HostsController.include Katello::Concerns::Api::V2::HostsControllerExtensions
|
193
|
+
::Api::V2::HostgroupsController.include Katello::Concerns::Api::V2::HostgroupsControllerExtensions
|
194
|
+
::Api::V2::SmartProxiesController.include Katello::Concerns::Api::V2::SmartProxiesControllerExtensions
|
195
195
|
|
196
196
|
::HostsController.class_eval do
|
197
197
|
helper Katello::Concerns::HostsAndHostgroupsHelperExtensions
|
data/lib/katello/plugin.rb
CHANGED
@@ -269,7 +269,7 @@ Foreman::Plugin.register :katello do
|
|
269
269
|
register_ping_extension { Katello::Ping.ping }
|
270
270
|
register_status_extension { Katello::Ping.status }
|
271
271
|
|
272
|
-
extend_rabl_template 'api/v2/smart_proxies/main', 'katello/api/v2/smart_proxies/
|
272
|
+
extend_rabl_template 'api/v2/smart_proxies/main', 'katello/api/v2/smart_proxies/pulp_info'
|
273
273
|
extend_rabl_template 'api/v2/hosts/show', 'katello/api/v2/hosts/host_collections'
|
274
274
|
|
275
275
|
extend_page "smart_proxies/show" do |cx|
|
@@ -2,6 +2,7 @@ Katello::RepositoryTypeManager.register(::Katello::Repository::ANSIBLE_COLLECTIO
|
|
2
2
|
allow_creation_by_user true
|
3
3
|
pulp3_skip_publication true
|
4
4
|
pulp3_service_class Katello::Pulp3::Repository::AnsibleCollection
|
5
|
+
pulp3_api_class Katello::Pulp3::Api::AnsibleCollection
|
5
6
|
pulp3_plugin 'pulp_ansible'
|
6
7
|
|
7
8
|
content_type Katello::AnsibleCollection, :pulp3_service_class => ::Katello::Pulp3::AnsibleCollection, :user_removable => true
|
@@ -2,8 +2,9 @@ Katello::RepositoryTypeManager.register(::Katello::Repository::DOCKER_TYPE) do
|
|
2
2
|
service_class Katello::Pulp::Repository::Docker
|
3
3
|
default_managed_content_type Katello::DockerManifest
|
4
4
|
pulp3_service_class Katello::Pulp3::Repository::Docker
|
5
|
+
pulp3_api_class Katello::Pulp3::Api::Docker
|
5
6
|
pulp3_skip_publication true
|
6
|
-
pulp3_plugin '
|
7
|
+
pulp3_plugin 'pulp_container'
|
7
8
|
|
8
9
|
set_unique_content_per_repo
|
9
10
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Katello::RepositoryTypeManager.register(::Katello::Repository::FILE_TYPE) do
|
2
2
|
allow_creation_by_user true
|
3
3
|
service_class Katello::Pulp::Repository::File
|
4
|
-
|
5
4
|
pulp3_service_class Katello::Pulp3::Repository::File
|
5
|
+
pulp3_api_class Katello::Pulp3::Api::File
|
6
6
|
pulp3_plugin 'pulp_file'
|
7
7
|
|
8
8
|
content_type Katello::FileUnit,
|
@@ -1,17 +1,39 @@
|
|
1
1
|
Katello::RepositoryTypeManager.register(::Katello::Repository::YUM_TYPE) do
|
2
2
|
service_class Katello::Pulp::Repository::Yum
|
3
3
|
pulp3_service_class Katello::Pulp3::Repository::Yum
|
4
|
+
pulp3_api_class Katello::Pulp3::Api::Yum
|
4
5
|
pulp3_plugin 'pulp_rpm'
|
5
6
|
prevent_unneeded_metadata_publish
|
6
7
|
|
7
8
|
default_managed_content_type Katello::Rpm
|
8
|
-
content_type Katello::Rpm,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
content_type Katello::
|
9
|
+
content_type Katello::Rpm,
|
10
|
+
:priority => 1,
|
11
|
+
:pulp2_service_class => ::Katello::Pulp::Rpm,
|
12
|
+
:pulp3_service_class => ::Katello::Pulp3::Rpm,
|
13
|
+
:removable => true,
|
14
|
+
:uploadable => true
|
15
|
+
content_type Katello::ModuleStream,
|
16
|
+
:priority => 2,
|
17
|
+
:pulp2_service_class => ::Katello::Pulp::ModuleStream,
|
18
|
+
:pulp3_service_class => ::Katello::Pulp3::ModuleStream
|
19
|
+
content_type Katello::Erratum, :priority => 3,
|
20
|
+
:pulp2_service_class => ::Katello::Pulp::Erratum,
|
21
|
+
:pulp3_service_class => ::Katello::Pulp3::Erratum
|
22
|
+
content_type Katello::PackageGroup,
|
23
|
+
:pulp2_service_class => ::Katello::Pulp::PackageGroup,
|
24
|
+
:pulp3_service_class => ::Katello::Pulp3::PackageGroup
|
25
|
+
content_type Katello::YumMetadataFile,
|
26
|
+
:pulp2_service_class => ::Katello::Pulp::YumMetadataFile,
|
27
|
+
:pulp3_service_class => ::Katello::Pulp3::YumMetadataFile,
|
28
|
+
:index_on_pulp3 => false
|
29
|
+
content_type Katello::Srpm,
|
30
|
+
:pulp2_service_class => ::Katello::Pulp::Srpm,
|
31
|
+
:pulp3_service_class => ::Katello::Pulp3::Srpm,
|
32
|
+
:removable => true, :uploadable => true
|
33
|
+
content_type Katello::Distribution, :priority => 4,
|
34
|
+
:pulp2_service_class => ::Katello::Pulp::Distribution,
|
35
|
+
:pulp3_service_class => ::Katello::Pulp3::Distribution,
|
36
|
+
:index => false
|
15
37
|
content_type Katello::PackageCategory, :priority => 4, :pulp2_service_class => ::Katello::Pulp::PackageCategory, :index => false
|
16
38
|
|
17
39
|
index_additional_data { |repo, target_repo = nil| repo.import_distribution_data(target_repo) }
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.expand_path("../engine", File.dirname(__FILE__))
|
2
|
+
|
3
|
+
namespace :katello do
|
4
|
+
desc "Runs a Pulp 3 migration of pulp3 hrefs to pulp ids for supported content types."
|
5
|
+
task :pulp3_content_switchover => :environment do
|
6
|
+
content_types = Katello::Pulp3::Migration.content_types_for_migration
|
7
|
+
|
8
|
+
content_types.each do |content_type|
|
9
|
+
if content_type.model_class.where(migrated_pulp3_href: nil).any?
|
10
|
+
$stderr.print("ERROR: at least one #{content_type.model_class.table_name} record has migrated_pulp3_href NULL value\n")
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
content_types.each do |content_type|
|
16
|
+
content_type.model_class
|
17
|
+
.where.not("pulp_id=migrated_pulp3_href")
|
18
|
+
.update_all("pulp_id = migrated_pulp3_href")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
namespace :katello do
|
2
|
+
desc "Runs a Pulp 2 to 3 Content Migration for supported types. May be run multiple times. Use wait=false to immediately return with a task url."
|
3
|
+
task :pulp3_migration => ["environment", "disable_dynflow", "check_ping"] do
|
4
|
+
task = ForemanTasks.async_task(Actions::Pulp3::ContentMigration, [Katello::Repository::FILE_TYPE])
|
5
|
+
|
6
|
+
if ENV['wait'].nil? || ::Foreman::Cast.to_bool(ENV['wait'])
|
7
|
+
until !task.pending? || task.paused?
|
8
|
+
sleep(20)
|
9
|
+
task = ForemanTasks::Task.find(task.id)
|
10
|
+
end
|
11
|
+
|
12
|
+
if task.result == 'error' || task.result == 'pending'
|
13
|
+
fail ForemanTasks::TaskError, task
|
14
|
+
else
|
15
|
+
puts _("Content Migration completed successfully")
|
16
|
+
end
|
17
|
+
else
|
18
|
+
puts "Migration started, you may monitor it at: https://#{Socket.gethostname}/foreman_tasks/tasks/#{task.id}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,29 +1,50 @@
|
|
1
1
|
namespace :katello do
|
2
2
|
namespace :reset_backends do
|
3
|
-
|
4
|
-
|
3
|
+
# Switch to foreman-maintain when Pulp3 services are added to it
|
4
|
+
service_stop = "sudo /usr/bin/systemctl status %s > /dev/null && sudo /usr/bin/systemctl stop %s"
|
5
|
+
service_start = "sudo /usr/bin/systemctl start %s"
|
6
|
+
|
7
|
+
task :pulp_legacy do
|
8
|
+
SERVICES = %w(httpd pulp_workers pulp_resource_manager pulp_celerybeat squid qpidd pulp_streamer).freeze
|
9
|
+
|
10
|
+
puts "\e[33mStarting Pulp2 Reset\e[0m\n\n"
|
11
|
+
|
12
|
+
SERVICES.each { |s| system(service_stop.gsub("%s", s)) }
|
13
|
+
system(service_start.gsub("%s", 'rh-mongodb34-mongod'))
|
14
|
+
system("mongo pulp_database --eval 'db.dropDatabase();'")
|
15
|
+
fail "\e[31mCannot Migrate Pulp2 Database\e[0m\n\n" unless system('sudo -u apache /usr/bin/pulp-manage-db')
|
16
|
+
|
17
|
+
SERVICES.each { |s| system(service_start.gsub("%s", s)) }
|
18
|
+
puts "\e[32mPulp2 Database Reset Complete\e[0m\n\n"
|
19
|
+
end
|
5
20
|
|
6
21
|
task :pulp do
|
7
|
-
SERVICES = %w(
|
8
|
-
|
22
|
+
SERVICES = %w(redis pulpcore-api pulpcore-resource-manager pulpcore-content).freeze
|
23
|
+
|
24
|
+
puts "\e[33mStarting Pulp3 Reset\e[0m\n\n"
|
9
25
|
|
10
26
|
SERVICES.each { |s| system(service_stop.gsub("%s", s)) }
|
11
|
-
system("sudo
|
12
|
-
system(
|
13
|
-
|
14
|
-
|
27
|
+
system("sudo systemctl stop 'pulpcore-worker@*' --all")
|
28
|
+
system("sudo runuser - postgres -c 'dropdb pulp -p 7878'")
|
29
|
+
system("sudo runuser - postgres -c 'createdb pulp -p 7878'")
|
30
|
+
Dir.chdir('/usr/local/lib/pulp/bin') do
|
31
|
+
fail "\e[31mCannot migrate Pulp3 database\e[0m\n\n" unless system("sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' ./django-admin migrate --no-input")
|
32
|
+
puts "\e[33mRecreating Admin User\e[0m\n\n"
|
33
|
+
system("sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' ./django-admin reset-admin-password --password password")
|
34
|
+
end
|
15
35
|
|
16
36
|
SERVICES.each { |s| system(service_start.gsub("%s", s)) }
|
17
|
-
|
37
|
+
system("sudo systemctl start 'pulpcore-worker@*' --all")
|
38
|
+
puts "\e[32mPulp3 Database Reset Complete\e[0m\n\n"
|
18
39
|
end
|
19
40
|
|
20
41
|
task :candlepin do
|
21
|
-
|
42
|
+
puts "\e[33mStarting Candlepin Reset\e[0m\n\n"
|
22
43
|
|
23
|
-
system(service_stop.gsub("%s", tomcat))
|
24
|
-
system(
|
25
|
-
system(service_start.gsub("%s", tomcat))
|
26
|
-
puts "
|
44
|
+
system(service_stop.gsub("%s", 'tomcat'))
|
45
|
+
system('sudo /usr/share/candlepin/cpdb --drop --create')
|
46
|
+
system(service_start.gsub("%s", 'tomcat'))
|
47
|
+
puts "\e[32mCandlepin Database Reset Complete\e[0m\n\n"
|
27
48
|
end
|
28
49
|
end
|
29
50
|
|
@@ -33,10 +54,15 @@ namespace :katello do
|
|
33
54
|
SmartProxy.where(name: hostname, url: "https://#{hostname}:9090").first_or_create!
|
34
55
|
end
|
35
56
|
|
36
|
-
desc
|
57
|
+
desc 'Resets the Foreman/Katello development environment. WARNING: This will destroy all your Foreman, Katello and Pulp data.'
|
37
58
|
task :reset_backends do
|
38
59
|
Rake::Task['katello:reset_backends:candlepin'].invoke
|
39
|
-
|
60
|
+
if File.exist?('/usr/local/lib/pulp/bin') # When Pulp2 is no longer on nightly we will need to change this
|
61
|
+
Rake::Task['katello:reset_backends:pulp'].invoke
|
62
|
+
Rake::Task['katello:reset_backends:pulp_legacy'].invoke
|
63
|
+
else
|
64
|
+
Rake::Task['katello:reset_backends:pulp_legacy'].invoke
|
65
|
+
end
|
40
66
|
end
|
41
67
|
|
42
68
|
task :reset => ['environment'] do
|
@@ -51,5 +77,6 @@ namespace :katello do
|
|
51
77
|
system('rake db:migrate')
|
52
78
|
system('rake db:seed')
|
53
79
|
Rake::Task['katello:reset_default_smart_proxy'].invoke
|
80
|
+
puts "\e[32mReset Done\e[0m\n"
|
54
81
|
end
|
55
82
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.expand_path("../engine", File.dirname(__FILE__))
|
2
2
|
|
3
3
|
namespace :katello do
|
4
|
-
desc "Sets the content default
|
4
|
+
desc "Sets the content default HTTP proxy to an existing HTTP proxy based on supplied URL."
|
5
5
|
task :update_default_http_proxy => :environment do
|
6
6
|
setting = ::Setting.find_by(name: 'content_default_http_proxy')
|
7
7
|
options = {}
|
@@ -52,7 +52,7 @@ namespace :katello do
|
|
52
52
|
setting.update_attribute(:value, http_proxy.name)
|
53
53
|
http_proxy.update_attributes!(url: sanitized_url,
|
54
54
|
username: options[:username], password: options[:password])
|
55
|
-
puts "Content default
|
55
|
+
puts "Content default HTTP proxy set to #{http_proxy.name_and_url}."
|
56
56
|
else
|
57
57
|
new_proxy = ::HttpProxy.new(name: options[:name], url: sanitized_url,
|
58
58
|
username: options[:username], password: options[:password],
|
@@ -60,7 +60,7 @@ namespace :katello do
|
|
60
60
|
locations: Location.all)
|
61
61
|
if new_proxy.save!
|
62
62
|
setting.update_attribute(:value, new_proxy.name)
|
63
|
-
puts "Default content
|
63
|
+
puts "Default content HTTP proxy set to #{new_proxy.name_and_url}."
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
namespace :katello do
|
2
|
+
namespace :upgrades do
|
3
|
+
namespace '3.15' do
|
4
|
+
desc "Reindex the is_modular attribute of an rpm"
|
5
|
+
task :reindex_rpm_modular, [:input_file] => ["environment"] do
|
6
|
+
User.current = User.anonymous_api_admin
|
7
|
+
criteria = { :fields => [],
|
8
|
+
:limit => SETTINGS[:katello][:pulp][:bulk_load_size],
|
9
|
+
:skip => 0,
|
10
|
+
:filters => {'is_modular' => {'$eq' => true}}
|
11
|
+
}
|
12
|
+
content_type = Katello.pulp_server.extensions.rpm.content_type
|
13
|
+
batch = ::Katello::Pulp::PulpContentUnit.pulp_units_batch(criteria, criteria[:limit]) do
|
14
|
+
Katello.pulp_server.resources.unit.search(content_type, criteria)
|
15
|
+
end
|
16
|
+
pulp_modular_ids = batch.map { |response| response.pluck("_id") }.flatten
|
17
|
+
db_modular_ids = ::Katello::Rpm.modular.pluck(:pulp_id)
|
18
|
+
::Katello::Rpm.where(pulp_id: db_modular_ids - pulp_modular_ids).update_all(modular: false)
|
19
|
+
::Katello::Rpm.where(pulp_id: pulp_modular_ids - db_modular_ids).update_all(modular: true)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
namespace :katello do
|
2
|
+
namespace :upgrades do
|
3
|
+
namespace '3.15' do
|
4
|
+
desc "Set the DMI UUID on Host::SubscriptionFacet from facts"
|
5
|
+
task :set_sub_facet_dmi_uuid, [:input_file] => ["environment"] do
|
6
|
+
User.current = User.anonymous_api_admin
|
7
|
+
dmi_uuid_fact_name = Katello::RhsmFactName.find_by_name('dmi::system::uuid') || -1
|
8
|
+
|
9
|
+
fact_values = ::FactValue.where(fact_name: dmi_uuid_fact_name).where.not(value: nil)
|
10
|
+
fact_values.each do |fv|
|
11
|
+
fv.host.subscription_facet&.update_attributes(dmi_uuid: fv.value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/katello/version.rb
CHANGED
data/package.json
CHANGED
@@ -23,18 +23,15 @@
|
|
23
23
|
"url": "https://projects.theforeman.org/projects/katello/issues"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
|
+
"@babel/core": "^7.7.0",
|
26
27
|
"@storybook/react": "^3.2.17",
|
27
28
|
"@storybook/storybook-deployer": "^2.0.0",
|
28
|
-
"@theforeman/
|
29
|
+
"@theforeman/builder": "^4.0.2",
|
30
|
+
"@theforeman/vendor-dev": "^3.8.0",
|
29
31
|
"axios-mock-adapter": "^1.10.0",
|
30
|
-
"babel-core": "^6.26.3",
|
31
32
|
"babel-eslint": "^10.0.3",
|
32
|
-
"babel-jest": "^
|
33
|
-
"babel-
|
34
|
-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
35
|
-
"babel-polyfill": "^6.26.0",
|
36
|
-
"babel-preset-env": "^1.6.0",
|
37
|
-
"babel-preset-react": "^6.24.1",
|
33
|
+
"babel-jest": "^24.9.0",
|
34
|
+
"babel-loader": "^8.0.0",
|
38
35
|
"coveralls": "^3.0.0",
|
39
36
|
"cross-env": "^5.2.0",
|
40
37
|
"enzyme": "^3.4.0",
|
@@ -49,14 +46,13 @@
|
|
49
46
|
"eslint-plugin-promise": "^4.2.1",
|
50
47
|
"eslint-plugin-react": "^7.4.0",
|
51
48
|
"identity-obj-proxy": "^3.0.0",
|
52
|
-
"jest": "^
|
49
|
+
"jest": "^24.9.0",
|
53
50
|
"prettier": "^1.7.4",
|
54
51
|
"react-redux-test-utils": "^0.1.1",
|
55
52
|
"react-test-renderer": "^16.0.0",
|
56
53
|
"redux-mock-store": "^1.3.0"
|
57
54
|
},
|
58
55
|
"dependencies": {
|
59
|
-
"@theforeman/vendor": "^1.4.0",
|
60
56
|
"angular": "1.5.5",
|
61
57
|
"bootstrap-select": "1.12.4",
|
62
58
|
"downshift": "^1.28.0",
|
@@ -66,6 +62,9 @@
|
|
66
62
|
"react-bootstrap": "^0.32.1",
|
67
63
|
"react-helmet": "^5.2.0"
|
68
64
|
},
|
65
|
+
"peerDependencies": {
|
66
|
+
"@theforeman/vendor": ">= 3.8.0"
|
67
|
+
},
|
69
68
|
"jest": {
|
70
69
|
"collectCoverage": true,
|
71
70
|
"collectCoverageFrom": [
|
@@ -28,27 +28,6 @@ exports[`subscriptions page should render select org page 1`] = `
|
|
28
28
|
"subscribe": [Function],
|
29
29
|
}
|
30
30
|
}
|
31
|
-
storeSubscription={
|
32
|
-
Subscription {
|
33
|
-
"listeners": Object {
|
34
|
-
"clear": [Function],
|
35
|
-
"get": [Function],
|
36
|
-
"notify": [Function],
|
37
|
-
"subscribe": [Function],
|
38
|
-
},
|
39
|
-
"onStateChange": [Function],
|
40
|
-
"parentSub": undefined,
|
41
|
-
"store": Object {
|
42
|
-
"clearActions": [Function],
|
43
|
-
"dispatch": [Function],
|
44
|
-
"getActions": [Function],
|
45
|
-
"getState": [Function],
|
46
|
-
"replaceReducer": [Function],
|
47
|
-
"subscribe": [Function],
|
48
|
-
},
|
49
|
-
"unsubscribe": [Function],
|
50
|
-
}
|
51
|
-
}
|
52
31
|
>
|
53
32
|
<Header
|
54
33
|
title="Select Organization"
|
@@ -105,27 +84,6 @@ exports[`subscriptions page should render the wrapped component 1`] = `
|
|
105
84
|
"subscribe": [Function],
|
106
85
|
}
|
107
86
|
}
|
108
|
-
storeSubscription={
|
109
|
-
Subscription {
|
110
|
-
"listeners": Object {
|
111
|
-
"clear": [Function],
|
112
|
-
"get": [Function],
|
113
|
-
"notify": [Function],
|
114
|
-
"subscribe": [Function],
|
115
|
-
},
|
116
|
-
"onStateChange": [Function],
|
117
|
-
"parentSub": undefined,
|
118
|
-
"store": Object {
|
119
|
-
"clearActions": [Function],
|
120
|
-
"dispatch": [Function],
|
121
|
-
"getActions": [Function],
|
122
|
-
"getState": [Function],
|
123
|
-
"replaceReducer": [Function],
|
124
|
-
"subscribe": [Function],
|
125
|
-
},
|
126
|
-
"unsubscribe": [Function],
|
127
|
-
}
|
128
|
-
}
|
129
87
|
>
|
130
88
|
<WrappedComponent
|
131
89
|
default={[Function]}
|
@@ -142,27 +100,6 @@ exports[`subscriptions page should render the wrapped component 1`] = `
|
|
142
100
|
"subscribe": [Function],
|
143
101
|
}
|
144
102
|
}
|
145
|
-
storeSubscription={
|
146
|
-
Subscription {
|
147
|
-
"listeners": Object {
|
148
|
-
"clear": [Function],
|
149
|
-
"get": [Function],
|
150
|
-
"notify": [Function],
|
151
|
-
"subscribe": [Function],
|
152
|
-
},
|
153
|
-
"onStateChange": [Function],
|
154
|
-
"parentSub": undefined,
|
155
|
-
"store": Object {
|
156
|
-
"clearActions": [Function],
|
157
|
-
"dispatch": [Function],
|
158
|
-
"getActions": [Function],
|
159
|
-
"getState": [Function],
|
160
|
-
"replaceReducer": [Function],
|
161
|
-
"subscribe": [Function],
|
162
|
-
},
|
163
|
-
"unsubscribe": [Function],
|
164
|
-
}
|
165
|
-
}
|
166
103
|
>
|
167
104
|
<div>
|
168
105
|
Wrapped!
|