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

Check OBSERVABILITY_CONFIG_ACCESS_TOKEN can be used to access the con… #219

Merged
Merged
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
13 changes: 13 additions & 0 deletions kas-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ read_kas_installer_env_file() {
fi
}

check_observability_token() {
echo "Checking validity of OBSERVABILITY_CONFIG_ACCESS_TOKEN"
curl --silent \
--head \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer ${OBSERVABILITY_CONFIG_ACCESS_TOKEN}" \
${OBSERVABILITY_CONFIG_REPO} \
--fail > /dev/null \
|| ( echo "failed to get observability config repo contents with OBSERVABILITY_CONFIG_ACCESS_TOKEN, check expiry and permissions" && exit 1 )
echo "OBSERVABILITY_CONFIG_ACCESS_TOKEN valid"
}

generate_kas_fleet_manager_env_config() {
echo "Generating KAS Fleet Manager configuration env file '${KAS_FLEET_MANAGER_DEPLOY_ENV_FILE} ...'"
# Make sure KAS Fleet Manager env file is empty
Expand Down Expand Up @@ -169,6 +181,7 @@ deploy_observatorium() {
# Main body of the script starts here

read_kas_installer_env_file
check_observability_token

# Deploy and configure MAS SSO
if [ "${SSO_PROVIDER_TYPE}" = "mas_sso" ] || [ -z "${MAS_SSO_BASE_URL:-}" ] ; then
Expand Down