Ensure teleport cache directory is symlink

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2024-02-21 15:48:00 +00:00
parent 071195304d
commit 028487c55a
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78

View File

@ -71,6 +71,12 @@ case ${#POS_ARGS[@]} in
opsctl login ${DEBUG} ${POS_ARGS[@]} opsctl login ${DEBUG} ${POS_ARGS[@]}
else else
echo "Logging in with Teleport. Cluster: '${TELEPORT_CLUSTER_NAME}'" echo "Logging in with Teleport. Cluster: '${TELEPORT_CLUSTER_NAME}'"
# Make sure that caching is disabled to avoid issues with cross-cluster cache pollution
TELEPORT_CACHE_DIR="${HOME}/.kube/cache/discovery/teleport.giantswarm.io_443"
if [[ "$(readlink -f ${TELEPORT_CACHE_DIR})" != "/dev/null" ]]; then
rm -rf ${TELEPORT_CACHE_DIR}
ln -s /dev/null ${TELEPORT_CACHE_DIR}
fi
tsh kube login ${TELEPORT_CLUSTER_NAME} tsh kube login ${TELEPORT_CLUSTER_NAME}
fi fi
;; ;;