-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Francois Laupretre
committed
May 31, 2024
1 parent
ae21243
commit 939bbc5
Showing
6 changed files
with
124 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
# Google IAP Gateway | ||
# | ||
#------WARNING--WARNING--WARNING--WARNING--WARNING--WARNING--WARNING-- | ||
# | ||
# The code below is purely EXPERIMENTAL. I wrote it | ||
# from information I got on the Internet and I could not | ||
# test it as I don't have access to a GCP platform. | ||
# | ||
# If you have access to a GCP platform and can test this, your return will be | ||
# warmly appreciated. | ||
#---------------------------------------------------------------------------- | ||
|
||
# prevent connection error 'Login profile size exceeds 32 KiB' | ||
# https://github.com/kyma-project/test-infra/issues/93#issuecomment-457263589 | ||
account=`echo $(gcloud config list account --format "value(core.account)")` | ||
account=`echo $($TUNNEL_GCLOUD_CMD config list account --format "value(core.account)")` | ||
|
||
for key in $(gcloud compute os-login ssh-keys list | grep -v FINGERPRINT); do | ||
for key in $($TUNNEL_GCLOUD_CMD compute os-login ssh-keys list | grep -v FINGERPRINT); do | ||
echo "SSH key '$key' for account '$account' removed" | ||
gcloud compute os-login ssh-keys remove --key $key | ||
$TUNNEL_GCLOUD_CMD compute os-login ssh-keys remove --key $key | ||
done | ||
|
||
gw="$TUNNEL_GATEWAY_HOST" | ||
[ "X$TUNNEL_GATEWAY_USER" = X ] || gw="$TUNNEL_GATEWAY_USER@$TUNNEL_GATEWAY_HOST" | ||
|
||
$TUNNEL_SSH_CMD compute ssh -q \ | ||
project="" | ||
[ "X$TUNNEL_IAP_PROJECT" = X ] || project="--project \"$TUNNEL_IAP_PROJECT\"" | ||
|
||
zone="" | ||
[ "X$TUNNEL_IAP_ZONE" = X ] || zone="--zone \"$TUNNEL_IAP_ZONE\"" | ||
|
||
$TUNNEL_GCLOUD_CMD compute ssh -q \ | ||
--tunnel-through-iap \ | ||
--ssh-key-expire-after "$TUNNEL_TIMEOUT" \ | ||
--ssh-flag="-N -L $TUNNEL_LOCAL_HOST:$TUNNEL_LOCAL_PORT:$TUNNEL_TARGET_HOST:$TUNNEL_TARGET_PORT" \ | ||
$gw --project $TUNNEL_IAP_GCP_PROJECT --zone $TUNNEL_IAP_GCP_ZONE & | ||
$project \ | ||
$zone \ | ||
$gw & | ||
|
||
TUNNEL_PID=$! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.