diff --git a/runtime/config-deployer-service/ballerina/APIClient.bal b/runtime/config-deployer-service/ballerina/APIClient.bal index da9bc516d..e966a4058 100644 --- a/runtime/config-deployer-service/ballerina/APIClient.bal +++ b/runtime/config-deployer-service/ballerina/APIClient.bal @@ -916,7 +916,6 @@ public class APIClient { private isolated function retrieveGQLRouteMatch(APKOperations apiOperation) returns model:GQLRouteMatch|error { model:GQLType? routeMatch = model:getGQLRouteMatch(apiOperation.verb); if routeMatch is model:GQLType { - log:printInfo(routeMatch); return {'type: routeMatch, path: apiOperation.target}; } else { return e909052(error("Error occured retrieving GQL route match", message = "Internal Server Error", code = 909000, description = "Internal Server Error", statusCode = 500)); diff --git a/runtime/config-deployer-service/ballerina/DeployerClient.bal b/runtime/config-deployer-service/ballerina/DeployerClient.bal index aa522f3a9..2841e8431 100644 --- a/runtime/config-deployer-service/ballerina/DeployerClient.bal +++ b/runtime/config-deployer-service/ballerina/DeployerClient.bal @@ -350,7 +350,7 @@ public class DeployerClient { } } private isolated function deployRoutes(model:HTTPRoute[]? httproutes, model:GQLRoute[]? gqlroutes, string namespace, model:OwnerReference ownerReference) returns error? { - if httproutes is model:HTTPRoute[] { + if httproutes is model:HTTPRoute[] && httproutes.length() > 0 { model:HTTPRoute[] deployReadyHttproutes = httproutes; model:HTTPRoute[]|commons:APKError orderedHttproutes = self.createHttpRoutesOrder(httproutes); if orderedHttproutes is model:HTTPRoute[] { @@ -379,7 +379,7 @@ public class DeployerClient { } } } - } else if gqlroutes is model:GQLRoute[] { + } else if gqlroutes is model:GQLRoute[] && gqlroutes.length() > 0 { model:GQLRoute[] deployReadyGqlRoutes = gqlroutes; model:GQLRoute[]|commons:APKError orderedGqlRoutes = self.createGqlRoutesOrder(gqlroutes); if orderedGqlRoutes is model:GQLRoute[] { @@ -408,8 +408,10 @@ public class DeployerClient { } } } + } else { + log:printError("Error occured while deploying routes"); + return e909022("Error occured while deploying routes", error("Error occured while deploying routes")); } - } public isolated function createHttpRoutesOrder(model:HTTPRoute[] httproutes) returns model:HTTPRoute[]|commons:APKError {