Skip to content

Commit cfe788c

Browse files
committed
Add command defaults to some of the examples
Given the variable name `$PGO_CMD` can involve a lot of context and given that some of the examples may be run without the precursor "envs" executable being run, this adds a sane default of `kubectl` to some of the example scripts, while also indicating what are acceptable values, should one introspect the scripts. Issue: #1928
1 parent 4556643 commit cfe788c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/create-by-resource/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#########
1919

2020
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
21+
# PGO_CMD should either be "kubectl" or "oc" -- defaulting to kubectl
22+
PGO_CMD=${PGO_CMD:-kubectl}
2123

2224
# A namespace that exists in NAMESPACE env var - see examples/envs.sh
2325
export NS=pgouser1

examples/custom-config/create.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ function echo_info() {
2828

2929
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3030

31-
#Error if PGO_CMD not set
32-
if [[ -z ${PGO_CMD} ]]
33-
then
34-
echo_err "PGO_CMD is not set."
35-
fi
31+
# PGO_CMD should either be "kubectl" or "oc" -- defaulting to kubectl
32+
PGO_CMD=${PGO_CMD:-kubectl}
3633

3734
#Error is PGO_NAMESPACE not set
3835
if [[ -z ${PGO_NAMESPACE} ]]

0 commit comments

Comments
 (0)