Skip to content

Commit 8f688ba

Browse files
committed
Merge branch 'develop'
2 parents 7130b9e + 17e9578 commit 8f688ba

File tree

9 files changed

+28
-13
lines changed

9 files changed

+28
-13
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: core
33
specs:
4-
uffizzi_core (2.4.2)
4+
uffizzi_core (2.4.3)
55
aasm
66
actionpack (~> 6.1.0)
77
active_model_serializers
@@ -111,7 +111,7 @@ GEM
111111
ast (2.4.2)
112112
awesome_print (1.9.2)
113113
aws-eventstream (1.3.0)
114-
aws-partitions (1.867.0)
114+
aws-partitions (1.868.0)
115115
aws-sdk-core (3.190.0)
116116
aws-eventstream (~> 1, >= 1.3.0)
117117
aws-partitions (~> 1, >= 1.651.0)

core/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
uffizzi_core (2.4.2)
4+
uffizzi_core (2.4.3)
55
aasm
66
actionpack (~> 6.1.0)
77
active_model_serializers
@@ -110,7 +110,7 @@ GEM
110110
activerecord (>= 5.2.6)
111111
awesome_print (1.9.2)
112112
aws-eventstream (1.3.0)
113-
aws-partitions (1.867.0)
113+
aws-partitions (1.868.0)
114114
aws-sdk-core (3.190.0)
115115
aws-eventstream (~> 1, >= 1.3.0)
116116
aws-partitions (~> 1, >= 1.651.0)

core/app/lib/uffizzi_core/concerns/models/deployment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def clean
7272
end
7373

7474
def preview_url
75-
managed_dns_zone = controller_settings_service.deployment(self).managed_dns_zone
75+
managed_dns_zone = controller_settings_service.deployment_settings_by_deployment(self).managed_dns_zone
7676
"#{subdomain}.#{managed_dns_zone}"
7777
end
7878

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# frozen_string_literal: true
22

33
class UffizziCore::Api::Cli::V1::AccountSerializer < UffizziCore::BaseSerializer
4+
include UffizziCore::DependencyInjectionConcern
5+
include_module_if_exists('UffizziCore::Api::Cli::V1::AccountSerializerModule')
6+
47
type :account
58

69
has_many :projects
710

8-
attributes :id, :name
11+
attributes :id, :name, :api_url, :vclusters_controller_url
12+
13+
def api_url
14+
Settings.domain
15+
end
16+
17+
def vclusters_controller_url
18+
controller_settings_service.vcluster_settings_by_account(object).url
19+
end
920
end

core/app/serializers/uffizzi_core/controller/create_cluster/cluster_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class UffizziCore::Controller::CreateCluster::ClusterSerializer < UffizziCore::B
77
attributes :name, :manifest, :base_ingress_host, :distro, :image
88

99
def base_ingress_host
10-
managed_dns_zone = controller_settings_service.vcluster(object).managed_dns_zone
10+
managed_dns_zone = controller_settings_service.vcluster_settings_by_vcluster(object).managed_dns_zone
1111

1212
[object.namespace, managed_dns_zone].join('.')
1313
end

core/app/serializers/uffizzi_core/controller/update_cluster/cluster_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class UffizziCore::Controller::UpdateCluster::ClusterSerializer < UffizziCore::B
77
attributes :name, :manifest, :base_ingress_host
88

99
def base_ingress_host
10-
managed_dns_zone = controller_settings_service.vcluster(object).managed_dns_zone
10+
managed_dns_zone = controller_settings_service.vcluster_settings_by_vcluster(object).managed_dns_zone
1111

1212
[object.namespace, managed_dns_zone].join('.')
1313
end

core/app/services/uffizzi_core/controller_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ def request_events(deployment)
145145
def controller_client(deployable)
146146
settings = case deployable
147147
when UffizziCore::Deployment
148-
controller_settings_service.deployment(deployable)
148+
controller_settings_service.deployment_settings_by_deployment(deployable)
149149
when UffizziCore::Cluster
150-
controller_settings_service.vcluster(deployable)
150+
controller_settings_service.vcluster_settings_by_vcluster(deployable)
151151
else
152152
raise StandardError, "Deployable #{deployable.class.name} undefined"
153153
end

core/app/services/uffizzi_core/controller_settings_service.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
class UffizziCore::ControllerSettingsService
44
class << self
5-
def vcluster(_cluster)
5+
def vcluster_settings_by_vcluster(_cluster)
66
Settings.vcluster_controller
77
end
88

9-
def deployment(_cluster)
9+
def vcluster_settings_by_account(_account)
10+
Settings.vcluster_controller
11+
end
12+
13+
def deployment_settings_by_deployment(_deployment)
1014
Settings.controller.deep_dup.tap do |s|
1115
s.managed_dns_zone = Settings.app.managed_dns_zone
1216
end

core/lib/uffizzi_core/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module UffizziCore
4-
VERSION = '2.4.2'
4+
VERSION = '2.4.3'
55
end

0 commit comments

Comments
 (0)