-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally avoid sleeping in
entrypoint.sh
Container image might be used as `initcontainers` in kubernetes Pods. In such scenarios, it's important for the image entrypoint to exits once the copy logic is completed. Otherwise, the pod would stuck in a `PodInitializing` phase. Add Makefile rule `image-test` to check the integrity of the entrypoint.sh script. https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Signed-off-by: Andrea Panattoni <[email protected]>
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
set -x | ||
|
||
OCI_RUNTIME=$1 | ||
IMAGE_UNDER_TEST=$2 | ||
|
||
OUTPUT_DIR=`mktemp -d` | ||
|
||
${OCI_RUNTIME} run -v ${OUTPUT_DIR}:/out ${IMAGE_UNDER_TEST} --cni-bin-dir=/out --avoid-sleep | ||
|
||
if [ ! -e "${OUTPUT_DIR}/sriov" ]; then | ||
echo "Output file ${OUTPUT_DIR}/sriov not found" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -s "${OUTPUT_DIR}/sriov" ]; then | ||
echo "Output file ${OUTPUT_DIR}/sriov is empty" | ||
exit 1 | ||
fi | ||
|
||
exit 0 |