Skip to content

Commit

Permalink
cf-target: do not assume api url from env name
Browse files Browse the repository at this point in the history
Looks like the api url is now named
"api.$ENV_NAME.$RANDOM_STRING.shepherd.lease"
  • Loading branch information
arjun024 committed Jan 2, 2024
1 parent 0f884c4 commit 55af879
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/cf-target
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ function login_to_existing_env() {
local env_name

env_name="$(jq -r .name "/tmp/${lease_id}.json")"
util::print::info "Logging into environment ${env_name} from lease ${lease_id}...."
api_url="$(jq -r .cf.api_url "/tmp/${lease_id}.json")"
util::print::info "Logging into environment ${env_name} (api: ${api_url}), from lease ${lease_id}...."

eval "$(bbl print-env --metadata-file "/tmp/${lease_id}.json")"

export CF_USERNAME=admin
export CF_PASSWORD=$(credhub get -n "/bosh-${env_name}/cf/cf_admin_password" -q)

cf api "api.${env_name}.cf-app.com" --skip-ssl-validation
cf api "${api_url}" --skip-ssl-validation
cf auth
cf target -o system
cf create-space my-space
Expand Down

0 comments on commit 55af879

Please sign in to comment.