Skip to content
This repository was archived by the owner on Feb 20, 2021. It is now read-only.

Commit c64ba10

Browse files
committed
src: add usage label to Dockerfile
Fixes: #107
1 parent 8de204e commit c64ba10

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ LABEL io.k8s.description="$DESCRIPTION" \
3838
summary="$SUMMARY" \
3939
description="$DESCRIPTION" \
4040
version="$NODE_VERSION" \
41-
name="nodeshift/centos7-s2i-nodejs"
41+
name="nodeshift/centos7-s2i-nodejs" \
42+
usage="s2i build . nodeshift/centos7-s2i-nodejs myapp"
4243

4344
COPY ./s2i/ $STI_SCRIPTS_PATH
4445
COPY ./contrib/ /opt/app-root

test/run.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,20 @@ url.https://github.com.insteadof=ssh://git@github.com"
259259
fi
260260
}
261261

262+
test_image_usage_label() {
263+
local expected="s2i build . nodeshift/centos7-s2i-nodejs myapp"
264+
echo "Checking image usage label ..."
265+
out=$(docker inspect --format '{{ index .Config.Labels "usage" }}' $BUILDER)
266+
if ! echo "${out}" | grep -q "${expected}"; then
267+
echo "ERROR[docker inspect --format \"{{ index .Config.Labels \"usage\" }}\"] Expected '${expected}', got '${out}'"
268+
return 1
269+
fi
270+
}
271+
262272
prepare
273+
test_image_usage_label
274+
check_result $?
275+
263276
test_builder_node_version
264277
check_result $?
265278

0 commit comments

Comments
 (0)