Commit 42127caf authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

fix(kubernetes): preserve runtime state in stateless flows

parent 9b77d487
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -260,6 +260,11 @@ class EdgeApplicationManager(EdgeCloudManagementInterface):
        if type(result) is V1Deployment:
            status_code = 202
            response = {}
            if result.metadata.annotations is None:
                result.metadata.annotations = {}
            result.metadata.annotations[
                "oop.etsi.org/service-function-instance-name"
            ] = result.metadata.name
            response["name"] = result.metadata.name
            response["appId"] = app[0].get("_id")
            response["appInstanceId"] = result.metadata.uid
@@ -299,9 +304,14 @@ class EdgeApplicationManager(EdgeCloudManagementInterface):
        status_code = None
        content = None
        try:
            deployments = self.k8s_connector.get_deployed_service_functions(self.catalogue_db)
            connector_db = getattr(self, "catalogue_db", None)
            deployments = self.k8s_connector.get_deployed_service_functions(connector_db)
            response = []
            for deployment in deployments:
                if app_id and deployment.get("appId") != app_id:
                    continue
                if app_instance_id and deployment.get("appInstanceId") != app_instance_id:
                    continue
                item = {}
                item["name"] = deployment.get("service_function_catalogue_name")
                item["appId"] = deployment.get("appId")