Skip to content

Commit

Permalink
[374_cli] Update for install controller
Browse files Browse the repository at this point in the history
  • Loading branch information
zipofar committed Nov 28, 2023
1 parent 074a966 commit e6bcc88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/app/lib/uffizzi_core/concerns/models/deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module UffizziCore::Concerns::Models::Deployment
include UffizziCore::StateMachineConcern
include UffizziCore::DeploymentRepo
extend Enumerize
include UffizziCore::DependencyInjectionConcern

self.table_name = UffizziCore.table_names[:deployments]

Expand Down Expand Up @@ -71,7 +72,8 @@ def clean
end

def preview_url
"#{subdomain}.#{Settings.app.managed_dns_zone}"
managed_dns_zone = controller_settings_service.deployment(self).managed_dns_zone
"#{subdomain}.#{managed_dns_zone}"
end

def namespace
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 @@ -145,7 +145,7 @@ def request_events(deployment)
def controller_client(deployable)
settings = case deployable
when UffizziCore::Deployment
Settings.controller
controller_settings_service.deployment(deployable)
when UffizziCore::Cluster
controller_settings_service.vcluster(deployable)
else
Expand Down
6 changes: 6 additions & 0 deletions core/app/services/uffizzi_core/controller_settings_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ class << self
def vcluster(_cluster)
Settings.vcluster_controller
end

def deployment(_cluster)
Settings.controller.deep_dup.tap do |s|
s.managed_dns_zone = Settings.app.managed_dns_zone
end
end
end
end

0 comments on commit e6bcc88

Please sign in to comment.