Skip to content

Commit 8c6e027

Browse files
authored
Added force remove application cmdlet in case of failure of remove (#6444)
* Added force remove application cmdlet in case of failure of remove ap… (#6431) * Added force remove application cmdlet in case of failure of remove application cmdlet (#6413) * Added force remove application cmdlet in case of failure of remove application cmdlet * Added -Force parameter to avoid confirmation prompt * Indentation * Updated version number * fix failing test on hosted agent * Typo while merging
1 parent 320a33f commit 8c6e027

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

Tasks/ServiceFabricDeploy/ServiceFabricSDK/Publish-NewServiceFabricApplication.ps1

+5-10
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,12 @@
209209
Write-Host (Get-VstsLocString -Key SFSDK_AppAlreadyExistsInfo -ArgumentList @($ApplicationName, $app.ApplicationTypeName, $app.ApplicationTypeVersion))
210210

211211
try
212-
{
213-
$app | Remove-ServiceFabricApplication -Force
214-
}
215-
catch [System.TimeoutException]
216-
{
217-
# Catch operation timeout and continue with force remove replica.
218-
}
219-
220-
foreach ($node in Get-ServiceFabricNode)
221212
{
222-
[void](Get-ServiceFabricDeployedReplica -NodeName $node.NodeName -ApplicationName $ApplicationName | Remove-ServiceFabricReplica -NodeName $node.NodeName -ForceRemove)
213+
$app | Remove-ServiceFabricApplication -Force
214+
}
215+
catch [System.TimeoutException]
216+
{
217+
$app | Remove-ServiceFabricApplication -Force -ForceRemove
223218
}
224219

225220
if($OverwriteBehavior.Equals("Always"))

Tasks/ServiceFabricDeploy/Tests/CreateDiffPkg.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ param()
55

66
$publishProfilePath = "$PSScriptRoot\data\NoAuthPublishProfile.xml"
77
$applicationPackagePath = "$PSScriptRoot\data\DiffPkgAssets\AppPkg"
8-
$diffPackagePath = $env:TEMP + "\DiffPackage"
8+
$diffPackagePath = (Get-Item $env:TEMP).FullName + "\DiffPackage"
99
$serviceConnectionName = "random connection name"
1010
$serviceFabricSdkModulePath = "$PSScriptRoot\data\ServiceFabricSDK.ps1"
1111
$appName = "AppName"

Tasks/ServiceFabricDeploy/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 1,
1919
"Minor": 6,
20-
"Patch": 0
20+
"Patch": 1
2121
},
2222
"demands": [
2323
"Cmd"

Tasks/ServiceFabricDeploy/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 1,
1919
"Minor": 6,
20-
"Patch": 0
20+
"Patch": 1
2121
},
2222
"demands": [
2323
"Cmd"

0 commit comments

Comments
 (0)