fix: gcp_container_cluster for GKE 1.19+

Incorporating a fix for GKE 1.19+ (See #444).

Inlined:

Google has removed basic-auth method from within GKE starting version 1.19
This lead the output response of the backend API not to provide basic-auth
data (username and password) anymore.

The current implementation of gcp_container_cluster when generating the kubectl
config file, always set basic-auth data w/o checking if there actually are
available or explicitly provided even when the value are not set/provided
from gcp_container_cluster.

In addition, re-enabling some tests that #444 fixed.

Co-authored-by: Xavier Lamien <laxathom@lxtnow.net>
This commit is contained in:
Yusuke Tsutsumi 2022-11-19 23:11:29 +00:00 committed by Yusuke Tsutsumi
commit d3a7287c37
4 changed files with 36 additions and 47 deletions

View file

@ -1,2 +1 @@
cloud/gcp
unsupported
cloud/gcp

View file

@ -17,15 +17,12 @@
google.cloud.gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: absent
#----------------------------------------------------------
@ -33,15 +30,12 @@
google.cloud.gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: present
register: result
@ -53,7 +47,7 @@
google.cloud.gcp_container_cluster_info:
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
scopes:
- https://www.googleapis.com/auth/cloud-platform
@ -67,15 +61,12 @@
google.cloud.gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: present
register: result
@ -88,15 +79,12 @@
google.cloud.gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: absent
register: result
@ -122,15 +110,12 @@
google.cloud.gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: absent
register: result

View file

@ -1,2 +1 @@
cloud/gcp
unsupported
cloud/gcp