David K. Bainbridge | ebf38d9 | 2020-02-10 10:46:31 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
David Bainbridge | e1b1e08 | 2020-06-10 12:00:12 -0700 | [diff] [blame^] | 2 | REQ=$(test $# -gt 0 && echo $1 || echo 0) |
| 3 | IDX=$((REQ + 1)) |
David K. Bainbridge | ebf38d9 | 2020-02-10 10:46:31 -0800 | [diff] [blame] | 4 | set -x |
David Bainbridge | e1b1e08 | 2020-06-10 12:00:12 -0700 | [diff] [blame^] | 5 | BBSIM=$(kubectl get --all-namespaces -l app=bbsim svc -o json | jq -r '.items[] | .metadata.name + "." + .metadata.namespace + ".svc:50060"' | sed "$IDX!d") |
| 6 | set +x |
| 7 | if [[ -z "$BBSIM" ]]; then |
| 8 | >&2 echo "ERROR: No BBSIM instance found as index '$REQ'" |
| 9 | exit 1 |
| 10 | fi |
| 11 | set -x |
David Bainbridge | b909352 | 2020-04-15 14:32:44 -0700 | [diff] [blame] | 12 | exec voltctl device enable "$(voltctl device create -t openolt -H "$BBSIM")" |