Merge pull request #38433 from yuanying/remove-needless-config

Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Remove needless env var in OpenStack provider

**What this PR does / why we need it**:

If we use openstack provider to set up k8s cluster using kube-up script,
`TENANT_ID` environment variable is needed.
But to configure `TENANT_ID` is very annoying because this value is not static by each env.
This patch uses `TENANT_NAME` instead of `TENANT_ID`

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```

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`.
pull/6/head
Kubernetes Submit Queue 2017-01-03 23:28:07 -08:00 committed by GitHub
commit b202ebb7a5
6 changed files with 9 additions and 11 deletions

View File

@ -33,7 +33,7 @@ write_files:
username=$OS_USERNAME username=$OS_USERNAME
password=$OS_PASSWORD password=$OS_PASSWORD
region=$OS_REGION_NAME region=$OS_REGION_NAME
tenant-id=$OS_TENANT_ID tenant-name=$OS_TENANT_NAME
[LoadBalancer] [LoadBalancer]
lb-version=$LBAAS_VERSION lb-version=$LBAAS_VERSION
subnet-id=$SUBNET_ID subnet-id=$SUBNET_ID

View File

@ -123,9 +123,9 @@ parameters:
description: OpenStack Region Name description: OpenStack Region Name
default: false default: false
os_tenant_id: os_tenant_name:
type: string type: string
description: OpenStack Tenant ID description: OpenStack Tenant Name
default: false default: false
enable_proxy: enable_proxy:
@ -313,7 +313,7 @@ resources:
"$OS_USERNAME": {get_param: os_username} "$OS_USERNAME": {get_param: os_username}
"$OS_PASSWORD": {get_param: os_password} "$OS_PASSWORD": {get_param: os_password}
"$OS_REGION_NAME": {get_param: os_region_name} "$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} "$LBAAS_VERSION": {get_param: lbaas_version}
"$SUBNET_ID": {get_resource: fixed_subnet} "$SUBNET_ID": {get_resource: fixed_subnet}
"$FLOATING_NETWORK_ID": {get_attr: [kube_master_floating, floating_network_id]} "$FLOATING_NETWORK_ID": {get_attr: [kube_master_floating, floating_network_id]}
@ -422,7 +422,7 @@ resources:
os_username: {get_param: os_username} os_username: {get_param: os_username}
os_password: {get_param: os_password} os_password: {get_param: os_password}
os_region_name: {get_param: os_region_name} 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 } enable_proxy: {get_param: enable_proxy }
ftp_proxy: {get_param: ftp_proxy } ftp_proxy: {get_param: ftp_proxy }
http_proxy: {get_param: http_proxy } http_proxy: {get_param: http_proxy }

View File

@ -61,9 +61,9 @@ parameters:
description: OpenStack Region Name description: OpenStack Region Name
default: false default: false
os_tenant_id: os_tenant_name:
type: string type: string
description: OpenStack Tenant ID description: OpenStack Tenant Name
default: false default: false
enable_proxy: enable_proxy:
@ -216,7 +216,7 @@ resources:
"$OS_USERNAME": {get_param: os_username} "$OS_USERNAME": {get_param: os_username}
"$OS_PASSWORD": {get_param: os_password} "$OS_PASSWORD": {get_param: os_password}
"$OS_REGION_NAME": {get_param: os_region_name} "$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" "$role": "kubernetes-pool"
"$cluster_cidr": {get_param: cluster_cidr} "$cluster_cidr": {get_param: cluster_cidr}

View File

@ -22,5 +22,4 @@ export OS_USERNAME=${OS_USERNAME:-admin}
export OS_PASSWORD=${OS_PASSWORD:-secretsecret} export OS_PASSWORD=${OS_PASSWORD:-secretsecret}
export OS_AUTH_URL=${OS_AUTH_URL:-http://192.168.123.100:5000/v2.0} 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_NAME=${OS_TENANT_NAME:-admin}
export OS_TENANT_ID=${OS_TENANT_ID:-ed51b98b40944d89a449592eb67431eb}
export OS_REGION_NAME=${OS_REGION_NAME:-RegionOne} export OS_REGION_NAME=${OS_REGION_NAME:-RegionOne}

View File

@ -23,5 +23,4 @@ export OS_USERNAME=${OS_USERNAME:-admin}
export OS_PASSWORD=${OS_PASSWORD:-secretsecret} export OS_PASSWORD=${OS_PASSWORD:-secretsecret}
export OS_AUTH_URL=${OS_AUTH_URL:-http://192.168.123.100:5000/v2.0} 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_NAME=${OS_TENANT_NAME:-admin}
export OS_TENANT_ID=${OS_TENANT_ID:-ed51b98b40944d89a449592eb67431eb}
export OS_REGION_NAME=${OS_REGION_NAME:-RegionOne} export OS_REGION_NAME=${OS_REGION_NAME:-RegionOne}

View File

@ -217,7 +217,7 @@ function run-heat-script() {
--parameter os_username=${OS_USERNAME} \ --parameter os_username=${OS_USERNAME} \
--parameter os_password=${OS_PASSWORD} \ --parameter os_password=${OS_PASSWORD} \
--parameter os_region_name=${OS_REGION_NAME} \ --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 enable_proxy=${ENABLE_PROXY} \
--parameter ftp_proxy="${FTP_PROXY}" \ --parameter ftp_proxy="${FTP_PROXY}" \
--parameter http_proxy="${HTTP_PROXY}" \ --parameter http_proxy="${HTTP_PROXY}" \