Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix rendering of cloudConfig.gceServiceAccount #16706

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
rbac: {}
channel: stable
cloudConfig:
gceServiceAccount: default
gcpPDCSIDriver:
enabled: true
manageStorageClasses: true
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/update_cluster/ha_gce/in-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ spec:
name: c
memoryRequest: 100Mi
name: events
gceServiceAccount: default
cloudConfig:
gceServiceAccount: default
iam:
legacy: false
kubelet:
Expand Down
34 changes: 4 additions & 30 deletions tests/integration/update_cluster/ha_gce/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ resource "google_compute_instance_template" "master-us-test1-a-ha-gce-example-co
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["ha-gce-example-com-k8s-io-role-control-plane", "ha-gce-example-com-k8s-io-role-master"]
Expand Down Expand Up @@ -664,7 +664,7 @@ resource "google_compute_instance_template" "master-us-test1-b-ha-gce-example-co
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["ha-gce-example-com-k8s-io-role-control-plane", "ha-gce-example-com-k8s-io-role-master"]
Expand Down Expand Up @@ -716,7 +716,7 @@ resource "google_compute_instance_template" "master-us-test1-c-ha-gce-example-co
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["ha-gce-example-com-k8s-io-role-control-plane", "ha-gce-example-com-k8s-io-role-master"]
Expand Down Expand Up @@ -768,7 +768,7 @@ resource "google_compute_instance_template" "nodes-ha-gce-example-com" {
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.node.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_only"]
}
tags = ["ha-gce-example-com-k8s-io-role-node"]
Expand All @@ -787,32 +787,6 @@ resource "google_compute_subnetwork" "us-test1-ha-gce-example-com" {
stack_type = "IPV4_ONLY"
}

resource "google_project_iam_binding" "serviceaccount-control-plane" {
members = ["serviceAccount:control-plane-ha-gce-ex-mr702t@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/container.serviceAgent"
}

resource "google_project_iam_binding" "serviceaccount-nodes" {
members = ["serviceAccount:node-ha-gce-example-com@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/compute.viewer"
}

resource "google_service_account" "control-plane" {
account_id = "control-plane-ha-gce-ex-mr702t"
description = "kubernetes control-plane instances"
display_name = "control-plane"
project = "testproject"
}

resource "google_service_account" "node" {
account_id = "node-ha-gce-example-com"
description = "kubernetes worker nodes"
display_name = "node"
project = "testproject"
}

terraform {
required_version = ">= 0.15.0"
required_providers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
rbac: {}
channel: stable
cloudConfig:
gceServiceAccount: default
gcpPDCSIDriver:
enabled: true
manageStorageClasses: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ spec:
name: a
memoryRequest: 100Mi
name: events
gceServiceAccount: default
cloudConfig:
gceServiceAccount: default
iam:
legacy: false
kubelet:
Expand Down
30 changes: 2 additions & 28 deletions tests/integration/update_cluster/minimal_gce/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-examp
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["minimal-gce-example-com-k8s-io-role-control-plane", "minimal-gce-example-com-k8s-io-role-master"]
Expand Down Expand Up @@ -524,7 +524,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-example-com" {
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.node.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_only"]
}
tags = ["minimal-gce-example-com-k8s-io-role-node"]
Expand All @@ -543,32 +543,6 @@ resource "google_compute_subnetwork" "us-test1-minimal-gce-example-com" {
stack_type = "IPV4_ONLY"
}

resource "google_project_iam_binding" "serviceaccount-control-plane" {
members = ["serviceAccount:control-plane-minimal-g-fu1mg6@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/container.serviceAgent"
}

resource "google_project_iam_binding" "serviceaccount-nodes" {
members = ["serviceAccount:node-minimal-gce-example-com@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/compute.viewer"
}

resource "google_service_account" "control-plane" {
account_id = "control-plane-minimal-g-fu1mg6"
description = "kubernetes control-plane instances"
display_name = "control-plane"
project = "testproject"
}

resource "google_service_account" "node" {
account_id = "node-minimal-gce-example-com"
description = "kubernetes worker nodes"
display_name = "node"
project = "testproject"
}

terraform {
required_version = ">= 0.15.0"
required_providers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
rbac: {}
channel: stable
cloudConfig:
gceServiceAccount: default
gcpPDCSIDriver:
enabled: true
manageStorageClasses: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ spec:
name: a
memoryRequest: 100Mi
name: events
gceServiceAccount: default
cloudConfig:
gceServiceAccount: default
iam:
legacy: false
kubelet:
Expand Down
30 changes: 2 additions & 28 deletions tests/integration/update_cluster/minimal_gce_ilb/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-ilb-e
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["minimal-gce-ilb-example-com-k8s-io-role-control-plane", "minimal-gce-ilb-example-com-k8s-io-role-master"]
Expand Down Expand Up @@ -570,7 +570,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-ilb-example-com"
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.node.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_only"]
}
tags = ["minimal-gce-ilb-example-com-k8s-io-role-node"]
Expand Down Expand Up @@ -606,32 +606,6 @@ resource "google_compute_subnetwork" "us-test1-minimal-gce-ilb-example-com" {
stack_type = "IPV4_ONLY"
}

resource "google_project_iam_binding" "serviceaccount-control-plane" {
members = ["serviceAccount:control-plane-minimal-g-mdl6u2@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/container.serviceAgent"
}

resource "google_project_iam_binding" "serviceaccount-nodes" {
members = ["serviceAccount:node-minimal-gce-ilb-ex-mdl6u2@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/compute.viewer"
}

resource "google_service_account" "control-plane" {
account_id = "control-plane-minimal-g-mdl6u2"
description = "kubernetes control-plane instances"
display_name = "control-plane"
project = "testproject"
}

resource "google_service_account" "node" {
account_id = "node-minimal-gce-ilb-ex-mdl6u2"
description = "kubernetes worker nodes"
display_name = "node"
project = "testproject"
}

terraform {
required_version = ">= 0.15.0"
required_providers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
rbac: {}
channel: stable
cloudConfig:
gceServiceAccount: default
gcpPDCSIDriver:
enabled: true
manageStorageClasses: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ spec:
name: a
memoryRequest: 100Mi
name: events
gceServiceAccount: default
cloudConfig:
gceServiceAccount: default
iam:
legacy: false
kubelet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-with-
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["minimal-gce-with-a-very-very-v-96dqvi-k8s-io-role-control-plane", "minimal-gce-with-a-very-very-very-ver-96dqvi-k8s-io-role-master"]
Expand Down Expand Up @@ -570,7 +570,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-with-a-very-very-
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.node.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_only"]
}
tags = ["minimal-gce-with-a-very-very-very-very--96dqvi-k8s-io-role-node"]
Expand Down Expand Up @@ -606,32 +606,6 @@ resource "google_compute_subnetwork" "us-test1-minimal-gce-with-a-very-very-very
stack_type = "IPV4_ONLY"
}

resource "google_project_iam_binding" "serviceaccount-control-plane" {
members = ["serviceAccount:control-plane-minimal-g-96dqvi@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/container.serviceAgent"
}

resource "google_project_iam_binding" "serviceaccount-nodes" {
members = ["serviceAccount:node-minimal-gce-with-a-96dqvi@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/compute.viewer"
}

resource "google_service_account" "control-plane" {
account_id = "control-plane-minimal-g-96dqvi"
description = "kubernetes control-plane instances"
display_name = "control-plane"
project = "testproject"
}

resource "google_service_account" "node" {
account_id = "node-minimal-gce-with-a-96dqvi"
description = "kubernetes worker nodes"
display_name = "node"
project = "testproject"
}

terraform {
required_version = ">= 0.15.0"
required_providers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
rbac: {}
channel: stable
cloudConfig:
gceServiceAccount: default
gcpPDCSIDriver:
enabled: true
manageStorageClasses: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ spec:
name: a
memoryRequest: 100Mi
name: events
gceServiceAccount: default
cloudConfig:
gceServiceAccount: default
iam:
legacy: false
kubelet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-with-
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.control-plane.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
}
tags = ["minimal-gce-with-a-very-very-v-96dqvi-k8s-io-role-control-plane", "minimal-gce-with-a-very-very-very-ver-96dqvi-k8s-io-role-master"]
Expand Down Expand Up @@ -524,7 +524,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-with-a-very-very-
provisioning_model = "STANDARD"
}
service_account {
email = google_service_account.node.email
email = "default"
scopes = ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_only"]
}
tags = ["minimal-gce-with-a-very-very-very-very--96dqvi-k8s-io-role-node"]
Expand All @@ -543,32 +543,6 @@ resource "google_compute_subnetwork" "us-test1-minimal-gce-with-a-very-very-very
stack_type = "IPV4_ONLY"
}

resource "google_project_iam_binding" "serviceaccount-control-plane" {
members = ["serviceAccount:control-plane-minimal-g-96dqvi@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/container.serviceAgent"
}

resource "google_project_iam_binding" "serviceaccount-nodes" {
members = ["serviceAccount:node-minimal-gce-with-a-96dqvi@testproject.iam.gserviceaccount.com"]
project = "testproject"
role = "roles/compute.viewer"
}

resource "google_service_account" "control-plane" {
account_id = "control-plane-minimal-g-96dqvi"
description = "kubernetes control-plane instances"
display_name = "control-plane"
project = "testproject"
}

resource "google_service_account" "node" {
account_id = "node-minimal-gce-with-a-96dqvi"
description = "kubernetes worker nodes"
display_name = "node"
project = "testproject"
}

terraform {
required_version = ">= 0.15.0"
required_providers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
rbac: {}
channel: stable
cloudConfig:
gceServiceAccount: default
gcpPDCSIDriver:
enabled: true
manageStorageClasses: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ spec:
name: a
memoryRequest: 100Mi
name: events
gceServiceAccount: default
cloudConfig:
gceServiceAccount: default
iam:
legacy: false
kubelet:
Expand Down
Loading
Loading