Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make BOSH_CA_CERT optional #6

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource_types:
must be specified via out parameters, as documented below.
* `client`: *Required.* The username or UAA client ID for the BOSH director.
* `client_secret`: *Required.* The password or UAA client secret for the BOSH director.
* `ca_cert`: *Required.* CA certificate used to validate SSL connections to Director and UAA. If omitted, the director's
* `ca_cert`: *Optional.* CA certificate used to validate SSL connections to Director and UAA. If omitted, the director's
certificate must be already trusted.
* `config`: *Required.* Type of config to update, valid values are: `cloud` and `runtime`
* `name`: *Optional.* Property for named-configs. If omitted, will default to `default`
Expand Down
13 changes: 3 additions & 10 deletions assets/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ cat > $payload <&0
target=$(jq -r '.source.target // ""' < $payload)
client="$(jq -r '.source.client // ""' < $payload)"
client_secret=$(jq -r '.source.client_secret // ""' < $payload)
ca_cert=$(jq -r '.source.ca_cert // ""' < $payload)
ca_cert=$(jq -r '.source.ca_cert // null' < $payload)
config=$(jq -r '.source.config // ""' < $payload)
name=$(jq -r '.source.name // ""' < $payload)
name=$(jq -r '.source.name // ""' < $payload)

if [ -z "$name" ]; then
name=default
Expand All @@ -34,13 +34,6 @@ then
exit 1
fi

if [ -z "$ca_cert" ]
then
echo >&2 "invalid payload (missing source.ca_cert):"
cat $payload >&2
exit 1
fi

if [[ "$config" != "cloud" && "$config" != "runtime" ]]
then
echo >&2 "invalid payload (source.config should be 'cloud' or 'runtime'):"
Expand All @@ -51,7 +44,7 @@ fi
export BOSH_ENVIRONMENT="${target}"
export BOSH_CLIENT="${client}"
export BOSH_CLIENT_SECRET="${client_secret}"
export BOSH_CA_CERT="${ca_cert}"
[[ "$ca_cert" != "null" ]] && export BOSH_CA_CERT="${ca_cert}"
export BOSH_NON_INTERACTIVE=1

calc_reference() {
Expand Down