katello 3.17.0 → 3.18.0
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/registry/registry_proxies_controller.rb +38 -21
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
- data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
- data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
- data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
- data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
- data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
- data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_controller.rb +9 -9
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
- data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
- data/app/helpers/katello/katello_urls_helper.rb +5 -2
- data/app/lib/actions/candlepin/product/content_create.rb +2 -0
- data/app/lib/actions/candlepin/product/content_update.rb +2 -0
- data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +9 -9
- data/app/lib/actions/katello/content_view_version/import.rb +8 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
- data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
- data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
- data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
- data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
- data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
- data/app/lib/actions/katello/product/content_create.rb +7 -6
- data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
- data/app/lib/actions/katello/repository/import_upload.rb +4 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +3 -1
- data/app/lib/actions/katello/repository/update.rb +5 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
- data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
- data/app/lib/actions/pulp3/content_migration.rb +10 -0
- data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
- data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
- data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
- data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
- data/app/lib/actions/pulp3/import_migration.rb +6 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
- data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/delete.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
- data/app/lib/katello/resources/candlepin/owner.rb +5 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
- data/app/lib/katello/resources/registry.rb +3 -3
- data/app/models/katello/authorization/activation_key.rb +4 -0
- data/app/models/katello/authorization/content_view.rb +13 -0
- data/app/models/katello/authorization/content_view_component.rb +15 -0
- data/app/models/katello/authorization/content_view_filter.rb +15 -0
- data/app/models/katello/authorization/content_view_version.rb +25 -2
- data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
- data/app/models/katello/authorization/gpg_key.rb +12 -4
- data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
- data/app/models/katello/authorization/organization.rb +8 -0
- data/app/models/katello/authorization/sync_plan.rb +16 -0
- data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +4 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
- data/app/models/katello/content_migration_progress.rb +4 -0
- data/app/models/katello/content_view.rb +30 -4
- data/app/models/katello/content_view_component.rb +2 -0
- data/app/models/katello/content_view_filter.rb +5 -0
- data/app/models/katello/content_view_history.rb +2 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +8 -0
- data/app/models/katello/content_view_repository.rb +13 -1
- data/app/models/katello/content_view_version_export_history.rb +8 -1
- data/app/models/katello/glue/candlepin/pool.rb +9 -14
- data/app/models/katello/glue/pulp/repo.rb +8 -0
- data/app/models/katello/gpg_key.rb +1 -1
- data/app/models/katello/ping.rb +8 -3
- data/app/models/katello/repository.rb +33 -0
- data/app/models/katello/root_repository.rb +26 -1
- data/app/models/katello/smart_proxy_sync_history.rb +8 -0
- data/app/services/katello/candlepin/event_handler.rb +2 -0
- data/app/services/katello/candlepin/message_handler.rb +34 -0
- data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
- data/app/services/katello/host_status_manager.rb +9 -0
- data/app/services/katello/pulp3/api/apt.rb +57 -0
- data/app/services/katello/pulp3/api/core.rb +8 -0
- data/app/services/katello/pulp3/api/docker.rb +4 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
- data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
- data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
- data/app/services/katello/pulp3/deb.rb +38 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/migration.rb +51 -10
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
- data/app/services/katello/pulp3/repository.rb +10 -4
- data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
- data/app/services/katello/pulp3/repository/apt.rb +63 -0
- data/app/services/katello/pulp3/repository/docker.rb +9 -0
- data/app/services/katello/pulp3/repository/yum.rb +14 -9
- data/app/services/katello/pulp3/repository_mirror.rb +9 -4
- data/app/services/katello/pulp3/task.rb +4 -0
- data/app/services/katello/pulp3/task_group.rb +4 -0
- data/app/services/katello/repository_type.rb +2 -1
- data/app/services/katello/smart_proxy_helper.rb +9 -0
- data/app/views/dashboard/_subscription_widget.html.erb +0 -5
- data/app/views/foreman/hosts/_registration.html.erb +12 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/app/views/katello/layouts/react.html.erb +3 -2
- data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
- data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
- data/config/routes/api/v2.rb +24 -2
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
- data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
- data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
- data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
- data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
- data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
- data/lib/katello/engine.rb +2 -0
- data/lib/katello/permission_creator.rb +98 -69
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +10 -2
- data/lib/katello/repository_types/deb.rb +9 -1
- data/lib/katello/tasks/pulp3_migration.rake +17 -3
- data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
- data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
- data/lib/katello/tasks/reset.rake +2 -1
- data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +51 -44
- data/locale/bn/katello.po +279 -55
- data/locale/cs/katello.po +278 -51
- data/locale/de/katello.po +279 -52
- data/locale/en/katello.po +278 -49
- data/locale/es/katello.po +279 -51
- data/locale/fr/katello.po +279 -51
- data/locale/gu/katello.po +279 -55
- data/locale/hi/katello.po +279 -55
- data/locale/it/katello.po +279 -51
- data/locale/ja/katello.po +279 -52
- data/locale/katello.pot +1379 -971
- data/locale/kn/katello.po +279 -55
- data/locale/ko/katello.po +279 -51
- data/locale/mr/katello.po +279 -55
- data/locale/or/katello.po +279 -55
- data/locale/pa/katello.po +279 -55
- data/locale/pt/katello.po +278 -52
- data/locale/pt_BR/katello.po +279 -51
- data/locale/ru/katello.po +279 -51
- data/locale/ta/katello.po +279 -55
- data/locale/te/katello.po +279 -55
- data/locale/zh_CN/katello.po +279 -51
- data/locale/zh_TW/katello.po +279 -52
- data/webpack/components/ActionableDetail.js +2 -1
- data/webpack/components/Search/Search.js +1 -1
- data/webpack/components/Table/MainTable.js +6 -2
- data/webpack/components/Table/TableWrapper.js +46 -9
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
- data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
- data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
- metadata +74 -13
- data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -24,6 +24,12 @@ module Katello
|
|
24
24
|
raise ::Katello::Errors::UpstreamConsumerGone
|
25
25
|
end
|
26
26
|
|
27
|
+
def content_access
|
28
|
+
JSON.parse(self['content_access'].get).with_indifferent_access
|
29
|
+
rescue RestClient::NotFound
|
30
|
+
{}
|
31
|
+
end
|
32
|
+
|
27
33
|
def remove_entitlement(entitlement_id)
|
28
34
|
fail ArgumentError, "No entitlement ID given to remove." if entitlement_id.blank?
|
29
35
|
|
@@ -10,11 +10,12 @@ module Katello
|
|
10
10
|
::Foreman::Logging.logger('katello/registry_proxy')
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.get(path, headers = {:accept => :json})
|
13
|
+
def self.get(path, headers = {:accept => :json}, options = {})
|
14
14
|
logger.debug "Sending GET request to Registry: #{path}"
|
15
15
|
resource = RegistryResource.load_class
|
16
16
|
joined_path = resource.prefix.chomp("/") + path
|
17
17
|
client = resource.rest_client(Net::HTTP::Get, :get, joined_path)
|
18
|
+
client.options.merge!(options)
|
18
19
|
client.get(headers)
|
19
20
|
end
|
20
21
|
end
|
@@ -22,7 +23,6 @@ module Katello
|
|
22
23
|
class RegistryResource < HttpResource
|
23
24
|
class << self
|
24
25
|
def load_class
|
25
|
-
container_config = SETTINGS.dig(:katello, :container_image_registry)
|
26
26
|
registry_url = nil
|
27
27
|
pulp_primary = ::SmartProxy.pulp_primary
|
28
28
|
|
@@ -34,7 +34,7 @@ module Katello
|
|
34
34
|
|
35
35
|
# Assume the registry uses the same CA as the Smart Proxy
|
36
36
|
ca_cert_file = Setting[:ssl_ca_file]
|
37
|
-
elsif container_config
|
37
|
+
elsif (container_config = SETTINGS.dig(:katello, :container_image_registry))
|
38
38
|
registry_url = container_config[:crane_url]
|
39
39
|
ca_cert_file = container_config[:registry_ca_cert_file]
|
40
40
|
end
|
@@ -24,6 +24,10 @@ module Katello
|
|
24
24
|
authorized?(:promote_or_remove_content_views) && Katello::KTEnvironment.any_promotable?
|
25
25
|
end
|
26
26
|
|
27
|
+
def exportable?
|
28
|
+
authorized?(:export_content_views)
|
29
|
+
end
|
30
|
+
|
27
31
|
module ClassMethods
|
28
32
|
def readable
|
29
33
|
authorized(:view_content_views)
|
@@ -45,6 +49,15 @@ module Katello
|
|
45
49
|
authorized(:publish_content_views)
|
46
50
|
end
|
47
51
|
|
52
|
+
def promotable_or_removable
|
53
|
+
return where("1=0") unless Katello::KTEnvironment.any_promotable?
|
54
|
+
authorized(:promote_or_remove_content_views)
|
55
|
+
end
|
56
|
+
|
57
|
+
def exportable
|
58
|
+
authorized(:export_content_views)
|
59
|
+
end
|
60
|
+
|
48
61
|
def readable_repositories(repo_ids = nil)
|
49
62
|
query = Katello::Repository.all
|
50
63
|
content_views = Katello::ContentView.readable
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Katello
|
2
|
+
module Authorization::ContentViewComponent
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
module ClassMethods
|
6
|
+
def readable
|
7
|
+
where(:composite_content_view_id => ::Katello::ContentView.readable)
|
8
|
+
end
|
9
|
+
|
10
|
+
def editable
|
11
|
+
where(:composite_content_view_id => ::Katello::ContentView.editable)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Katello
|
2
|
+
module Authorization::ContentViewFilter
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
module ClassMethods
|
6
|
+
def readable
|
7
|
+
where(:content_view_id => ::Katello::ContentView.readable)
|
8
|
+
end
|
9
|
+
|
10
|
+
def editable
|
11
|
+
where(:content_view_id => ::Katello::ContentView.editable)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -10,9 +10,32 @@ module Katello
|
|
10
10
|
end
|
11
11
|
|
12
12
|
module ClassMethods
|
13
|
+
def with_content_view_scope(scope)
|
14
|
+
joins(:content_view).merge(Katello::ContentView.send(scope))
|
15
|
+
end
|
16
|
+
|
13
17
|
def readable
|
14
|
-
|
15
|
-
|
18
|
+
with_content_view_scope(:readable)
|
19
|
+
end
|
20
|
+
|
21
|
+
def exportable
|
22
|
+
with_content_view_scope(:exportable)
|
23
|
+
end
|
24
|
+
|
25
|
+
def editable
|
26
|
+
with_content_view_scope(:editable)
|
27
|
+
end
|
28
|
+
|
29
|
+
def publishable
|
30
|
+
with_content_view_scope(:publishable)
|
31
|
+
end
|
32
|
+
|
33
|
+
def deletable
|
34
|
+
with_content_view_scope(:deletable)
|
35
|
+
end
|
36
|
+
|
37
|
+
def promotable_or_removable
|
38
|
+
with_content_view_scope(:promotable_or_removable)
|
16
39
|
end
|
17
40
|
end
|
18
41
|
end
|
@@ -5,20 +5,28 @@ module Katello
|
|
5
5
|
include Authorizable
|
6
6
|
|
7
7
|
def readable?
|
8
|
-
authorized?(:
|
8
|
+
authorized?(:view_content_credentials)
|
9
9
|
end
|
10
10
|
|
11
11
|
def editable?
|
12
|
-
authorized?(:
|
12
|
+
authorized?(:edit_content_credentials)
|
13
13
|
end
|
14
14
|
|
15
15
|
def deletable?
|
16
|
-
authorized?(:
|
16
|
+
authorized?(:destroy_content_credentials)
|
17
17
|
end
|
18
18
|
|
19
19
|
module ClassMethods
|
20
20
|
def readable
|
21
|
-
authorized(:
|
21
|
+
authorized(:view_content_credentials)
|
22
|
+
end
|
23
|
+
|
24
|
+
def editable
|
25
|
+
authorized(:edit_content_credentials)
|
26
|
+
end
|
27
|
+
|
28
|
+
def deletable
|
29
|
+
authorized(:destroy_content_credentials)
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
@@ -45,6 +45,14 @@ module Katello
|
|
45
45
|
::User.current.can?(:create_lifecycle_environments)
|
46
46
|
end
|
47
47
|
|
48
|
+
def deletable
|
49
|
+
authorized(:destroy_lifecycle_environments)
|
50
|
+
end
|
51
|
+
|
52
|
+
def editable
|
53
|
+
authorized(:edit_lifecycle_environments)
|
54
|
+
end
|
55
|
+
|
48
56
|
def content_readable(org)
|
49
57
|
readable.where(:organization_id => org)
|
50
58
|
end
|
@@ -12,6 +12,14 @@ module Katello
|
|
12
12
|
authorized?(:import_manifest)
|
13
13
|
end
|
14
14
|
|
15
|
+
def can_import_library_content?
|
16
|
+
authorized?(:import_library_content)
|
17
|
+
end
|
18
|
+
|
19
|
+
def can_export_library_content?
|
20
|
+
authorized?(:export_library_content)
|
21
|
+
end
|
22
|
+
|
15
23
|
def readable_promotion_paths
|
16
24
|
permissible_promotion_paths(KTEnvironment.readable)
|
17
25
|
end
|
@@ -16,10 +16,26 @@ module Katello
|
|
16
16
|
authorized?(:destroy_sync_plans)
|
17
17
|
end
|
18
18
|
|
19
|
+
def syncable?
|
20
|
+
products.all? { |p| p.syncable? }
|
21
|
+
end
|
22
|
+
|
19
23
|
module ClassMethods
|
20
24
|
def readable
|
21
25
|
authorized(:view_sync_plans)
|
22
26
|
end
|
27
|
+
|
28
|
+
def editable
|
29
|
+
authorized(:edit_sync_plans)
|
30
|
+
end
|
31
|
+
|
32
|
+
def deletable
|
33
|
+
authorized(:destroy_sync_plans)
|
34
|
+
end
|
35
|
+
|
36
|
+
def syncable
|
37
|
+
authorized(:sync_sync_plans)
|
38
|
+
end
|
23
39
|
end
|
24
40
|
end
|
25
41
|
end
|
@@ -17,6 +17,8 @@ module Katello
|
|
17
17
|
TemplateKind.all.each do |kind|
|
18
18
|
if name == ::Operatingsystem::REDHAT_ATOMIC_HOST_OS && kind.name == "provision"
|
19
19
|
provisioning_template_name = Setting["katello_default_atomic_provision"]
|
20
|
+
elsif kind.name == 'registration'
|
21
|
+
provisioning_template_name = 'Linux registration default'
|
20
22
|
else
|
21
23
|
provisioning_template_name = Setting["katello_default_#{kind.name}"]
|
22
24
|
end
|
@@ -228,11 +228,6 @@ module Katello
|
|
228
228
|
subscriptions.select(&:expiring_soon?)
|
229
229
|
end
|
230
230
|
|
231
|
-
def clear_syspurpose_status
|
232
|
-
host_purpose = HostStatus::Status.where(type: ::Katello::HostStatusManager::PURPOSE_STATUS.map(&:to_s)).where('host_id in (?)', self.hosts.pluck(:id))
|
233
|
-
host_purpose.destroy_all
|
234
|
-
end
|
235
|
-
|
236
231
|
def notification_recipients_ids
|
237
232
|
users = User.unscoped.all.find_all do |user|
|
238
233
|
user.can?(:import_manifest) && user.can?(:view_organizations, self)
|
@@ -249,6 +244,10 @@ module Katello
|
|
249
244
|
# doesn't provide much benefit for the frustration it creates.
|
250
245
|
self.save(validate: false)
|
251
246
|
end
|
247
|
+
|
248
|
+
def upstream_consumer
|
249
|
+
Katello::Candlepin::UpstreamConsumer.new(self)
|
250
|
+
end
|
252
251
|
end
|
253
252
|
end
|
254
253
|
end
|
@@ -49,6 +49,8 @@ module Katello
|
|
49
49
|
has_many :content_facets, :class_name => "::Katello::Host::ContentFacet", :foreign_key => :content_source_id,
|
50
50
|
:inverse_of => :content_source, :dependent => :nullify
|
51
51
|
|
52
|
+
has_many :smart_proxy_sync_histories, :class_name => "::Katello::SmartProxySyncHistory", :inverse_of => :smart_proxy, dependent: :delete_all
|
53
|
+
|
52
54
|
has_many :hostgroup_content_facets, :class_name => "::Katello::Hostgroup::ContentFacet", :foreign_key => :content_source_id,
|
53
55
|
:inverse_of => :content_source, :dependent => :nullify
|
54
56
|
has_many :hostgroups, :class_name => "::Hostgroup", :through => :hostgroup_content_facets
|
@@ -95,7 +97,7 @@ module Katello
|
|
95
97
|
end
|
96
98
|
|
97
99
|
def self.sync_needed?(environment)
|
98
|
-
unscoped.with_environment(environment).any?
|
100
|
+
Setting[:foreman_proxy_content_auto_sync] && unscoped.with_environment(environment).any?
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
@@ -105,9 +107,9 @@ module Katello
|
|
105
107
|
|
106
108
|
def update_puppet_path
|
107
109
|
if has_feature?(PULP_FEATURE)
|
108
|
-
path = ProxyAPI::Pulp.new(:url => self.url).capsule_puppet_path['puppet_content_dir']
|
110
|
+
path = ::ProxyAPI::Pulp.new(:url => self.url).capsule_puppet_path['puppet_content_dir']
|
109
111
|
elsif has_feature?(PULP_NODE_FEATURE)
|
110
|
-
path = ProxyAPI::PulpNode.new(:url => self.url).capsule_puppet_path['puppet_content_dir']
|
112
|
+
path = ::ProxyAPI::PulpNode.new(:url => self.url).capsule_puppet_path['puppet_content_dir']
|
111
113
|
end
|
112
114
|
self.update_attribute(:puppet_path, path || '') if persisted?
|
113
115
|
path
|
@@ -128,7 +130,7 @@ module Katello
|
|
128
130
|
config.host = uri.host
|
129
131
|
config.scheme = uri.scheme
|
130
132
|
pulp3_ssl_configuration(config)
|
131
|
-
config.debugging =
|
133
|
+
config.debugging = false
|
132
134
|
config.logger = ::Foreman::Logging.logger('katello/pulp_rest')
|
133
135
|
config.username = self.setting(PULP3_FEATURE, 'username')
|
134
136
|
config.password = self.setting(PULP3_FEATURE, 'password')
|
@@ -8,6 +8,7 @@ module Katello
|
|
8
8
|
include ForemanTasks::Concerns::ActionSubject
|
9
9
|
|
10
10
|
CONTENT_DIR = "content_views".freeze
|
11
|
+
IMPORT_LIBRARY = "Import-Library".freeze
|
11
12
|
|
12
13
|
belongs_to :organization, :inverse_of => :content_views, :class_name => "::Organization"
|
13
14
|
|
@@ -67,6 +68,14 @@ module Katello
|
|
67
68
|
validates :composite,
|
68
69
|
inclusion: { in: [false], message: "Composite Content Views can not solve dependencies"},
|
69
70
|
if: :solve_dependencies
|
71
|
+
validates :import_only, :inclusion => [true, false]
|
72
|
+
validates :import_only,
|
73
|
+
inclusion: { in: [false], message: "Import-only Content Views can not be Composite"},
|
74
|
+
if: :composite
|
75
|
+
validates :import_only,
|
76
|
+
inclusion: { in: [false], message: "Import-only Content Views can not solve dependencies"},
|
77
|
+
if: :solve_dependencies
|
78
|
+
validate :import_only_immutable
|
70
79
|
|
71
80
|
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
72
81
|
validates_with Validators::KatelloLabelFormatValidator, :attributes => :label
|
@@ -94,6 +103,10 @@ module Katello
|
|
94
103
|
name
|
95
104
|
end
|
96
105
|
|
106
|
+
def library_import?
|
107
|
+
name == IMPORT_LIBRARY
|
108
|
+
end
|
109
|
+
|
97
110
|
def content_host_count
|
98
111
|
hosts.count
|
99
112
|
end
|
@@ -580,16 +593,23 @@ module Katello
|
|
580
593
|
end
|
581
594
|
|
582
595
|
def check_ready_to_import!
|
583
|
-
fail _("User must be logged in.") if ::User.current.nil?
|
584
596
|
fail _("Cannot import a composite content view") if composite?
|
597
|
+
fail _("This Content View must be set to Import-only before performing an import") unless import_only?
|
585
598
|
true
|
586
599
|
end
|
587
600
|
|
588
|
-
def check_ready_to_publish!
|
601
|
+
def check_ready_to_publish!(importing: false)
|
589
602
|
fail _("User must be logged in.") if ::User.current.nil?
|
590
603
|
fail _("Cannot publish default content view") if default?
|
591
|
-
|
592
|
-
|
604
|
+
|
605
|
+
if importing
|
606
|
+
check_ready_to_import!
|
607
|
+
else
|
608
|
+
fail _("Import-only content views can not be published directly") if import_only?
|
609
|
+
check_composite_action_allowed!(organization.library)
|
610
|
+
check_docker_repository_names!([organization.library])
|
611
|
+
end
|
612
|
+
|
593
613
|
true
|
594
614
|
end
|
595
615
|
|
@@ -698,6 +718,12 @@ module Katello
|
|
698
718
|
|
699
719
|
private
|
700
720
|
|
721
|
+
def import_only_immutable
|
722
|
+
if import_only_changed? && self.persisted?
|
723
|
+
errors.add(:import_only, _("Import-only can not be changed after creation"))
|
724
|
+
end
|
725
|
+
end
|
726
|
+
|
701
727
|
def generate_cp_environment_label(env)
|
702
728
|
# The label for a default view, will simply be the env label; otherwise, it
|
703
729
|
# will be a combination of env and view label. The reason being, the label
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewComponent < Katello::Model
|
3
|
+
include Authorization::ContentViewComponent
|
4
|
+
|
3
5
|
audited :associated_with => :composite_content_view
|
4
6
|
belongs_to :composite_content_view, :class_name => "Katello::ContentView",
|
5
7
|
:inverse_of => :content_view_components
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewFilter < Katello::Model
|
3
|
+
include Authorization::ContentViewFilter
|
3
4
|
audited :associations => [:repositories]
|
4
5
|
DOCKER = 'docker'.freeze
|
5
6
|
RPM = Rpm::CONTENT_TYPE
|
@@ -157,6 +158,10 @@ module Katello
|
|
157
158
|
if self.content_view.composite?
|
158
159
|
errors.add(:base, _("cannot contain filters if composite view"))
|
159
160
|
end
|
161
|
+
|
162
|
+
if self.content_view.import_only?
|
163
|
+
errors.add(:base, _("cannot add filter to import-only view"))
|
164
|
+
end
|
160
165
|
end
|
161
166
|
|
162
167
|
def validate_filter_repos(errors, content_view)
|
@@ -43,7 +43,7 @@ module Katello
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.generate_rpm_clauses(package_filenames = [])
|
46
|
-
{ 'filename' => { "$in" => package_filenames } } unless package_filenames.empty?
|
46
|
+
{ 'filename' => { "$in" => package_filenames.sort } } unless package_filenames.empty?
|
47
47
|
end
|
48
48
|
|
49
49
|
def applicable_rpms
|