Closed rotilho closed 2 months ago
this is nothing on the provider side, you might have kubeconfig environment variable exported, or the resource accessing some other kubeconfig
My kubeconfig points to the correct server however I'm directly setting up the provider with talos_cluster_kubeconfig
so in my understanding it should work regardless of my env.
provider "kubernetes" {
host = talos_cluster_kubeconfig.home.kubernetes_client_configuration.host
cluster_ca_certificate = base64decode(talos_cluster_kubeconfig.home.kubernetes_client_configuration.ca_certificate)
client_key = base64decode(talos_cluster_kubeconfig.home.kubernetes_client_configuration.client_key)
client_certificate = base64decode(talos_cluster_kubeconfig.home.kubernetes_client_configuration.client_certificate)
}
The only difference is the data to resource change. If I revert back to data it works totally fine
could you do a terraform state show talos_cluster_kubeconfig.home
and see what it returns?
I'm really confused. I rolled everything back and then bumped the Talos provider to 0.6.0-alpha.1, but the error still occurred. So, I decided to add the resource back in (and apply it using target) just to check the resource content. The content looked fine, so I applied it to the whole project, and surprisingly, it worked.
I'm not sure what the issue was, but it's gone now.
I had the same issue and managed to fix it using a moved
block. In your case it should look like the following:
moved {
from = data.talos_cluster_kubeconfig.home
to = talos_cluster_kubeconfig.home
}
I attempted to change from the
talos_cluster_kubeconfig
data to resource however the host is incorrect, it points to localhost.Original (works):
New:
Output: