From 830a1119bf37080cbdbd1496ab83a9ef1c615cd0 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Fri, 26 Jan 2024 13:47:21 -0800 Subject: [PATCH] fix rad app delete issue --- pkg/corerp/backend/deployment/deploymentprocessor.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index 2cbdb7275c..9531d9a47b 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -287,6 +287,15 @@ func (dp *deploymentProcessor) Deploy(ctx context.Context, id resources.ID, rend err := dp.deployOutputResource(ctx, id, rendererOutput, computedValues, &handlers.PutOptions{Resource: &outputResource, DependencyProperties: deployedOutputResourceProperties}) if err != nil { + // add the last deployed resource which was deployed with error to deployed list + // cleanup all deployed output resources in reverse order since app deployment has failed + outputResource := rpv1.OutputResource{ + LocalID: outputResource.LocalID, + ID: outputResource.ID, + } + deployedOutputResources = append(deployedOutputResources, outputResource) + dp.Delete(ctx, id, deployedOutputResources) + return rpv1.DeploymentOutput{}, err }