From 9dc2bb7521d525b9fda0ff7e4a286380b9667e3f Mon Sep 17 00:00:00 2001
From: DanielZhangQD <zhanghailong810@aliyun.com>
Date: Mon, 30 Sep 2019 15:06:45 +0800
Subject: [PATCH] fix values file customization for tidb-operator on aliyun

---
 deploy/aliyun/main.tf      | 4 ++--
 deploy/aliyun/variables.tf | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/deploy/aliyun/main.tf b/deploy/aliyun/main.tf
index f194dd67c77..a5ae6c54430 100644
--- a/deploy/aliyun/main.tf
+++ b/deploy/aliyun/main.tf
@@ -31,10 +31,10 @@ module "tidb-operator" {
 
   region                        = var.ALICLOUD_REGION
   access_key                    = var.ALICLOUD_ACCESS_KEY
-  secret_key                 = var.ALICLOUD_SECRET_KEY
+  secret_key                    = var.ALICLOUD_SECRET_KEY
   cluster_name                  = var.cluster_name
   operator_version              = var.operator_version
-  operator_helm_values          = var.operator_helm_values
+  operator_helm_values          = var.operator_helm_values == "" ? "" : file(var.operator_helm_values)
   k8s_pod_cidr                  = var.k8s_pod_cidr
   k8s_service_cidr              = var.k8s_service_cidr
   vpc_cidr                      = var.vpc_cidr
diff --git a/deploy/aliyun/variables.tf b/deploy/aliyun/variables.tf
index 95d0b4b93ac..55b208cd57f 100644
--- a/deploy/aliyun/variables.tf
+++ b/deploy/aliyun/variables.tf
@@ -14,10 +14,16 @@ variable "operator_version" {
 }
 
 variable "operator_helm_values" {
+  description = "The helm values file for TiDB Operator, path is relative to current working dir"
   type = string
   default = ""
 }
 
+variable "override_values" {
+  description = "The helm values file for TiDB Cluster, path is relative to current working dir"
+  default     = ""
+}
+
 variable "bastion_ingress_cidr" {
   description = "Bastion ingress security rule cidr, it is highly recommended to set this in favor of safety"
   default     = "0.0.0.0/0"