From bb188ee5153b7f1a138051419681f361ba1509cb Mon Sep 17 00:00:00 2001 From: Robin Lieb Date: Thu, 4 Jul 2024 22:44:31 +0200 Subject: [PATCH] fix: remove duplicate base64 encoding from kubeconfig (#21) --- modules/kubeconfig/kubeconfig.tftpl | 6 +++--- modules/kubeconfig/kubeconfig_commands.tftpl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/kubeconfig/kubeconfig.tftpl b/modules/kubeconfig/kubeconfig.tftpl index 7766bc8..1505a2e 100644 --- a/modules/kubeconfig/kubeconfig.tftpl +++ b/modules/kubeconfig/kubeconfig.tftpl @@ -1,7 +1,7 @@ apiVersion: v1 clusters: - cluster: - certificate-authority-data: ${base64encode(ca_file)} + certificate-authority-data: ${ca_file} server: ${cluster_url} name: ${cluster_name} contexts: @@ -15,5 +15,5 @@ preferences: {} users: - name: ${user_name} user: - client-certificate-data: ${base64encode(client_cert_file)} - client-key-data: ${base64encode(client_key_file)} \ No newline at end of file + client-certificate-data: ${client_cert_file} + client-key-data: ${client_key_file} \ No newline at end of file diff --git a/modules/kubeconfig/kubeconfig_commands.tftpl b/modules/kubeconfig/kubeconfig_commands.tftpl index ca7107a..b08de6c 100644 --- a/modules/kubeconfig/kubeconfig_commands.tftpl +++ b/modules/kubeconfig/kubeconfig_commands.tftpl @@ -1,6 +1,6 @@ kubectl config set-cluster ${cluster_name} --server=${cluster_url} -kubectl config set clusters.${cluster_name}.certificate-authority-data ${base64encode(ca_file)} -kubectl config set users.${user_name}.client-certificate-data ${base64encode(client_cert_file)} -kubectl config set users.${user_name}.client-key-data ${base64encode(client_key_file)} +kubectl config set clusters.${cluster_name}.certificate-authority-data ${ca_file} +kubectl config set users.${user_name}.client-certificate-data ${client_cert_file} +kubectl config set users.${user_name}.client-key-data ${client_key_file} kubectl config set-context ${context_name} --cluster=${cluster_name} --user=${user_name} kubectl config use-context ${context_name} \ No newline at end of file