diff --git a/src/features/vars-schema/hooks/vars-update-trigger.ts b/src/features/vars-schema/hooks/vars-update-trigger.ts index 019fe461d..8966486b1 100644 --- a/src/features/vars-schema/hooks/vars-update-trigger.ts +++ b/src/features/vars-schema/hooks/vars-update-trigger.ts @@ -319,21 +319,17 @@ addEnvHooks('device_service_environment_variable', async (args) => { addEnvHooks('image_environment_variable', async (args) => { if (args.req.body.release_image != null) { return { - image_install: { + should_be_running__release: { $any: { - $alias: 'ii', + $alias: 'r', $expr: { - installs__image: { + status: 'success', + release_image: { $any: { - $alias: 'i', + $alias: 'ri', $expr: { - i: { - release_image: { - $any: { - $alias: 'ri', - $expr: { ri: { id: args.req.body.release_image } }, - }, - }, + ri: { + id: args.req.body.release_image, }, }, }, @@ -351,28 +347,20 @@ addEnvHooks('image_environment_variable', async (args) => { return [ envVarIds, (envVarIdsChunk) => ({ - image_install: { + should_be_running__release: { $any: { - $alias: 'ii', + $alias: 'r', $expr: { - installs__image: { + status: 'success', + release_image: { $any: { - $alias: 'i', + $alias: 'ri', $expr: { - i: { - release_image: { + ri: { + image_environment_variable: { $any: { - $alias: 'ri', - $expr: { - ri: { - image_environment_variable: { - $any: { - $alias: 'e', - $expr: { e: { id: { $in: envVarIdsChunk } } }, - }, - }, - }, - }, + $alias: 'e', + $expr: { e: { id: { $in: envVarIdsChunk } } }, }, }, },