Skip to content

Commit f3ddbf5

Browse files
authored
fix: asm destroy (terraform-google-modules#922)
* fix: asm destroy * fix nodepool test
1 parent 00c2b71 commit f3ddbf5

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

modules/asm/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ module "asm_install" {
9696
impersonate_service_account = var.impersonate_service_account
9797

9898
kubectl_create_command = "${path.module}/scripts/install_asm.sh ${var.project_id} ${var.cluster_name} ${var.location} ${var.asm_version} ${var.mode} ${var.managed_control_plane} ${var.skip_validation} ${local.options_string} ${local.custom_overlays_string} ${var.enable_all} ${var.enable_cluster_roles} ${var.enable_cluster_labels} ${var.enable_gcp_components} ${var.enable_registration} ${var.outdir} ${var.ca} ${local.ca_cert} ${local.ca_key} ${local.root_cert} ${local.cert_chain} ${local.service_account_string} ${local.key_file_string} ${local.asm_git_tag_string}"
99-
kubectl_destroy_command = "kubectl delete ns asm-system istio-system && kubectl label namespaces --all istio-injection-"
99+
kubectl_destroy_command = "${path.module}/scripts/destroy_asm.sh"
100100
}

modules/asm/scripts/destroy_asm.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2021 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
kubectl delete ns asm-system istio-system --ignore-not-found
20+
kubectl label namespaces --all istio-injection-

test/integration/node_pool/controls/gcloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
it "has the expected cluster autoscaling settings" do
3838
expect(data['autoscaling']).to eq({
3939
"autoprovisioningNodePoolDefaults" => {
40+
"imageType"=>"COS",
4041
"oauthScopes" => %w(https://www.googleapis.com/auth/cloud-platform),
4142
"serviceAccount" => "default"
4243
},

0 commit comments

Comments
 (0)