completed upto lab 38
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$distribution = 'Ubuntu-24.04'
|
||||
$linuxScript = (& wsl.exe --distribution $distribution --user root --exec wslpath -a "$PSScriptRoot/enter-lab.sh").Trim()
|
||||
if (-not $linuxScript) { throw 'Could not locate the Linux lab entry script.' }
|
||||
|
||||
& wsl.exe --distribution $distribution --user root --exec bash -lc @'
|
||||
export KUBECONFIG=/opt/cks-lab/kubeconfig
|
||||
context="$(kubectl config current-context 2>/dev/null || true)"
|
||||
if [[ "$context" != "kind-cks-lab" ]]; then
|
||||
echo "Safety check failed: expected kind-cks-lab, got ${context:-none}." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "CKS lab: $(kubectl version --output=json | jq -r .serverVersion.gitVersion)"
|
||||
echo "Context: $context"
|
||||
exec bash
|
||||
'@
|
||||
& wsl.exe --distribution $distribution --user root --exec bash $linuxScript
|
||||
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Could not enter the isolated CKS lab.' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user