@@ -119,7 +119,7 @@ data "talos_client_configuration" "this" {
119
119
)
120
120
}
121
121
122
- data "talos_cluster_kubeconfig" "this" {
122
+ resource "talos_cluster_kubeconfig" "this" {
123
123
count = var. control_plane_count > 0 ? 1 : 0
124
124
client_configuration = talos_machine_secrets. this . client_configuration
125
125
node = local. control_plane_public_ipv4_list [0 ]
@@ -136,15 +136,15 @@ locals {
136
136
" unknown"
137
137
)
138
138
kubeconfig = replace (
139
- can (data . talos_cluster_kubeconfig . this [0 ]. kubeconfig_raw ) ? data . talos_cluster_kubeconfig . this [0 ]. kubeconfig_raw : " " ,
139
+ can (talos_cluster_kubeconfig. this [0 ]. kubeconfig_raw ) ? talos_cluster_kubeconfig. this [0 ]. kubeconfig_raw : " " ,
140
140
local. cluster_endpoint_url_internal , " https://${ local . kubeconfig_host } :${ local . api_port_k8s } "
141
141
)
142
142
143
143
kubeconfig_data = {
144
144
host = " https://${ local . best_public_ipv4 } :${ local . api_port_k8s } "
145
145
cluster_name = var.cluster_name
146
- cluster_ca_certificate = var.control_plane_count > 0 ? base64decode (data . talos_cluster_kubeconfig . this [0 ]. kubernetes_client_configuration . ca_certificate ) : tls_self_signed_cert.dummy_ca[0 ].cert_pem
147
- client_certificate = var.control_plane_count > 0 ? base64decode (data . talos_cluster_kubeconfig . this [0 ]. kubernetes_client_configuration . client_certificate ) : tls_locally_signed_cert.dummy_issuer[0 ].cert_pem
148
- client_key = var.control_plane_count > 0 ? base64decode (data . talos_cluster_kubeconfig . this [0 ]. kubernetes_client_configuration . client_key ) : tls_private_key.dummy_issuer[0 ].private_key_pem
146
+ cluster_ca_certificate = var.control_plane_count > 0 ? base64decode (talos_cluster_kubeconfig. this [0 ]. kubernetes_client_configuration . ca_certificate ) : tls_self_signed_cert.dummy_ca[0 ].cert_pem
147
+ client_certificate = var.control_plane_count > 0 ? base64decode (talos_cluster_kubeconfig. this [0 ]. kubernetes_client_configuration . client_certificate ) : tls_locally_signed_cert.dummy_issuer[0 ].cert_pem
148
+ client_key = var.control_plane_count > 0 ? base64decode (talos_cluster_kubeconfig. this [0 ]. kubernetes_client_configuration . client_key ) : tls_private_key.dummy_issuer[0 ].private_key_pem
149
149
}
150
150
}
0 commit comments