Made it so that existing Openstack environment variables are used.

If someone has an openrc as part of their profile, this will make kube-up work automatically.

The only things that have to be modified are in config-default.sh, either by editing the file or setting environment variables.
This commit is contained in:
Elson O Rodriguez 2016-04-13 12:30:29 -07:00 committed by Lukasz Zajaczkowski
parent 126b6c0950
commit 21627f5b7e
3 changed files with 16 additions and 15 deletions

View File

@ -15,10 +15,11 @@
# limitations under the License.
## Enviroment variables for the OpenStack command-line client
## Values set via an openrc will override these defaults.
export OS_IDENTITY_API_VERSION=2.0
export OS_USERNAME=admin
export OS_PASSWORD=secretsecret
export OS_AUTH_URL=http://192.168.123.100:5000/v2.0
export OS_TENANT_NAME=admin
export OS_TENANT_ID=ed51b98b40944d89a449592eb67431eb
export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-2.0}
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}

View File

@ -15,12 +15,12 @@
# limitations under the License.
## Enviroment variables for the OpenStack Swift command-line client. This is required for CityCloud
## provider where Swift has different credentials. When Swift is part of your OpenStack use the same
## settings as in openrc-default.sh
## provider where Swift has different credentials. When Swift is part of your OpenStack do not
## modify these settings.
export OS_IDENTITY_API_VERSION=2.0
export OS_USERNAME=admin
export OS_PASSWORD=secretsecret
export OS_AUTH_URL=http://192.168.123.100:5000/v2.0
export OS_TENANT_NAME=admin
export OS_TENANT_ID=ed51b98b40944d89a449592eb67431eb
export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-2.0}
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}

View File

@ -91,7 +91,7 @@ function create-stack() {
echo "[INFO] Execute commands to create Kubernetes cluster"
# It is required for some cloud provider like CityCloud where swift client has different credentials
source "${ROOT}/openrc-swift.sh"
if [[ -z "${OS_PROJECT_ID}" ]]; then
if [[ -z ${OS_PROJECT_ID+x} ]]; then
SWIFT_PROJECT_ID="${OS_TENANT_ID}"
else
SWIFT_PROJECT_ID="${OS_PROJECT_ID}"