summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-kubernetes
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-09-27 10:37:28 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2023-09-27 09:39:04 +0000
commitc85228f5b4071f0aee7412ba67a0cfa3031a2e90 (patch)
tree3327f5fb116c2e806b70954d876aa85a3cac6586 /participant/participant-impl/participant-impl-kubernetes
parentf80c317803bccbb12dac2d490520bf409b0d5e3a (diff)
Add migration support in ACM participants
Issue-ID: POLICY-4825 Change-Id: Iebdd0b8c4890e9c022f68396f11f7ba8c80bef00 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-kubernetes')
-rwxr-xr-xparticipant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandler.java7
-rwxr-xr-x[-rw-r--r--]participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandlerTest.java8
2 files changed, 15 insertions, 0 deletions
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandler.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandler.java
index 778d0d10c..d6ce70ce1 100755
--- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandler.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandler.java
@@ -249,4 +249,11 @@ public class AutomationCompositionElementHandler implements AutomationCompositio
intermediaryApi.updateAutomationCompositionElementState(automationCompositionId, element.getId(), deployState,
lockState, StateChangeResult.NO_ERROR, "Restarted");
}
+
+ @Override
+ public void migrate(UUID automationCompositionId, AcElementDeploy element, UUID compositionTargetId,
+ Map<String, Object> properties) throws PfModelException {
+ intermediaryApi.updateAutomationCompositionElementState(automationCompositionId, element.getId(),
+ DeployState.DEPLOYED, null, StateChangeResult.NO_ERROR, "Migrated");
+ }
}
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandlerTest.java b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandlerTest.java
index 6cf344feb..fb8a04602 100644..100755
--- a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandlerTest.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/handler/AutomationCompositionElementHandlerTest.java
@@ -234,4 +234,12 @@ class AutomationCompositionElementHandlerTest {
nodeTemplatesMap.get(K8S_AUTOMATION_COMPOSITION_ELEMENT).getProperties(), DeployState.UNDEPLOYING,
LockState.LOCKED));
}
+
+ @Test
+ void testMigrate() throws PfModelException {
+ var element = CommonTestData.createAcElementDeploy();
+ var automationCompositionId = commonTestData.getAutomationCompositionId();
+ assertDoesNotThrow(() -> automationCompositionElementHandler.migrate(automationCompositionId, element,
+ UUID.randomUUID(), Map.of()));
+ }
}