Skip to content

Commit f06ffc1

Browse files
committed
lib.sh: add annotate_self function
1 parent 00c0a68 commit f06ffc1

File tree

1 file changed

+11
-0
lines changed
  • scaletest/templates/scaletest-runner/scripts

1 file changed

+11
-0
lines changed

scaletest/templates/scaletest-runner/scripts/lib.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,14 @@ fetch_coder_full() {
295295
maybedryrun "${DRY_RUN}" chmod +x "${SCALETEST_CODER_BINARY}"
296296
log "Full Coder binary downloaded to ${SCALETEST_CODER_BINARY}"
297297
}
298+
299+
# set_status_annotation annotates the currently running pod with the key
300+
# com.coder.scaletest.status. It will overwrite the previous status.
301+
set_status_annotation() {
302+
if [[ $# -ne 1 ]]; then
303+
log "must specify an annotation value"
304+
exit 1
305+
else
306+
maybedryrun "${DRY_RUN}" kubectl --namespace "$(namespace)" annotate pod "$(hostname)" "com.coder.scaletest.status=$2" --overwrite
307+
fi
308+
}

0 commit comments

Comments
 (0)