blob: e1e1527db7b27b1c3be643c5c4a11d8828096c9f [file] [log] [blame]
#!/usr/bin/env bash
REQ=$(test $# -gt 0 && echo $1 || echo 0)
IDX=$((REQ + 1))
set -x
BBSIM=$(kubectl get --all-namespaces -l app=bbsim svc -o json | jq -r '.items[] | .metadata.name + "." + .metadata.namespace + ".svc:50060"' | sed "$IDX!d")
set +x
if [[ -z "$BBSIM" ]]; then
>&2 echo "ERROR: No BBSIM instance found as index '$REQ'"
exit 1
fi
set -x
exec voltctl device enable "$(voltctl device create -t openolt -H "$BBSIM")"