Initial managed-container HA resource agent baseline
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
# Runtime adapter API 1. The existing rootless privilege boundary is unchanged.
|
||||
MC_RUNTIME_API=1
|
||||
|
||||
mc_runtime_exec()
|
||||
{
|
||||
as_service_user podman exec "$@"
|
||||
}
|
||||
|
||||
mc_runtime_exec_bounded()
|
||||
{
|
||||
local duration="$1"
|
||||
shift
|
||||
as_service_user timeout --kill-after=1s "${duration}" podman exec "$@"
|
||||
}
|
||||
|
||||
mc_runtime_inspect()
|
||||
{
|
||||
as_service_user podman inspect "$@"
|
||||
}
|
||||
|
||||
mc_runtime_info()
|
||||
{
|
||||
as_service_user podman info "$@"
|
||||
}
|
||||
|
||||
# Return one environment variable from a running managed container.
|
||||
# Application plugins use this rather than parsing lifecycle-manager config.
|
||||
mc_runtime_environment()
|
||||
{
|
||||
local container=$1 key=$2
|
||||
case "$key" in
|
||||
''|[!A-Za-z_]*|*[!A-Za-z0-9_]*) return 2 ;;
|
||||
esac
|
||||
mc_runtime_exec "$container" printenv "$key" 2>/dev/null
|
||||
}
|
||||
Reference in New Issue
Block a user