From d5e039c9473ce19375fce5dc77d66653114d9223 Mon Sep 17 00:00:00 2001 From: "OTSUKA, Yuanying" Date: Fri, 9 Dec 2016 11:09:58 +0900 Subject: [PATCH] Remove needless env var in OpenStack provider Since `TENANT_NAME` is unique if we use keystone v2 api, so `TENANT_ID` is not needed if `TENANT_NAME` is provided to configure OpenStack provider. And also to set `TENANT_ID` is annoying to develop, because `TENANT_ID` is not static by each environment. This patch remove dependency of `TENANT_ID` and simply use `TENANT_NAME`. --- .../kubernetes-heat/fragments/configure-salt.yaml | 2 +- cluster/openstack-heat/kubernetes-heat/kubecluster.yaml | 8 ++++---- cluster/openstack-heat/kubernetes-heat/kubeminion.yaml | 6 +++--- cluster/openstack-heat/openrc-default.sh | 1 - cluster/openstack-heat/openrc-swift.sh | 1 - cluster/openstack-heat/util.sh | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cluster/openstack-heat/kubernetes-heat/fragments/configure-salt.yaml b/cluster/openstack-heat/kubernetes-heat/fragments/configure-salt.yaml index 59abb9b4a27..2b08850b19d 100644 --- a/cluster/openstack-heat/kubernetes-heat/fragments/configure-salt.yaml +++ b/cluster/openstack-heat/kubernetes-heat/fragments/configure-salt.yaml @@ -32,7 +32,7 @@ write_files: username=$OS_USERNAME password=$OS_PASSWORD region=$OS_REGION_NAME - tenant-id=$OS_TENANT_ID + tenant-name=$OS_TENANT_NAME [LoadBalancer] lb-version=$LBAAS_VERSION subnet-id=$SUBNET_ID diff --git a/cluster/openstack-heat/kubernetes-heat/kubecluster.yaml b/cluster/openstack-heat/kubernetes-heat/kubecluster.yaml index bae3cf83b96..ea69a6a00ca 100644 --- a/cluster/openstack-heat/kubernetes-heat/kubecluster.yaml +++ b/cluster/openstack-heat/kubernetes-heat/kubecluster.yaml @@ -106,9 +106,9 @@ parameters: description: OpenStack Region Name default: false - os_tenant_id: + os_tenant_name: type: string - description: OpenStack Tenant ID + description: OpenStack Tenant Name default: false enable_proxy: @@ -296,7 +296,7 @@ resources: "$OS_USERNAME": {get_param: os_username} "$OS_PASSWORD": {get_param: os_password} "$OS_REGION_NAME": {get_param: os_region_name} - "$OS_TENANT_ID": {get_param: os_tenant_id} + "$OS_TENANT_NAME": {get_param: os_tenant_name} "$LBAAS_VERSION": {get_param: lbaas_version} "$SUBNET_ID": {get_resource: fixed_subnet} "$FLOATING_NETWORK_ID": {get_attr: [kube_master_floating, floating_network_id]} @@ -401,7 +401,7 @@ resources: os_username: {get_param: os_username} os_password: {get_param: os_password} os_region_name: {get_param: os_region_name} - os_tenant_id: {get_param: os_tenant_id} + os_tenant_name: {get_param: os_tenant_name} enable_proxy: {get_param: enable_proxy } ftp_proxy: {get_param: ftp_proxy } http_proxy: {get_param: http_proxy } diff --git a/cluster/openstack-heat/kubernetes-heat/kubeminion.yaml b/cluster/openstack-heat/kubernetes-heat/kubeminion.yaml index a51aab2a22b..8fced2855db 100644 --- a/cluster/openstack-heat/kubernetes-heat/kubeminion.yaml +++ b/cluster/openstack-heat/kubernetes-heat/kubeminion.yaml @@ -61,9 +61,9 @@ parameters: description: OpenStack Region Name default: false - os_tenant_id: + os_tenant_name: type: string - description: OpenStack Tenant ID + description: OpenStack Tenant Name default: false enable_proxy: @@ -213,7 +213,7 @@ resources: "$OS_USERNAME": {get_param: os_username} "$OS_PASSWORD": {get_param: os_password} "$OS_REGION_NAME": {get_param: os_region_name} - "$OS_TENANT_ID": {get_param: os_tenant_id} + "$OS_TENANT_NAME": {get_param: os_tenant_name} "$role": "kubernetes-pool" run_salt: diff --git a/cluster/openstack-heat/openrc-default.sh b/cluster/openstack-heat/openrc-default.sh index 77a95f9e280..214b975675a 100644 --- a/cluster/openstack-heat/openrc-default.sh +++ b/cluster/openstack-heat/openrc-default.sh @@ -22,5 +22,4 @@ export OS_USERNAME=${OS_USERNAME:-admin} export OS_PASSWORD=${OS_PASSWORD:-secretsecret} export OS_AUTH_URL=${OS_AUTH_URL:-http://192.168.123.100:5000/v2.0} export OS_TENANT_NAME=${OS_TENANT_NAME:-admin} -export OS_TENANT_ID=${OS_TENANT_ID:-ed51b98b40944d89a449592eb67431eb} export OS_REGION_NAME=${OS_REGION_NAME:-RegionOne} diff --git a/cluster/openstack-heat/openrc-swift.sh b/cluster/openstack-heat/openrc-swift.sh index 74c2178b327..fdb2c5ac3c9 100644 --- a/cluster/openstack-heat/openrc-swift.sh +++ b/cluster/openstack-heat/openrc-swift.sh @@ -23,5 +23,4 @@ export OS_USERNAME=${OS_USERNAME:-admin} export OS_PASSWORD=${OS_PASSWORD:-secretsecret} export OS_AUTH_URL=${OS_AUTH_URL:-http://192.168.123.100:5000/v2.0} export OS_TENANT_NAME=${OS_TENANT_NAME:-admin} -export OS_TENANT_ID=${OS_TENANT_ID:-ed51b98b40944d89a449592eb67431eb} export OS_REGION_NAME=${OS_REGION_NAME:-RegionOne} diff --git a/cluster/openstack-heat/util.sh b/cluster/openstack-heat/util.sh index 785286c2bd8..4eec9513674 100644 --- a/cluster/openstack-heat/util.sh +++ b/cluster/openstack-heat/util.sh @@ -217,7 +217,7 @@ function run-heat-script() { --parameter os_username=${OS_USERNAME} \ --parameter os_password=${OS_PASSWORD} \ --parameter os_region_name=${OS_REGION_NAME} \ - --parameter os_tenant_id=${OS_TENANT_ID} \ + --parameter os_tenant_name=${OS_TENANT_NAME} \ --parameter enable_proxy=${ENABLE_PROXY} \ --parameter ftp_proxy="${FTP_PROXY}" \ --parameter http_proxy="${HTTP_PROXY}" \