Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
moklidia committed Dec 18, 2023
2 parents 7130b9e + 17e9578 commit 8f688ba
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: core
specs:
uffizzi_core (2.4.2)
uffizzi_core (2.4.3)
aasm
actionpack (~> 6.1.0)
active_model_serializers
Expand Down Expand Up @@ -111,7 +111,7 @@ GEM
ast (2.4.2)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.867.0)
aws-partitions (1.868.0)
aws-sdk-core (3.190.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand Down
4 changes: 2 additions & 2 deletions core/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
uffizzi_core (2.4.2)
uffizzi_core (2.4.3)
aasm
actionpack (~> 6.1.0)
active_model_serializers
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
activerecord (>= 5.2.6)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.867.0)
aws-partitions (1.868.0)
aws-sdk-core (3.190.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand Down
2 changes: 1 addition & 1 deletion core/app/lib/uffizzi_core/concerns/models/deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def clean
end

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# frozen_string_literal: true

class UffizziCore::Api::Cli::V1::AccountSerializer < UffizziCore::BaseSerializer
include UffizziCore::DependencyInjectionConcern
include_module_if_exists('UffizziCore::Api::Cli::V1::AccountSerializerModule')

type :account

has_many :projects

attributes :id, :name
attributes :id, :name, :api_url, :vclusters_controller_url

def api_url
Settings.domain
end

def vclusters_controller_url
controller_settings_service.vcluster_settings_by_account(object).url
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UffizziCore::Controller::CreateCluster::ClusterSerializer < UffizziCore::B
attributes :name, :manifest, :base_ingress_host, :distro, :image

def base_ingress_host
managed_dns_zone = controller_settings_service.vcluster(object).managed_dns_zone
managed_dns_zone = controller_settings_service.vcluster_settings_by_vcluster(object).managed_dns_zone

[object.namespace, managed_dns_zone].join('.')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UffizziCore::Controller::UpdateCluster::ClusterSerializer < UffizziCore::B
attributes :name, :manifest, :base_ingress_host

def base_ingress_host
managed_dns_zone = controller_settings_service.vcluster(object).managed_dns_zone
managed_dns_zone = controller_settings_service.vcluster_settings_by_vcluster(object).managed_dns_zone

[object.namespace, managed_dns_zone].join('.')
end
Expand Down
4 changes: 2 additions & 2 deletions core/app/services/uffizzi_core/controller_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def request_events(deployment)
def controller_client(deployable)
settings = case deployable
when UffizziCore::Deployment
controller_settings_service.deployment(deployable)
controller_settings_service.deployment_settings_by_deployment(deployable)
when UffizziCore::Cluster
controller_settings_service.vcluster(deployable)
controller_settings_service.vcluster_settings_by_vcluster(deployable)
else
raise StandardError, "Deployable #{deployable.class.name} undefined"
end
Expand Down
8 changes: 6 additions & 2 deletions core/app/services/uffizzi_core/controller_settings_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

class UffizziCore::ControllerSettingsService
class << self
def vcluster(_cluster)
def vcluster_settings_by_vcluster(_cluster)
Settings.vcluster_controller
end

def deployment(_cluster)
def vcluster_settings_by_account(_account)
Settings.vcluster_controller
end

def deployment_settings_by_deployment(_deployment)
Settings.controller.deep_dup.tap do |s|
s.managed_dns_zone = Settings.app.managed_dns_zone
end
Expand Down
2 changes: 1 addition & 1 deletion core/lib/uffizzi_core/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module UffizziCore
VERSION = '2.4.2'
VERSION = '2.4.3'
end

0 comments on commit 8f688ba

Please sign in to comment.