aw-was-here commented on code in PR #254:
URL: https://github.com/apache/yetus/pull/254#discussion_r855385574
##########
precommit/src/main/shell/core.d/00-yetuslib.sh:
##########
@@ -528,3 +528,65 @@ function yetus_set_trap_handler
trap "${func} ${signal}" "${signal}"
done
}
+
+## @description Determine if running in a container
+## @audience public
+## @stability evolving
+## @replaceable no
+function yetus_is_container
+{
+ declare mounts
+ declare cgroups
+
+ if [[ -n "${YETUS_CONTAINER_STATE}" ]]; then
+ if [[ "${YETUS_CONTAINER_STATE}" == "true" ]]; then
+ return 0
+ fi
+ return 1
+ fi
+
+ if [[ -f /.dockerenv ]]; then
+ YETUS_CONTAINER_STATE=true
+ return 0
+ fi
+
+ if [[ -n "${container}" ]]; then
Review Comment:
I've added some comments to this code block to hopefully better describe
what is going on.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]