diff --git a/scaleway-k8s/tasks/kubeconfig.yml b/scaleway-k8s/tasks/kubeconfig.yml index f3cabab..310f3c4 100644 --- a/scaleway-k8s/tasks/kubeconfig.yml +++ b/scaleway-k8s/tasks/kubeconfig.yml @@ -16,6 +16,6 @@ method: GET headers: X-Auth-Token: "{{ scw_secret_key }}" - when: item.name == "{{ project_name }}" + when: item.name == "{{ project_name_tf }}" with_items: "{{ (output.content |from_json).clusters }}" \ No newline at end of file diff --git a/scaleway-k8s/templates/main.tf.j2 b/scaleway-k8s/templates/main.tf.j2 index 20bea91..c5fe332 100644 --- a/scaleway-k8s/templates/main.tf.j2 +++ b/scaleway-k8s/templates/main.tf.j2 @@ -17,7 +17,7 @@ terraform { } resource "scaleway_k8s_pool" "john" { - cluster_id = scaleway_k8s_cluster.{{ project_name }}.id + cluster_id = scaleway_k8s_cluster.{{ project_name_tf }}.id name = "john" node_type = "DEV1-M" size = 1 @@ -26,9 +26,9 @@ terraform { resource "null_resource" "kubeconfig" { depends_on = [scaleway_k8s_pool.john] # at least one pool here triggers = { - host = scaleway_k8s_cluster.{{ project_name }}.kubeconfig[0].host - token = scaleway_k8s_cluster.{{ project_name }}.kubeconfig[0].token - cluster_ca_certificate = scaleway_k8s_cluster.{{ project_name }}.kubeconfig[0].cluster_ca_certificate + host = scaleway_k8s_cluster.{{ project_name_tf }}.kubeconfig[0].host + token = scaleway_k8s_cluster.{{ project_name_tf }}.kubeconfig[0].token + cluster_ca_certificate = scaleway_k8s_cluster.{{ project_name_tf }}.kubeconfig[0].cluster_ca_certificate } }