diff --git a/docs/development/adding_a_feature.md b/docs/development/adding_a_feature.md index 6c40840d9b..78b365d63d 100644 --- a/docs/development/adding_a_feature.md +++ b/docs/development/adding_a_feature.md @@ -198,7 +198,7 @@ and then push nodeup using: export S3_BUCKET_NAME= make upload S3_BUCKET=s3://${S3_BUCKET_NAME} VERSION=dev -export KOPS_URL=https://${S3_BUCKET_NAME}.s3.amazonaws.com/kops/dev/ +export KOPS_BASE_URL=https://${S3_BUCKET_NAME}.s3.amazonaws.com/kops/dev/ kops create cluster --zones us-east-1b ... diff --git a/hack/dev-build.sh b/hack/dev-build.sh index 30e5c592c4..a599ba16e3 100755 --- a/hack/dev-build.sh +++ b/hack/dev-build.sh @@ -75,7 +75,7 @@ cd $KOPS_DIRECTORY/.. GIT_VER=git-$(git describe --always) [ -z "$GIT_VER" ] && echo "we do not have GIT_VER something is very wrong" && exit 1; -KOPS_URL="https://${NODEUP_BUCKET}.s3.amazonaws.com/kops/${GIT_VER}/" +KOPS_BASE_URL="https://${NODEUP_BUCKET}.s3.amazonaws.com/kops/${GIT_VER}/" echo ========== echo "Starting build" @@ -94,7 +94,7 @@ kops delete cluster \ echo ========== echo "Creating cluster ${CLUSTER_NAME}" -KOPS_URL=${KOPS_URL} kops create cluster \ +KOPS_BASE_URL=${KOPS_BASE_URL} kops create cluster \ --name $CLUSTER_NAME \ --state $KOPS_STATE_STORE \ --node-count $NODE_COUNT \ diff --git a/upup/pkg/fi/cloudup/urls.go b/upup/pkg/fi/cloudup/urls.go index 9da0a4e3a9..05b206d1b7 100644 --- a/upup/pkg/fi/cloudup/urls.go +++ b/upup/pkg/fi/cloudup/urls.go @@ -33,7 +33,15 @@ func BaseUrl() string { return baseUrl } - baseUrl = os.Getenv("KOPS_URL") + // We prefer KOPS_BASE_URL, but we will accept KOPS_URL (for now!) + baseUrl = os.Getenv("KOPS_BASE_URL") + if baseUrl == "" { + baseUrl = os.Getenv("KOPS_URL") + if baseUrl != "" { + glog.Warningf("Using deprecated KOPS_URL envrionment variable - please use KOPS_BASE_URL instead") + } + } + if baseUrl == "" { baseUrl = "https://kubeupv2.s3.amazonaws.com/kops/" + kops.Version + "/" glog.V(4).Infof("Using default base url: %q", baseUrl)