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 spin cli configuration optional #215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions scripts/expose/configure_iap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ $EXISTING_SECRET_NAME == 'null' ]; then
read -p 'Enter your OAuth credentials Client ID: ' CLIENT_ID
read -p 'Enter your OAuth credentials Client secret: ' CLIENT_SECRET

if [[ ($CONFIGURE_SPIN_CLI=="YES")||(-z "$CONFIGURE_SPIN_CLI") ]]; then
cat >~/.spin/config <<EOL
gate:
endpoint: https://$DOMAIN_NAME/gate
Expand All @@ -35,10 +36,10 @@ EOL
--filter="displayName:$SERVICE_ACCOUNT_NAME" \
--format='value(email)')

gcloud iam service-accounts keys create ~/.spin/key.json \
--iam-account $SA_EMAIL \
--project $PROJECT_ID

gcloud iam service-accounts keys create ~/.spin/key.json \
--iam-account $SA_EMAIL \
--project $PROJECT_ID
fi
kubectl create secret generic $SECRET_NAME -n spinnaker --from-literal=client_id=$CLIENT_ID \
--from-literal=client_secret=$CLIENT_SECRET
else
Expand Down
2 changes: 2 additions & 0 deletions scripts/install/setup_properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export PUBSUB_NOTIFICATION_TOPIC=\$DEPLOYMENT_NAME-notifications-topic
export STATIC_IP_NAME=\$DEPLOYMENT_NAME-external-ip
export MANAGED_CERT=\$DEPLOYMENT_NAME-managed-cert
export SECRET_NAME=\$DEPLOYMENT_NAME-oauth-client-secret
# Configure spin cli for access through IAP
export CONFIGURE_SPIN_CLI=YES

# If you own a domain name and want to use that instead of this automatically-assigned one,
# specify it here (you must be able to configure the dns settings).
Expand Down
2 changes: 2 additions & 0 deletions scripts/manage/add_missing_properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ add_property_if_missing CONFIG_CSR_REPO "$CSR_PROPERTY_DECLARATION"
add_property_if_missing NETWORK_PROJECT "export NETWORK_PROJECT=\$PROJECT_ID"
add_property_if_missing NETWORK_REFERENCE "export NETWORK_REFERENCE=projects/\$NETWORK_PROJECT/global/networks/\$NETWORK"
add_property_if_missing SUBNET_REFERENCE "export SUBNET_REFERENCE=projects/\$NETWORK_PROJECT/regions/\$REGION/subnetworks/\$SUBNET"

add_property_if_missing CONFIGURE_SPIN_CLI "export CONFIGURE_SPIN_CLI=YES"