Skip to content

Commit

Permalink
Added force remove application cmdlet in case of failure of remove (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
vinodkumar3 authored Feb 15, 2018
1 parent 320a33f commit 8c6e027
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,12 @@
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)
{
[void](Get-ServiceFabricDeployedReplica -NodeName $node.NodeName -ApplicationName $ApplicationName | Remove-ServiceFabricReplica -NodeName $node.NodeName -ForceRemove)
$app | Remove-ServiceFabricApplication -Force
}
catch [System.TimeoutException]
{
$app | Remove-ServiceFabricApplication -Force -ForceRemove
}

if($OverwriteBehavior.Equals("Always"))
Expand Down
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricDeploy/Tests/CreateDiffPkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param()

$publishProfilePath = "$PSScriptRoot\data\NoAuthPublishProfile.xml"
$applicationPackagePath = "$PSScriptRoot\data\DiffPkgAssets\AppPkg"
$diffPackagePath = $env:TEMP + "\DiffPackage"
$diffPackagePath = (Get-Item $env:TEMP).FullName + "\DiffPackage"
$serviceConnectionName = "random connection name"
$serviceFabricSdkModulePath = "$PSScriptRoot\data\ServiceFabricSDK.ps1"
$appName = "AppName"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricDeploy/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 6,
"Patch": 0
"Patch": 1
},
"demands": [
"Cmd"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricDeploy/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 6,
"Patch": 0
"Patch": 1
},
"demands": [
"Cmd"
Expand Down

0 comments on commit 8c6e027

Please sign in to comment.