diff --git a/src/mlinfra/stack_processor/deployment_processor/kind_deployment.py b/src/mlinfra/stack_processor/deployment_processor/kind_deployment.py index d9eda7b..f5e70a5 100644 --- a/src/mlinfra/stack_processor/deployment_processor/kind_deployment.py +++ b/src/mlinfra/stack_processor/deployment_processor/kind_deployment.py @@ -96,16 +96,30 @@ def generate_k8s_helm_provider_config(self): "r", ) as provider_tf: provider_tf_json = json.load(provider_tf) - provider_tf_json["provider"]["kubernetes"]["client_certificate"] = ( - '"${module.kind.client_certificate}"' - ) - provider_tf_json["provider"]["kubernetes"]["client_key"] = ( - '"${module.kind.client_key}"' - ) - provider_tf_json["provider"]["kubernetes"]["cluster_ca_certificate"] = ( - '"${module.kind.cluster_ca_certificate}"' - ) - provider_tf_json["provider"]["kubernetes"]["host"] = '"${module.kind.endpoint}"' + if provider == "kubernetes": + provider_tf_json["provider"]["kubernetes"]["client_certificate"] = ( + "${ module.kind.client_certificate }" + ) + provider_tf_json["provider"]["kubernetes"]["client_key"] = ( + "${ module.kind.client_key }" + ) + provider_tf_json["provider"]["kubernetes"]["cluster_ca_certificate"] = ( + "${ module.kind.cluster_ca_certificate }" + ) + provider_tf_json["provider"]["kubernetes"]["host"] = "${ module.kind.endpoint }" + else: + provider_tf_json["provider"]["helm"]["kubernetes"]["client_certificate"] = ( + "${ module.kind.client_certificate }" + ) + provider_tf_json["provider"]["helm"]["kubernetes"]["client_key"] = ( + "${ module.kind.client_key }" + ) + provider_tf_json["provider"]["helm"]["kubernetes"]["cluster_ca_certificate"] = ( + "${ module.kind.cluster_ca_certificate }" + ) + provider_tf_json["provider"]["helm"]["kubernetes"]["host"] = ( + "${ module.kind.endpoint }" + ) data["provider"].update(provider_tf_json["provider"]) generate_tf_json(module_name="k8s_provider", json_module=data)