distcloud/distributedcloud/dcorch
Gustavo Herzmann 18f54a44dd Stop fernet key rotations from raising out-of-sync alarms
Fernet key rotation is expected to occur periodically. Currently the
280.002 out-of-sync alarm is raised everytime the sync thread receives
a fernet key rotation request.

This commit makes the sync thread check the type of requests, setting
the alarmable parameter to False if all the requests are due to a
fernet key rotation.

It also improves the sync function so it doesn't unnecessarily calls
the is_subcloud_enable() function by providing an early exit when
there are no pending sync requests.

Test Plan:
1. PASS - Verify that the out-of-sync alarm is not raised when the
          fernet keys are rotated;
2. PASS - Check that the initial sync still works as expected;
3. PASS - Verify that identity sync due to user triggered identity
          resources change on the central cloud works as expected;
4. PASS - Check that platform resources sync due to user triggered
          platform resources on the central cloud works as expected;
5. PASS - Trigger a fernet key sync and at the same time trigger a
          different sync request and verify that alarm gets raised.

Closes-Bug: #2002171

Signed-off-by: Gustavo Herzmann <gustavo.herzmann@windriver.com>
Change-Id: I694d6c3791222739921cd0f5141f54791f847414
2023-01-17 14:10:35 -03:00
..
api Implement access control for DC API 2022-09-22 18:26:35 -03:00
cmd Tech debt: move portions of dcorch.common.consts into dccommon.consts 2022-06-16 12:28:44 -04:00
common Implement access control for DC API 2022-09-22 18:26:35 -03:00
db Minor Code Change Based on Py39 Pylint Feedback 2022-08-10 13:12:24 -04:00
drivers Minor Code Change Based on Py39 Pylint Feedback 2022-08-10 13:12:24 -04:00
engine Stop fernet key rotations from raising out-of-sync alarms 2023-01-17 14:10:35 -03:00
objects Minor Code Change Based on Py39 Pylint Feedback 2022-08-10 13:12:24 -04:00
rpc Fix pylint errors 2020-12-03 10:12:49 -06:00
tests Minor Code Change Based on Py39 Pylint Feedback 2022-08-10 13:12:24 -04:00
__init__.py Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
config-generator.conf Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
version.py Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00