Skip to content

Commit

Permalink
Merge pull request #453 from UffizziCloud/feature/1119_uffizzi_platfo…
Browse files Browse the repository at this point in the history
…rm-workloads-to-separate-cluster

[1119_uffizzi_platform] Add controller settings
  • Loading branch information
moklidia authored Jul 24, 2023
2 parents 9744930 + 272c774 commit 89e1b78
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def template_memory_module
module_class(:template_memory_module)
end

def controller_settings_service
return unless module_exists?(:controller_settings)

module_class(:controller_settings)
end

private

def module_exists?(module_name)
Expand Down
2 changes: 1 addition & 1 deletion core/app/services/uffizzi_core/controller_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def controller_client(deployable)
when UffizziCore::Deployment
Settings.controller
when UffizziCore::Cluster
Settings.vcluster_controller
controller_settings_service.vcluster(deployable)
else
raise StandardError, "Deployable #{deployable.class.name} undefined"
end
Expand Down
9 changes: 9 additions & 0 deletions core/app/services/uffizzi_core/controller_settings_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class UffizziCore::ControllerSettingsService
class << self
def vcluster(_cluster)
Settings.vcluster_controller
end
end
end
1 change: 1 addition & 0 deletions core/lib/uffizzi_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module UffizziCore
rbac: 'UffizziCore::Rbac::UserAccessService',
deployment_memory_module: 'UffizziCore::Deployment::MemoryService',
template_memory_module: 'UffizziCore::Template::MemoryService',
controller_settings: 'UffizziCore::ControllerSettingsService',
}
mattr_accessor :table_names, default: {
accounts: :uffizzi_core_accounts,
Expand Down

0 comments on commit 89e1b78

Please sign in to comment.