Currently, when the sw_deploy strategy is applied for an
N-1 inactive release in System Controller with N release,
the strategy apply fails because the snapshot parameter
is not supported by the API in N-1 prepatched subcloud,
leading to a failure in the strategy.
This commit adds a check to create the snapshot parameter
in the API's payload if the parameter is provided in the
strategy creation call. If the parameter is not provided,
it will not be included in the payload, allowing the
strategy to be created successfully.
Test Plan:
PASS - Bring up a System Controller with N release
- Bring up a prepatched subcloud with N-1 release
- Upload N-1 inactive patch to System Controller
- Create a sw_deploy strategy for the N-1 inactive
release
- Verify that the strategy is created and apply
successfully
- Verify that N-1 patch is deployed successfully
in the subcloud
Closes-bug: 2125230
Depends-On: https://review.opendev.org/c/starlingx/distcloud/+/961844
Change-Id: Ic7a675abc922f2eb35d1b92df0988452362bc922
Signed-off-by: Cristian Mondo <cristian.mondo@windriver.com>