Skip to content

Commit 2cfc14e

Browse files
committed
[1110_uffizzi_platform] remove wildcard tls from installation
1 parent 6ce2232 commit 2cfc14e

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

lib/uffizzi/cli/install.rb

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ class Cli::Install < Thor
1919
method_option :'user-email', type: :string
2020
method_option :'user-password', type: :string
2121
method_option :issuer, type: :string, enum: ['letsencrypt', 'zerossl']
22-
method_option :'wildcard-cert-path', type: :string
23-
method_option :'wildcard-key-path', type: :string
24-
method_option :'without-wildcard-tls', type: :boolean
2522
method_option :repo, type: :string
2623
method_option :'print-values', type: :boolean
2724
def application
2825
run_installation do
2926
if options.except(:repo, :'print-values').present?
30-
validate_installation_options
27+
build_installation_options
3128
else
3229
ask_installation_params
3330
end
@@ -94,7 +91,6 @@ def run_installation
9491
create_helm_values_file(helm_values)
9592
helm_set_repo unless options[:repo]
9693
helm_install(release_name: release_name, namespace: namespace, repo: options[:repo])
97-
kubectl_add_wildcard_tls(params) if params[:wildcard_cert_path] && params[:wildcard_key_path]
9894
delete_helm_values_file
9995

10096
ingress_ip = get_web_ingress_ip_address(release_name, namespace)
@@ -229,20 +225,6 @@ def ask_installation_params
229225
}.merge(wildcard_cert_paths)
230226
end
231227

232-
def validate_installation_options
233-
installation_options = build_installation_options
234-
235-
if options[:'without-wildcard-tls']
236-
return installation_options.except(:wildcard_cert_path, :wildcard_key_path)
237-
end
238-
239-
empty_key = [:'wildcard-cert-path', :'wildcard-key-path'].detect { |k| options[k].nil? }
240-
241-
if empty_key.present?
242-
Uffizzi.ui.say_error_and_exit("#{empty_key} is required or use the flag --without-wildcard-tls")
243-
end
244-
end
245-
246228
def build_installation_options
247229
{
248230
namespace: options[:namespace] || DEFAULT_NAMESPACE,
@@ -252,15 +234,12 @@ def build_installation_options
252234
controller_password: generate_password,
253235
cert_email: options[:'user-email'],
254236
cluster_issuer: options[:issuer] || DEFAULT_CLUSTER_ISSUER,
255-
wildcard_cert_path: options[:'wildcard-cert-path'],
256-
wildcard_key_path: options[:'wildcard-key-path'],
257237
}
258238
end
259239

260240
def build_helm_values(params)
261241
domain = params.fetch(:domain)
262242
namespace = params.fetch(:namespace)
263-
tls_per_deployment_enabled = params.slice(:wildcard_cert_pathm, :wildcard_key_path).compact.empty?
264243
app_host = [DEFAULT_APP_PREFIX, domain].join('.')
265244

266245
{
@@ -284,10 +263,13 @@ def build_helm_values(params)
284263
disabled: true,
285264
},
286265
clusterIssuer: params.fetch(:cluster_issuer),
287-
tlsPerDeploymentEnabled: tls_per_deployment_enabled.to_s,
266+
tlsPerDeploymentEnabled: true.to_s,
288267
certEmail: params.fetch(:cert_email),
289268
'ingress-nginx' => {
290269
controller: {
270+
ingressClassResource: {
271+
default: true,
272+
},
291273
extraArgs: {
292274
'default-ssl-certificate' => "#{namespace}/wildcard.#{domain}",
293275
},
@@ -298,7 +280,7 @@ def build_helm_values(params)
298280
end
299281

300282
def execute_command(command, say: true)
301-
stdout_str, stderr_str, status = Uffizzi.ui.execute(command)
283+
stdout_str, stderr_str, status = Uffizzi.ui.capture3(command)
302284

303285
return yield(stdout_str, stderr_str) if block_given?
304286

0 commit comments

Comments
 (0)