Skip to content

Commit 903e6b5

Browse files
author
Graham Whaley
authored
Merge pull request clearcontainers#439 from MarioCarrilloA/runtime
metrics: Fix the path/name of the runtime used
2 parents b00d8f1 + 4854166 commit 903e6b5

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

metrics/lib/send_results.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ source "${SCRIPT_PATH}/common.bash"
3232
RESULT_DIR="${SCRIPT_PATH}/../results"
3333

3434
GROUP="PNP"
35+
BINDIR_LOCAL_PATH="/usr/local/bin"
3536
COR_DEFAULT_PATH="/usr/bin"
3637
COR_DEFAULT_NAME="cc-oci-runtime"
3738
RUNC_DEFAULT_PATH="/usr/bin"
3839
RUNC_DEFAULT_NAME="docker-runc"
39-
CC_RUNTIME_DEFAULT_PATH="/usr/local/bin"
40+
CC_RUNTIME_DEFAULT_PATH="/usr/bin"
4041
CC_RUNTIME_DEFAULT_NAME="cc-runtime"
4142
CC_DEFAULT_IMG_PATH="/usr/share/clear-containers"
4243
CONTAINERS_IMG_SYSTEM="/usr/share/clear-containers/clear-containers.img"
@@ -122,15 +123,26 @@ function get_runtime_info()
122123

123124
case "$RUNTIME" in
124125
cc-runtime)
125-
result="$(get_runtime_version ${COR_DEFAULT_PATH} ${COR_DEFAULT_NAME})"
126+
# First look for a cc-runtime local installation
127+
if [ -f "$BINDIR_LOCAL_PATH/$CC_RUNTIME_DEFAULT_NAME" ]; then
128+
CC_RUNTIME_DEFAULT_PATH="$BINDIR_LOCAL_PATH"
129+
fi
130+
131+
result="$(get_runtime_version ${CC_RUNTIME_DEFAULT_PATH} ${CC_RUNTIME_DEFAULT_NAME})"
126132
;;
127133

128134
cor)
129-
result="$(get_runtime_version ${RUNC_DEFAULT_PATH} ${RUNC_DEFAULT_NAME})"
135+
# First look for a cor local installation
136+
if [ -f "$BINDIR_LOCAL_PATH/$COR_DEFAULT_NAME" ]; then
137+
COR_DEFAULT_PATH="$BINDIR_LOCAL_PATH"
138+
fi
139+
140+
result="$(get_runtime_version ${COR_DEFAULT_PATH} ${COR_DEFAULT_NAME})"
141+
130142
;;
131143

132144
runc)
133-
result="$(get_runtime_version ${CC_RUNTIME_DEFAULT_PATH} ${CC_RUNTIME_DEFAULT_NAME})"
145+
result="$(get_runtime_version ${RUNC_DEFAULT_PATH} ${RUNC_DEFAULT_NAME})"
134146
;;
135147

136148
*)

0 commit comments

Comments
 (0)