Skip to content

Commit

Permalink
Skip triggering device update checks for image env var POSTs of non-s…
Browse files Browse the repository at this point in the history
…uccessful releases

Change-type: patch
  • Loading branch information
thgreasi committed Oct 17, 2024
1 parent 58849cb commit a13ed02
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/features/vars-schema/hooks/vars-update-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,30 @@ addEnvHooks('device_service_environment_variable', async (args) => {

addEnvHooks('image_environment_variable', async (args) => {
if (args.req.body.release_image != null) {
const isPartOfSuccessfulRelease =
(await args.api.get({
resource: 'release_image',
id: args.req.body.release_image,
options: {
$select: 'id',
$filter: {
is_part_of__release: {
$any: {
$alias: 'r',
$expr: {
r: {
status: 'success',
},
},
},
},
},
},
})) != null;
if (!isPartOfSuccessfulRelease) {
return;
}

return {
image_install: {
$any: {
Expand Down

0 comments on commit a13ed02

Please sign in to comment.