dey-image-container: add DCP registration defaults
Include default registration settings in the generated DCP manifest so future install flows can bootstrap the container configuration directly from the package metadata. Add registration_defaults with autostart, monitor and restart policy, and populate those values for the lvgl and webkit container profiles. https://onedigi.atlassian.net/browse/DEL-10033 Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
parent
36716d7b4d
commit
f7a882fa1e
|
|
@ -77,6 +77,9 @@ do_image_container_artifacts() {
|
|||
fw_versions_esc="$(json_escape "${CONTAINER_FIRMWARE_VERSIONS}")"
|
||||
description_esc="$(json_escape "${CONTAINER_ARTIFACT_DESCRIPTION}")"
|
||||
build_id_esc="$(json_escape "${build_id}")"
|
||||
autostart_value="$(printf '%s' "${CONTAINER_AUTOSTART}" | tr '[:upper:]' '[:lower:]')"
|
||||
monitor_value="$(printf '%s' "${CONTAINER_MONITOR}" | tr '[:upper:]' '[:lower:]')"
|
||||
restart_enabled_value="$(printf '%s' "${CONTAINER_RESTART_ENABLED}" | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
printf '%s\n' \
|
||||
'{' \
|
||||
|
|
@ -90,6 +93,19 @@ do_image_container_artifacts() {
|
|||
printf '%s\n' " \"create_args\": \"${create_args_esc}\"," >> "${artifact_dir}/manifest.json"
|
||||
fi
|
||||
|
||||
printf '%s\n' \
|
||||
' "registration_defaults": {' \
|
||||
" \"autostart\": ${autostart_value}," \
|
||||
" \"monitor\": ${monitor_value}," \
|
||||
' "restart": {' \
|
||||
" \"enabled\": ${restart_enabled_value}," \
|
||||
" \"max_retries\": ${CONTAINER_RESTART_MAX_RETRIES}," \
|
||||
" \"window\": ${CONTAINER_RESTART_WINDOW}," \
|
||||
" \"retry_delay\": ${CONTAINER_RESTART_RETRY_DELAY}" \
|
||||
' }' \
|
||||
' },' \
|
||||
>> "${artifact_dir}/manifest.json"
|
||||
|
||||
printf '%s\n' \
|
||||
" \"created_at\": \"${created_at}\"," \
|
||||
" \"digest\": \"sha256:${digest}\"," \
|
||||
|
|
|
|||
|
|
@ -68,6 +68,13 @@ CONTAINER_DEVICE_TYPES_JSON ?= "[\"${MACHINE}\"]"
|
|||
CONTAINER_ARTIFACT_DESCRIPTION ?= ""
|
||||
CONTAINER_ARTIFACT_BUILD_ID ?= ""
|
||||
CONTAINER_ARTIFACT_LABELS_JSON ?= "{}"
|
||||
# monitor and (auto/re)start configuration
|
||||
CONTAINER_AUTOSTART ?= "true"
|
||||
CONTAINER_MONITOR ?= "true"
|
||||
CONTAINER_RESTART_ENABLED ?= "true"
|
||||
CONTAINER_RESTART_MAX_RETRIES ?= "3"
|
||||
CONTAINER_RESTART_WINDOW ?= "60"
|
||||
CONTAINER_RESTART_RETRY_DELAY ?= "3"
|
||||
|
||||
########################
|
||||
# Container image behavior
|
||||
|
|
|
|||
Loading…
Reference in New Issue