blob: e1e1527db7b27b1c3be643c5c4a11d8828096c9f [file] [log] [blame]
David K. Bainbridgeebf38d92020-02-10 10:46:31 -08001#!/usr/bin/env bash
David Bainbridge33e56c72020-06-11 11:39:56 -07002REQ=$(test $# -gt 0 && echo $1 || echo 0)
3IDX=$((REQ + 1))
David K. Bainbridgeebf38d92020-02-10 10:46:31 -08004set -x
David Bainbridge33e56c72020-06-11 11:39:56 -07005BBSIM=$(kubectl get --all-namespaces -l app=bbsim svc -o json | jq -r '.items[] | .metadata.name + "." + .metadata.namespace + ".svc:50060"' | sed "$IDX!d")
6set +x
7if [[ -z "$BBSIM" ]]; then
8 >&2 echo "ERROR: No BBSIM instance found as index '$REQ'"
9 exit 1
10fi
11set -x
David Bainbridgeb9093522020-04-15 14:32:44 -070012exec voltctl device enable "$(voltctl device create -t openolt -H "$BBSIM")"