Better ephemeral workspace support with Codespaces
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
committed by
GitHub
parent
b65faa6a55
commit
6239bc017a
20
developer-workspace/codespaces/prepare-kind.sh
Executable file
20
developer-workspace/codespaces/prepare-kind.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
which kind
|
||||
if [[ $? != 0 ]]; then
|
||||
echo 'kind not available in $PATH, installing latest kind'
|
||||
# Install latest kind
|
||||
curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest \
|
||||
| grep "browser_download_url.*kind-linux-amd64" \
|
||||
| cut -d : -f 2,3 \
|
||||
| tr -d \" \
|
||||
| wget -qi -
|
||||
mv kind-linux-amd64 kind && chmod +x kind
|
||||
fi
|
||||
|
||||
cluster_created=$($PWD/kind get clusters 2>&1)
|
||||
if [[ "$cluster_created" == "No kind clusters found." ]]; then
|
||||
$PWD/kind create cluster
|
||||
else
|
||||
echo "Cluster '$cluster_created' already present"
|
||||
fi
|
||||
Reference in New Issue
Block a user