katello 3.7.0.rc1 → 3.7.0.rc2
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/v2/content_views_controller.rb +5 -2
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -3
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +1 -1
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +4 -4
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +5 -22
- data/app/lib/actions/katello/host/update_content_overrides.rb +1 -0
- data/app/lib/actions/katello/product/content_create.rb +1 -0
- data/app/lib/actions/katello/product/repositories_certs_reset.rb +25 -0
- data/app/lib/actions/katello/product/update.rb +6 -0
- data/app/lib/katello/resources/candlepin/activation_key.rb +8 -4
- data/app/lib/katello/resources/candlepin/product.rb +2 -1
- data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
- data/app/lib/katello/util/package.rb +21 -13
- data/app/lib/katello/util/package_filter.rb +33 -31
- data/app/lib/katello/validators/prior_validator.rb +6 -10
- data/app/models/katello/concerns/host_managed_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +1 -0
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +10 -6
- data/app/models/katello/content.rb +23 -2
- data/app/models/katello/content_view_docker_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +3 -3
- data/app/models/katello/content_view_version.rb +4 -0
- data/app/models/katello/environment_prior.rb +7 -0
- data/app/models/katello/glue/candlepin/candlepin_object.rb +2 -2
- data/app/models/katello/glue/candlepin/pool.rb +10 -13
- data/app/models/katello/glue/candlepin/product.rb +19 -9
- data/app/models/katello/glue/candlepin/repository.rb +16 -0
- data/app/models/katello/glue/candlepin/subscription.rb +1 -1
- data/app/models/katello/glue/provider.rb +15 -81
- data/app/models/katello/host/subscription_facet.rb +1 -1
- data/app/models/katello/kt_environment.rb +39 -8
- data/app/models/katello/pool.rb +2 -1
- data/app/models/katello/rpm.rb +144 -2
- data/app/models/katello/upstream_pool.rb +7 -10
- data/app/services/katello/candlepin/pool_service.rb +18 -3
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +13 -16
- data/app/views/dashboard/_content_views_widget.html.erb +3 -3
- data/app/views/dashboard/_errata_widget.html.erb +2 -2
- data/app/views/dashboard/_host_collection_widget.html.erb +3 -3
- data/app/views/dashboard/_subscription_status_widget.html.erb +2 -2
- data/app/views/dashboard/_subscription_widget.html.erb +1 -1
- data/app/views/dashboard/_sync_widget.html.erb +3 -3
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +1 -1
- data/app/views/katello/api/v2/upstream_subscriptions/base.json.rabl +2 -6
- data/app/views/katello/layouts/react.html.erb +3 -3
- data/config/katello.yaml +89 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20160302091113_change_environment_prior.rb +9 -0
- data/db/migrate/20180410140909_add_organization_id_to_pool.rb +2 -1
- data/db/migrate/20180612163403_add_foreign_key_to_hypervisor_id.rb +10 -0
- data/db/migrate/20180612164926_add_content_org_id.rb +39 -0
- data/db/migrate/20180612165011_remove_content_fields_from_host.rb +7 -0
- data/db/migrate/20180626160422_add_upstream_pool_id_to_katello_pool.rb +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js +2 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.controller.js +19 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/new-environment.controller.js +18 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/paths.service.js +51 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/new-environment.html +16 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +1 -6
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +4 -0
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
- data/lib/katello/plugin.rb +2 -11
- data/lib/katello/scheduled_jobs.rb +2 -14
- data/lib/katello/tasks/clean_backend_objects.rake +2 -0
- data/lib/katello/tasks/repository.rake +11 -2
- data/lib/katello/tasks/upgrades/3.7/import_pools.rake +12 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +4 -3
- data/webpack/components/PaginationRow/index.js +6 -2
- data/webpack/containers/Application/config.js +7 -2
- data/webpack/index.js +3 -5
- data/webpack/move_to_foreman/common/helpers.js +5 -24
- data/webpack/move_to_foreman/components/common/emptyState/index.js +12 -7
- data/webpack/move_to_foreman/components/common/table/components/CollapseSubscriptionGroupButton.js +31 -0
- data/webpack/move_to_foreman/components/common/table/components/CollapseSubscriptionGroupButton.test.js +16 -0
- data/webpack/move_to_foreman/components/common/table/components/Table.js +76 -0
- data/webpack/move_to_foreman/components/common/table/components/Table.test.js +31 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBody.js +27 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBody.test.js +18 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBodyMessage.js +18 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBodyMessage.test.js +12 -0
- data/webpack/move_to_foreman/components/common/table/components/TableFixtures.js +14 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +39 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.test.js +16 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionHeaderCell.js +34 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionHeaderCell.test.js +14 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +19 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/Table.test.js.snap +167 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableBody.test.js.snap +28 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableBodyMessage.test.js.snap +13 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionCell.test.js.snap +16 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +15 -0
- data/webpack/move_to_foreman/components/common/table/components/index.js +6 -0
- data/webpack/move_to_foreman/components/common/table/formatters/cellFormatter.js +4 -0
- data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +18 -0
- data/webpack/move_to_foreman/components/common/table/formatters/ellipsisCellFormatter.js +5 -0
- data/webpack/move_to_foreman/components/common/table/formatters/headerFormatter.js +4 -0
- data/webpack/move_to_foreman/components/common/table/formatters/index.js +6 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +17 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionHeaderCellFormatter.js +10 -0
- data/webpack/move_to_foreman/components/common/table/index.js +2 -88
- data/webpack/move_to_pf/LoadingState/LoadingState.js +35 -0
- data/webpack/move_to_pf/LoadingState/LoadingState.scss +12 -0
- data/webpack/move_to_pf/LoadingState/LoadingState.test.js +28 -0
- data/webpack/move_to_pf/LoadingState/__snapshots__/LoadingState.test.js.snap +20 -0
- data/webpack/move_to_pf/LoadingState/index.js +3 -0
- data/webpack/move_to_pf/test-utils/testHelpers.js +71 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +34 -9
- data/webpack/redux/actions/RedHatRepositories/sets.js +28 -6
- data/webpack/redux/consts.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +12 -2
- data/webpack/redux/reducers/RedHatRepositories/sets.js +34 -27
- data/webpack/redux/reducers/RedHatRepositories/sets.test.js +10 -2
- data/webpack/redux/reducers/index.js +2 -0
- data/webpack/scenes/Organizations/OrganizationActions.js +3 -3
- data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js +44 -0
- data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.scss +16 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +8 -2
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +5 -3
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +4 -2
- data/webpack/scenes/RedHatRepositories/components/Search.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/__tests__/RecommendedRepositorySetsToggler.test.js +17 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +37 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
- data/webpack/scenes/RedHatRepositories/index.js +17 -7
- data/webpack/scenes/RedHatRepositories/index.scss +16 -4
- data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +17 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +28 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailAssociations.js +47 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailConstants.js +3 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +65 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProducts.js +20 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +37 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +58 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +47 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailAssociations.test.js +16 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailInfo.test.js +15 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailProducts.test.js +16 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailReducer.test.js +39 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +28 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailAssociations.test.js.snap +53 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +185 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProducts.test.js.snap +77 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +432 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +167 -0
- data/webpack/scenes/Subscriptions/Details/index.js +19 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +58 -12
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +6 -1
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +4 -4
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +7 -7
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -9
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -2
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +5 -6
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +2 -3
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +46 -30
- data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +38 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +3 -3
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +7 -6
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +17 -14
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +12 -15
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +4 -4
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +5 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +2 -2
- data/webpack/scenes/Subscriptions/{EntitlementsInlineEditFormatter.js → components/SubscriptionsTable/EntitlementsInlineEditFormatter.js} +7 -7
- data/webpack/scenes/Subscriptions/{SubscriptionsTable.js → components/SubscriptionsTable/SubscriptionsTable.js} +75 -47
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +60 -0
- data/webpack/scenes/Subscriptions/{SubscriptionsTableSchema.js → components/SubscriptionsTable/SubscriptionsTableSchema.js} +37 -26
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +56 -0
- data/webpack/scenes/Subscriptions/{__tests__ → components/SubscriptionsTable/__tests__}/__snapshots__/SubscriptionsTable.test.js.snap +16 -5
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/index.js +2 -0
- data/webpack/scenes/Subscriptions/index.js +2 -2
- data/webpack/scenes/Tasks/TaskActions.js +18 -11
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +92 -9
- data/webpack/scenes/Tasks/__tests__/task.fixtures.js +19 -9
- data/webpack/services/api/index.js +2 -2
- data/webpack/test_setup.js +1 -0
- metadata +79 -10
- data/webpack/scenes/Subscriptions/Subscriptions.scss +0 -14
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsTable.test.js +0 -47
@@ -1,7 +1,6 @@
|
|
1
1
|
object @resource ||= @object
|
2
2
|
|
3
|
-
attributes :
|
4
|
-
attributes :pool_id
|
3
|
+
attributes :id
|
5
4
|
attributes :status
|
6
5
|
attributes :quantity
|
7
6
|
attributes :available
|
@@ -12,7 +11,4 @@ attributes :consumed
|
|
12
11
|
attributes :product_name
|
13
12
|
attributes :product_id
|
14
13
|
attributes :subscription_id
|
15
|
-
|
16
|
-
if params[:pool_ids]
|
17
|
-
attributes :local_pool_ids
|
18
|
-
end
|
14
|
+
attributes :local_pool_ids
|
@@ -3,13 +3,13 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% content_for(:javascripts) do %>
|
6
|
-
<%= javascript_include_tag *webpack_asset_paths('katello', :extension => 'js')
|
6
|
+
<%= javascript_include_tag *webpack_asset_paths('katello', :extension => 'js') %>
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<% content_for(:content) do %>
|
10
10
|
<%= notifications %>
|
11
|
-
<div id="reactRoot"></div>
|
12
11
|
<div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
|
12
|
+
<div id="reactRoot"></div>
|
13
13
|
<% end %>
|
14
|
-
|
15
14
|
<%= render file: "layouts/base" %>
|
15
|
+
<%= mount_react_component('katello', '#reactRoot') %>
|
data/config/katello.yaml
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
:katello:
|
2
|
+
#if this block is not define, all types are enabled
|
3
|
+
#types are defined in lib/katello/repository_types/*.rb
|
4
|
+
:content_types:
|
5
|
+
:yum: true
|
6
|
+
:file: true
|
7
|
+
:deb: true
|
8
|
+
:puppet: true
|
9
|
+
:docker: true
|
10
|
+
:ostree: true
|
11
|
+
|
12
|
+
:use_cp: true # set to true/false if you want to override default
|
13
|
+
:use_pulp: true # set to true/false if you want to override default
|
14
|
+
|
15
|
+
:rest_client_timeout: 30
|
16
|
+
:gpg_strict_validation: false
|
17
|
+
|
18
|
+
:puppet_repo_root: '/etc/puppet/environments/'
|
19
|
+
|
20
|
+
:post_sync_url: "http://localhost:3000/katello/api/v2/repositories/sync_complete?token=katello"
|
21
|
+
|
22
|
+
:redhat_repository_url: https://cdn.redhat.com
|
23
|
+
|
24
|
+
:consumer_cert_rpm: 'katello-ca-consumer-latest.noarch.rpm'
|
25
|
+
:consumer_cert_sh: 'katello-rhsm-consumer'
|
26
|
+
|
27
|
+
# Setup your candlepin environment here
|
28
|
+
:candlepin:
|
29
|
+
# refers to the url of the candlepin
|
30
|
+
# example https://localhost:8443/candlepin
|
31
|
+
:url: https://192.168.42.116:31329/candlepin
|
32
|
+
|
33
|
+
# Specify your oauth key and secret used to authenticate between Katello and Candlepin
|
34
|
+
:oauth_key: katello
|
35
|
+
:oauth_secret: katello
|
36
|
+
|
37
|
+
# refers to the candlepin-ca.crt location that is needed
|
38
|
+
# to connect to candlepin over https.This is not necessary
|
39
|
+
# if the candlepin server is running on the same machine as katello
|
40
|
+
# but required if the server is on a different machine.
|
41
|
+
# In the different machine case the katello host needs to have a
|
42
|
+
# copy of /etc/candlepin/certs/candlepin-ca.crt copied from
|
43
|
+
# the candlepin host and the location of the copied file needs to be
|
44
|
+
# specified here..
|
45
|
+
:ca_cert_file:
|
46
|
+
# :bulk_load_size: 1000
|
47
|
+
# Setup your pulp environment here
|
48
|
+
:pulp:
|
49
|
+
# refers to the url of the pulp
|
50
|
+
# example https://localhost/pulp/api
|
51
|
+
:url: https://192.168.42.116:30133/pulp/api/v2/
|
52
|
+
|
53
|
+
:sync_threads: 4
|
54
|
+
:bulk_load_size: 100
|
55
|
+
# refers to the apache certificate
|
56
|
+
# (typically /etc/pki/tls/certs/localhost.crt) location that is needed
|
57
|
+
# to connect to pulp over https.
|
58
|
+
:ca_cert_file:
|
59
|
+
:default_login: admin
|
60
|
+
:sync_KBlimit:
|
61
|
+
:upload_chunk_size: 1048575 # upload size in bytes to pulp. see SSLRenegBufferSize in apache
|
62
|
+
:skip_checksum_validation: false
|
63
|
+
|
64
|
+
:qpid:
|
65
|
+
:url: amqp:ssl:katello-devel.example.com:5671
|
66
|
+
:subscriptions_queue_address: katello_event_queue
|
67
|
+
|
68
|
+
:cdn_proxy:
|
69
|
+
# :host: localhost
|
70
|
+
# :port: 3128
|
71
|
+
# :user: login
|
72
|
+
# :password: password
|
73
|
+
|
74
|
+
# Logging configuration can be changed by uncommenting the loggers
|
75
|
+
# section and the logger configuration desired.
|
76
|
+
#
|
77
|
+
# :loggers:
|
78
|
+
# :glue:
|
79
|
+
# :enabled: true
|
80
|
+
# :pulp_rest:
|
81
|
+
# :enabled: true
|
82
|
+
# :cp_rest:
|
83
|
+
# :enabled: true
|
84
|
+
# :cp_proxy:
|
85
|
+
# :enabled: true
|
86
|
+
# :action:
|
87
|
+
# :enabled: true
|
88
|
+
# :manifest_import_logger:
|
89
|
+
# :enabled: true
|
data/config/routes.rb
CHANGED
@@ -18,6 +18,9 @@ Katello::Engine.routes.draw do
|
|
18
18
|
get '/katello/providers/redhat_provider', to: redirect('/redhat_repositories')
|
19
19
|
match '/redhat_repositories' => 'react#index', :via => [:get]
|
20
20
|
|
21
|
+
match '/subscriptions' => 'react#index', :via => [:get]
|
22
|
+
match '/subscriptions/*page' => 'react#index', :via => [:get]
|
23
|
+
|
21
24
|
match '/xui' => 'react#index', :via => [:get]
|
22
25
|
match '/xui/*page' => 'react#index', :via => [:get]
|
23
26
|
end
|
@@ -4,7 +4,8 @@ class AddOrganizationIdToPool < ActiveRecord::Migration[5.1]
|
|
4
4
|
add_foreign_key 'katello_pools', 'taxonomies',
|
5
5
|
:name => 'katello_pools_organization_id', :column => 'organization_id'
|
6
6
|
|
7
|
-
Katello::Pool.
|
7
|
+
::Katello::Pool.reset_column_information
|
8
|
+
::Katello::Pool.find_each do |pool|
|
8
9
|
pool.update_attributes(:organization_id => pool.subscription.organization_id) if pool.subscription
|
9
10
|
end
|
10
11
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class AddForeignKeyToHypervisorId < ActiveRecord::Migration[5.1]
|
2
|
+
def up
|
3
|
+
add_foreign_key(:katello_pools, :hosts,
|
4
|
+
:name => 'katello_pools_hypervisor_fk', :column => 'hypervisor_id')
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
remove_foreign_key(:katello_pools, :name => 'katello_pools_hypervisor_fk')
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class AddContentOrgId < ActiveRecord::Migration[5.1]
|
2
|
+
class FakeContent < Katello::Model
|
3
|
+
self.table_name = 'katello_contents'
|
4
|
+
has_many :product_contents, :class_name => 'FakeProductContent', :dependent => :destroy, :foreign_key => 'content_id'
|
5
|
+
has_many :products, :through => :product_contents
|
6
|
+
end
|
7
|
+
|
8
|
+
class FakeProductContent < Katello::Model
|
9
|
+
self.table_name = 'katello_product_contents'
|
10
|
+
belongs_to :product, :class_name => 'Katello::Product', :foreign_key => 'product_id', :inverse_of => :product_contents
|
11
|
+
belongs_to :content, :class_name => 'FakeContent', :foreign_key => 'content_id', :inverse_of => :product_contents
|
12
|
+
end
|
13
|
+
|
14
|
+
class FakeProduct < Katello::Model
|
15
|
+
self.table_name = 'katello_products'
|
16
|
+
end
|
17
|
+
|
18
|
+
def up
|
19
|
+
add_column :katello_contents, :organization_id, :integer, :null => true
|
20
|
+
add_foreign_key :katello_contents, :taxonomies, :column => :organization_id, :primary_key => :id
|
21
|
+
|
22
|
+
Katello::Content.where(:organization_id => nil).find_each do |content|
|
23
|
+
org_ids = content.products.pluck(:organization_id).uniq
|
24
|
+
org_ids.each do |org_id|
|
25
|
+
attrs = content.attributes.except('id')
|
26
|
+
attrs['organization_id'] = org_id
|
27
|
+
new_content = FakeContent.create!(attrs)
|
28
|
+
new_content.products = content.products.where('katello_products.organization_id' => org_id)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
FakeContent.where(:organization_id => nil).destroy_all
|
33
|
+
change_column :katello_contents, :organization_id, :integer, :null => false
|
34
|
+
end
|
35
|
+
|
36
|
+
def down
|
37
|
+
fail ActiveRecord::IrreversibleMigration
|
38
|
+
end
|
39
|
+
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</li>
|
16
16
|
<li>
|
17
17
|
<p translate>Install the pre-built bootstrap RPM:</p>
|
18
|
-
<pre><code>
|
18
|
+
<pre><code>curl --insecure --output {{ consumerCertRPM }} https://{{ noCapsulesFound ? katelloHostname : hostname(selectedCapsule.url) }}/pub/{{ consumerCertRPM }}<br />yum localinstall {{ consumerCertRPM }} </code></pre>
|
19
19
|
</li>
|
20
20
|
<li>
|
21
21
|
<p translate>Register using subscription-manager:</p>
|
@@ -20,8 +20,7 @@
|
|
20
20
|
function fetchRepositories(contentView) {
|
21
21
|
var promise, params = {
|
22
22
|
'environment_id': $scope.$stateParams.environmentId,
|
23
|
-
'content_type': ContentService.getRepositoryType()
|
24
|
-
library: true
|
23
|
+
'content_type': ContentService.getRepositoryType()
|
25
24
|
};
|
26
25
|
|
27
26
|
if (contentView && contentView.id !== 'all') {
|
@@ -64,7 +63,7 @@
|
|
64
63
|
return versionId;
|
65
64
|
}
|
66
65
|
|
67
|
-
nutupaneParams = {'environment_id': $scope.$stateParams.environmentId
|
66
|
+
nutupaneParams = {'environment_id': $scope.$stateParams.environmentId};
|
68
67
|
if ($location.search().repositoryId) {
|
69
68
|
nutupaneParams['repository_id'] = $location.search().repositoryId;
|
70
69
|
}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
<span page-title ng-model="environment">{{ 'Lifecycle Environment:' | translate }} {{ environment.name }}</span>
|
2
|
+
|
1
3
|
<div data-extend-template="layouts/details-page-with-breadcrumbs.html">
|
2
4
|
<header data-block="header">
|
3
5
|
{{ environment.name }}
|
@@ -13,7 +15,7 @@
|
|
13
15
|
</div>
|
14
16
|
|
15
17
|
<nav data-block="navigation">
|
16
|
-
<ul class="nav nav-tabs">
|
18
|
+
<ul class="nav nav-tabs details-nav">
|
17
19
|
<li ng-class="{active: isState('environment.details')}">
|
18
20
|
<a ui-sref="environment.details({environmentId: environment.id})">
|
19
21
|
<span translate>Details</span>
|
@@ -32,4 +34,4 @@
|
|
32
34
|
<section data-block="content">
|
33
35
|
<div ui-view></div>
|
34
36
|
</section>
|
35
|
-
</div>
|
37
|
+
</div>
|
@@ -3,30 +3,35 @@
|
|
3
3
|
* @name Bastion.environments.controller:EnvironmentsController
|
4
4
|
*
|
5
5
|
* @requires $scope
|
6
|
+
* @requires PathsService
|
7
|
+
* @requires $location
|
6
8
|
* @requires Organization
|
7
9
|
* @requires CurrentOrganization
|
10
|
+
* @requires Nutupane
|
11
|
+
* @requires Environment
|
8
12
|
*
|
9
13
|
* @description
|
10
14
|
* Provides the functionality for the environments path page.
|
11
15
|
*/
|
12
16
|
angular.module('Bastion.environments').controller('EnvironmentsController',
|
13
|
-
['$scope', 'Organization', 'CurrentOrganization',
|
14
|
-
function ($scope, Organization, CurrentOrganization) {
|
17
|
+
['$scope', 'PathsService', '$location', 'Organization', 'CurrentOrganization', 'Nutupane', 'Environment',
|
18
|
+
function ($scope, PathsService, $location, Organization, CurrentOrganization, Nutupane, Environment) {
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
var params = {
|
21
|
+
'organization_id': CurrentOrganization,
|
22
|
+
'search': $location.search().search || "",
|
23
|
+
'sort_by': 'name',
|
24
|
+
'sort_order': 'ASC',
|
25
|
+
'paged': true
|
26
|
+
};
|
23
27
|
|
24
|
-
|
25
|
-
|
26
|
-
}
|
27
|
-
});
|
28
|
+
var nutupane = new Nutupane(Environment, params);
|
29
|
+
$scope.table = nutupane.table;
|
28
30
|
|
29
|
-
|
31
|
+
PathsService.getActualPaths().then(function (data) {
|
32
|
+
$scope.library = data.library;
|
33
|
+
$scope.paths = data.paths;
|
34
|
+
$scope.loading = false;
|
30
35
|
});
|
31
36
|
|
32
37
|
$scope.lastEnvironment = function (path) {
|
@@ -8,7 +8,7 @@
|
|
8
8
|
* @description
|
9
9
|
* Handles creating a new environment.
|
10
10
|
*/
|
11
|
-
function NewEnvironmentController($scope, Environment, FormUtils, Notification) {
|
11
|
+
function NewEnvironmentController($scope, Environment, FormUtils, Notification, PathsService) {
|
12
12
|
|
13
13
|
function success() {
|
14
14
|
$scope.transitionTo('environments');
|
@@ -30,12 +30,18 @@
|
|
30
30
|
$scope.environment = new Environment();
|
31
31
|
$scope.priorEnvironment = Environment.get({id: $scope.$stateParams.priorId});
|
32
32
|
|
33
|
-
$scope.priorEnvironment.$promise.then(function () {
|
34
|
-
|
33
|
+
$scope.priorEnvironment.$promise.then(function (prior) {
|
34
|
+
PathsService.getCurrentPath(prior).then(function (path) {
|
35
|
+
$scope.currentPath = path || null;
|
36
|
+
$scope.environment['prior_id'] = $scope.priorEnvironment.id;
|
37
|
+
if (path) {
|
38
|
+
$scope.environment['path_id'] = $scope.currentPath[1].id;
|
39
|
+
}
|
40
|
+
$scope.loading = false;
|
41
|
+
});
|
35
42
|
});
|
36
43
|
|
37
44
|
$scope.save = function (environment) {
|
38
|
-
environment['prior_id'] = $scope.$stateParams.priorId;
|
39
45
|
environment.$save(success, error);
|
40
46
|
};
|
41
47
|
|
@@ -46,12 +52,19 @@
|
|
46
52
|
}
|
47
53
|
});
|
48
54
|
|
55
|
+
$scope.$watch('environment.prior_id', function (priorId) {
|
56
|
+
angular.forEach($scope.currentPath, function (env) {
|
57
|
+
if (env.id === priorId) {
|
58
|
+
$scope.priorEnvironment = env;
|
59
|
+
}
|
60
|
+
});
|
61
|
+
});
|
49
62
|
}
|
50
63
|
|
51
64
|
angular
|
52
65
|
.module('Bastion.environments')
|
53
66
|
.controller('NewEnvironmentController', NewEnvironmentController);
|
54
67
|
|
55
|
-
NewEnvironmentController.$inject = ['$scope', 'Environment', 'FormUtils', 'Notification'];
|
68
|
+
NewEnvironmentController.$inject = ['$scope', 'Environment', 'FormUtils', 'Notification', 'PathsService'];
|
56
69
|
|
57
70
|
})();
|
data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/paths.service.js
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
angular.module('Bastion.environments').service('PathsService',
|
2
|
+
['$q', 'Organization', 'CurrentOrganization',
|
3
|
+
function ($q, Organization, CurrentOrganization) {
|
4
|
+
|
5
|
+
this.getActualPaths = function () {
|
6
|
+
var actualPaths = [];
|
7
|
+
|
8
|
+
return this.loadPaths().then(function (paths) {
|
9
|
+
var data = {};
|
10
|
+
data.library = paths[0].environments[0];
|
11
|
+
|
12
|
+
angular.forEach(paths, function (path, index) {
|
13
|
+
paths[index].environments.splice(0, 1);
|
14
|
+
|
15
|
+
if (paths[index].environments.length !== 0) {
|
16
|
+
actualPaths.push(path);
|
17
|
+
}
|
18
|
+
});
|
19
|
+
data.paths = actualPaths;
|
20
|
+
return data;
|
21
|
+
});
|
22
|
+
};
|
23
|
+
|
24
|
+
this.loadPaths = function () {
|
25
|
+
var deferred = $q.defer();
|
26
|
+
|
27
|
+
Organization.paths({id: CurrentOrganization}, function (response) {
|
28
|
+
deferred.resolve(response);
|
29
|
+
});
|
30
|
+
return deferred.promise;
|
31
|
+
};
|
32
|
+
|
33
|
+
this.getCurrentPath = function (prior) {
|
34
|
+
return this.loadPaths().then(function (paths) {
|
35
|
+
var currentPath = null;
|
36
|
+
if (prior.library) {
|
37
|
+
currentPath = [prior];
|
38
|
+
} else {
|
39
|
+
angular.forEach(paths, function (path) {
|
40
|
+
angular.forEach(path.environments, function (env) {
|
41
|
+
if (env.id === prior.id) {
|
42
|
+
currentPath = path;
|
43
|
+
}
|
44
|
+
});
|
45
|
+
});
|
46
|
+
}
|
47
|
+
return currentPath.environments;
|
48
|
+
});
|
49
|
+
};
|
50
|
+
}]
|
51
|
+
);
|