From 320a33fc7c07f8e6fe9bd01276cd81089d521262 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Date: Thu, 15 Feb 2018 18:23:27 +0530 Subject: [PATCH] =?UTF-8?q?Revert=20"Added=20force=20remove=20application?= =?UTF-8?q?=20cmdlet=20in=20case=20of=20failure=20of=20remove=20ap?= =?UTF-8?q?=E2=80=A6=20(#6431)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 34d5ddebe92ab58061c61bb6c5be4ee0df830878. --- .../Publish-NewServiceFabricApplication.ps1 | 15 ++++++++++----- Tasks/ServiceFabricDeploy/task.json | 2 +- Tasks/ServiceFabricDeploy/task.loc.json | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Tasks/ServiceFabricDeploy/ServiceFabricSDK/Publish-NewServiceFabricApplication.ps1 b/Tasks/ServiceFabricDeploy/ServiceFabricSDK/Publish-NewServiceFabricApplication.ps1 index 33b0ef3b3f57..f4b1db77112d 100644 --- a/Tasks/ServiceFabricDeploy/ServiceFabricSDK/Publish-NewServiceFabricApplication.ps1 +++ b/Tasks/ServiceFabricDeploy/ServiceFabricSDK/Publish-NewServiceFabricApplication.ps1 @@ -209,12 +209,17 @@ Write-Host (Get-VstsLocString -Key SFSDK_AppAlreadyExistsInfo -ArgumentList @($ApplicationName, $app.ApplicationTypeName, $app.ApplicationTypeVersion)) try + { + $app | Remove-ServiceFabricApplication -Force + } + catch [System.TimeoutException] + { + # Catch operation timeout and continue with force remove replica. + } + + foreach ($node in Get-ServiceFabricNode) { - $app | Remove-ServiceFabricApplication -Force - } - catch [System.TimeoutException] - { - $app | Remove-ServiceFabricApplication -Force -ForceRemove + [void](Get-ServiceFabricDeployedReplica -NodeName $node.NodeName -ApplicationName $ApplicationName | Remove-ServiceFabricReplica -NodeName $node.NodeName -ForceRemove) } if($OverwriteBehavior.Equals("Always")) diff --git a/Tasks/ServiceFabricDeploy/task.json b/Tasks/ServiceFabricDeploy/task.json index bbafd90419bd..31f712a94446 100644 --- a/Tasks/ServiceFabricDeploy/task.json +++ b/Tasks/ServiceFabricDeploy/task.json @@ -17,7 +17,7 @@ "version": { "Major": 1, "Minor": 6, - "Patch": 1 + "Patch": 0 }, "demands": [ "Cmd" diff --git a/Tasks/ServiceFabricDeploy/task.loc.json b/Tasks/ServiceFabricDeploy/task.loc.json index 6776476c927d..90f21047e0d9 100644 --- a/Tasks/ServiceFabricDeploy/task.loc.json +++ b/Tasks/ServiceFabricDeploy/task.loc.json @@ -17,7 +17,7 @@ "version": { "Major": 1, "Minor": 6, - "Patch": 1 + "Patch": 0 }, "demands": [ "Cmd"