diff --git a/arm/template.json b/arm/template.json index a9a2168..0fc9c99 100644 --- a/arm/template.json +++ b/arm/template.json @@ -3,14 +3,14 @@ "contentVersion": "1.0.0.0", "parameters": { "appPackageUrl": { - "defaultValue": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.5/PatchOrchestrationApplication_v1.4.5.sfpkg", + "defaultValue": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.8/PatchOrchestrationApplication_v1.4.8.sfpkg", "metadata": { "description": "The URL to the application package sfpkg file. example: https://github.com/microsoft/Service-Fabric-POA/releases/download/{{version}}/PatchOrchestrationApplication_{{version}}.sfpkg" }, "type": "String" }, "applicationTypeVersion": { - "defaultValue": "1.4.5", + "defaultValue": "1.4.8", "metadata": { "description": "The application type version." }, diff --git a/arm/template.parameters.json b/arm/template.parameters.json index 60370a3..350e874 100644 --- a/arm/template.parameters.json +++ b/arm/template.parameters.json @@ -3,10 +3,10 @@ "contentVersion": "1.0.0.0", "parameters": { "appPackageUrl": { - "value": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.5/PatchOrchestrationApplication_v1.4.5.sfpkg" + "value": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.8/PatchOrchestrationApplication_v1.4.8.sfpkg" }, "applicationTypeVersion": { - "value": "1.4.5" + "value": "1.4.8" }, "clusterName": { "value": "{{cluster name}}" diff --git a/src/PatchOrchestrationApplication/CoordinatorService/src/PackageRoot/ServiceManifest.xml b/src/PatchOrchestrationApplication/CoordinatorService/src/PackageRoot/ServiceManifest.xml index 2de27dd..69d61ee 100644 --- a/src/PatchOrchestrationApplication/CoordinatorService/src/PackageRoot/ServiceManifest.xml +++ b/src/PatchOrchestrationApplication/CoordinatorService/src/PackageRoot/ServiceManifest.xml @@ -1,6 +1,6 @@  @@ -11,7 +11,7 @@ - + CoordinatorService.exe @@ -21,7 +21,7 @@ - + diff --git a/src/PatchOrchestrationApplication/CoordinatorService/src/RepairManagerHelper.cs b/src/PatchOrchestrationApplication/CoordinatorService/src/RepairManagerHelper.cs index 87ec132..bbb1ddd 100644 --- a/src/PatchOrchestrationApplication/CoordinatorService/src/RepairManagerHelper.cs +++ b/src/PatchOrchestrationApplication/CoordinatorService/src/RepairManagerHelper.cs @@ -352,7 +352,7 @@ public async Task PostClusterPatchingStatus(CancellationToken cancellationToken) { // Post the health event saying that there is no repair task and things are working fine. string description = "No claimed tasks and no processing tasks are found."; - HealthManagerHelper.PostNodeHealthReport(this.fabricClient, this.context.ServiceName, ClusterPatchingStatusProperty, description, HealthState.Ok, -1); + HealthManagerHelper.PostNodeHealthReport(this.fabricClient, this.context.ServiceName, ClusterPatchingStatusProperty, description, HealthState.Ok, 2); } } } diff --git a/src/PatchOrchestrationApplication/NodeAgentNTService/src/Manager/TimerManager.cs b/src/PatchOrchestrationApplication/NodeAgentNTService/src/Manager/TimerManager.cs index 98b2152..83b1f4d 100644 --- a/src/PatchOrchestrationApplication/NodeAgentNTService/src/Manager/TimerManager.cs +++ b/src/PatchOrchestrationApplication/NodeAgentNTService/src/Manager/TimerManager.cs @@ -91,16 +91,21 @@ private void PostWUUpdateEventOnService() CheckpointFileData fileData = this.ReadCheckpointFile(); string formatString = "Last patching attempt happened at : {0}, Next patching cycle is scheduled at : {1}"; string healthDescription = ""; + DateTime initialTime = DateTime.Now; if (fileData.lastAttemptedUpdateTime.Equals(_checkpointFileDefaultDateTime)) { healthDescription = string.Format(formatString, "N/A", fileData.schedulingDateTime.ToString()); } else { + initialTime = fileData.lastAttemptedUpdateTime; healthDescription = string.Format(formatString, fileData.lastAttemptedUpdateTime.ToString(), fileData.schedulingDateTime.ToString()); } healthDescription += "\nFor detailed installation results, refer to https://docs.microsoft.com/azure/service-fabric/service-fabric-patch-orchestration-application#view-the-windows-update-results"; - this._nodeAgentSfUtility.ReportHealth(WUOperationStatus, healthDescription, HealthState.Ok, -1, TimeSpan.FromMinutes(this._serviceSettings.OperationTimeOutInMinutes)); + + long timeToLive = (long)((fileData.schedulingDateTime - initialTime) + TimeSpan.FromDays(1)).TotalMinutes; + + this._nodeAgentSfUtility.ReportHealth(WUOperationStatus, healthDescription, HealthState.Ok, timeToLive, TimeSpan.FromMinutes(this._serviceSettings.OperationTimeOutInMinutes)); } @@ -109,7 +114,17 @@ private void PostWUUpdateEventOnService() /// private void DisableWindowsUpdate() { - + CheckpointFileData fileData = this.ReadCheckpointFile(); + + DateTime initialTime = DateTime.Now; + + if (!fileData.lastAttemptedUpdateTime.Equals(_checkpointFileDefaultDateTime)) + { + initialTime = fileData.lastAttemptedUpdateTime; + } + + long timeToLive = (long)((fileData.schedulingDateTime - initialTime) + TimeSpan.FromDays(1)).TotalMinutes; + if (!this._serviceSettings.DisableWindowsUpdates) { _eventSource.InfoMessage("Not disabling automatic windows updates."); @@ -139,7 +154,7 @@ private void DisableWindowsUpdate() _eventSource.InfoMessage("New AU registry values are {0}", auUtility.LogCurrentAUValues()); } string updateMsg = "Windows Update policy has been configured to Notify before Download"; - this._nodeAgentSfUtility.ReportHealth(WUOperationSetting, updateMsg, HealthState.Ok, -1, TimeSpan.FromMinutes(this._serviceSettings.OperationTimeOutInMinutes)); + this._nodeAgentSfUtility.ReportHealth(WUOperationSetting, updateMsg, HealthState.Ok, timeToLive, TimeSpan.FromMinutes(this._serviceSettings.OperationTimeOutInMinutes)); return; } catch (Exception e) diff --git a/src/PatchOrchestrationApplication/NodeAgentService/src/PackageRoot/ServiceManifest.xml b/src/PatchOrchestrationApplication/NodeAgentService/src/PackageRoot/ServiceManifest.xml index ab829e6..4973092 100644 --- a/src/PatchOrchestrationApplication/NodeAgentService/src/PackageRoot/ServiceManifest.xml +++ b/src/PatchOrchestrationApplication/NodeAgentService/src/PackageRoot/ServiceManifest.xml @@ -1,6 +1,6 @@  @@ -11,7 +11,7 @@ - + SetupEntryPoint.bat @@ -27,7 +27,7 @@ - + diff --git a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/ApplicationPackageRoot/ApplicationManifest.xml b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/ApplicationPackageRoot/ApplicationManifest.xml index e17a4e2..a15515e 100644 --- a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/ApplicationPackageRoot/ApplicationManifest.xml +++ b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/ApplicationPackageRoot/ApplicationManifest.xml @@ -1,5 +1,5 @@  - + @@ -54,7 +54,7 @@ should match the Name and Version attributes of the ServiceManifest element defined in the ServiceManifest.xml file. --> - + @@ -68,7 +68,7 @@ - + diff --git a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/NugetPackage/PatchOrchestrationApplicationPkg.nuproj b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/NugetPackage/PatchOrchestrationApplicationPkg.nuproj index cd12a00..9ce2cc5 100644 --- a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/NugetPackage/PatchOrchestrationApplicationPkg.nuproj +++ b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/NugetPackage/PatchOrchestrationApplicationPkg.nuproj @@ -16,7 +16,7 @@ ServiceFabric.PatchOrchestrationApplication ServiceFabric.PatchOrchestrationApplication - 1.4.7 + 1.4.8 brkhande;raunakp brkhande;raunakp This package contains Service Fabric Patch Orchestration Application. diff --git a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Deploy.ps1 b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Deploy.ps1 index 01eaa28..e9a8fa1 100644 --- a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Deploy.ps1 +++ b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Deploy.ps1 @@ -11,7 +11,7 @@ Param $ImageStoreConnectionString = "fabric:ImageStore", [string] - $ApplicationVersion = "1.4.7", + $ApplicationVersion = "1.4.8", [hashtable] $ApplicationParameters = @{} diff --git a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Undeploy.ps1 b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Undeploy.ps1 index d3469dd..b84924d 100644 --- a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Undeploy.ps1 +++ b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Undeploy.ps1 @@ -8,7 +8,7 @@ Param $ImageStoreConnectionString = "fabric:ImageStore", [string] - $ApplicationVersion = "1.4.7" + $ApplicationVersion = "1.4.8" ) Remove-ServiceFabricApplication -ApplicationName fabric:/PatchOrchestrationApplication -Force diff --git a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Upgrade.ps1 b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Upgrade.ps1 index 7ea5112..ce6f382 100644 --- a/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Upgrade.ps1 +++ b/src/PatchOrchestrationApplication/PatchOrchestrationApplication/Scripts/Upgrade.ps1 @@ -11,7 +11,7 @@ Param $ImageStoreConnectionString = "fabric:ImageStore", [string] - $ApplicationVersion = "1.4.7", + $ApplicationVersion = "1.4.8", [hashtable] $ApplicationParameters = @{}, diff --git a/src/PatchOrchestrationApplication/TelemetryLib/src/TelemetryEvents.cs b/src/PatchOrchestrationApplication/TelemetryLib/src/TelemetryEvents.cs index 40a9e51..3686c1e 100644 --- a/src/PatchOrchestrationApplication/TelemetryLib/src/TelemetryEvents.cs +++ b/src/PatchOrchestrationApplication/TelemetryLib/src/TelemetryEvents.cs @@ -27,7 +27,7 @@ public class TelemetryEvents // Every time a new version of application would be release, manually update this version. // This application version is used for telemetry // For consistency keep this applicaiton version same as application version from application manifest. - private const string ApplicationVersion = "1.4.7"; + private const string ApplicationVersion = "1.4.8"; public TelemetryEvents(FabricClient fabricClient, ITelemetryEventSource eventSource) { diff --git a/src/properties/common.props b/src/properties/common.props index d9f13d3..b70bfaa 100644 --- a/src/properties/common.props +++ b/src/properties/common.props @@ -25,7 +25,7 @@ 1. Assembly info 2. File info 3. Not yet in Telemetry of windows --> - 1.4.7 + 1.4.8 Microsoft