sl1pm4t / k2tf

Kubernetes YAML to Terraform HCL converter
Mozilla Public License 2.0
1.19k stars 107 forks source link

HCL doesn't render Deployment properly if multiple containers defined #1

Closed sl1pm4t closed 5 years ago

sl1pm4t commented 5 years ago

Second container block incorrectly named 'tty'.

resource "kubernetes_deployment" "backend_api" {
  metadata {
    name = "backend-api"
  }
  spec {
    selector {
      match_labels {
        app = "backend-api"
      }
    }
    template {
      metadata {
        labels {
          app = "backend-api"
        }
      }
      spec {
        container {
          name  = "esp"
          image = "gcr.io/image:1"
          args  = ["--ssl_port", "443"]
          port {
            container_port = 443
            protocol       = "TCP"
          }
        }
        tty {
          name    = "api"
          image   = "gcr.io/project/backend-api:0.3.15"
          command = ["/root/backend-api"]
        }
      }
    }
  }
}