terraform-google-modules/terraform-google-gcloud

additional_components null resource exists with not found - wrong shebang

grieshaber opened this issue · 3 comments

TL;DR

The null resource for additional components uses a local-exec provider. This means, the executed command will be something like bin/sh -c <command>.
The script scripts/check_components.sh contains the shebang line #!/bin/bash. Running on images without a bash, but with a sh (like basic alpine images), the command will fail.

Expected behavior

The command script will be exectuted successfully.

Observed behavior

The script exits with exit code 127 - command not found

Terraform Configuration

# pasted from https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/dns.tf
module "gcloud_delete_default_kube_dns_configmap" {
  source                      = "terraform-google-modules/gcloud/google//modules/kubectl-wrapper"
  version                     = "~> 2.1.0"
  enabled                     = (local.custom_kube_dns_config || local.upstream_nameservers_config) && !var.skip_provisioners
  cluster_name                = google_container_cluster.primary.name
  cluster_location            = google_container_cluster.primary.location
  project_id                  = var.project_id
  upgrade                     = var.gcloud_upgrade
  impersonate_service_account = var.impersonate_service_account

  kubectl_create_command  = "${path.module}/scripts/delete-default-resource.sh kube-system configmap kube-dns"
  kubectl_destroy_command = ""

  module_depends_on = concat(
    [google_container_cluster.primary.master_version],
    [for pool in google_container_node_pool.pools : pool.name]
  )
}

Terraform Version

➜  terraform version
Terraform v1.1.3

Additional information

No response

Would it be possible to cut a release to bring this change into a tagged version? Other google-hosted modules call this module with a version = "~> 3.1" version constraint, and so it's not possible to bring this change in until a new release is cut.

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days