Go to file
Marcelo de Castro Loebens 55d9ab8a1b Fix portieris webhook disable on update
After a change in how apps are being upgraded during a platform
upgrade, from CLI commands (considered 'manual') to automatic
operations done by the app framework, the 'pre_update' method is
not being called due to the hook being considered of a different
type (APP_LIFECYCLE_MODE_AUTO instead of APP_LIFECYCLE_MODE_MANUAL).

This change use a different condition to decided when to call the
'pre_update' method to account for the change in the app framework:
- We will use the lifecycle type 'resource' for both 'auto' and
  'manual' modes, instead of 'check' only with 'manual' mode.
  The 'check' is constantly called at runtime for auto updates,
  and we only want to execute the 'pre_update' if the update is
  indeed in progress (after the check stage).
- Due to this change, we need to make another change in the
  clean up method, it needs to use the operation type 'apply'
  instead of 'update', otherwise the 'pre_update' method will be
  called again and we will end in a loop.

Also include changes to account for rollback:
- We don't want reevaluate the Post-upgrade override if it's
  already filled, otherwise we will consider the temporary override
  to disable the webhook as a permanent one;
- Since a rollback can still be done after the platform upgrade
  deploy is in the completed stage (but sysinv start processing
  updates for the apps again in this stage), don't clean up the
  the temporary overrides until the upgrade deploy is deleted
  (platform upgrade ends properly after it).

Test plan:
PASS: Perform upgrade (AIO-SX).
PASS: Perform upgrade activation rollback (AIO-SX).
PASS: App install (system application-upload/apply).
PASS: App upversion (system application-update).

Story: 2011357
Task: 52710

Change-Id: I96898bcc556272d9b50fcccb65b5fa304da02d7f
Signed-off-by: Marcelo de Castro Loebens <Marcelo.DeCastroLoebens@windriver.com>
2025-08-21 14:51:14 -04:00
2023-12-15 12:54:44 -07:00
2020-04-27 17:19:02 +00:00
2023-12-15 12:54:44 -07:00
Description
StarlingX Portieris App
1.3 MiB
Languages
Python 78.5%
Makefile 21.3%
Assembly 0.2%