Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[374_cli] Update for install controller #494

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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