Skip to content

Commit e6e2363

Browse files
authored
AzLocal.UpdateManagement v0.8.77: fix two production strict-mode crashes (Step.05/06/07) (#83)
## Summary Patch release. Fixes **two production strict-mode crashes** that surfaced in Step.05 / Step.06 / Step.07 of the bundled apply-updates pipelines. Both bugs share the same root cause: bare `$obj.Prop` property access under `Set-StrictMode -Version Latest` **throws** when `Prop` is absent on a `PSCustomObject` instead of returning `$null`. Resolves no open issue (regressions found by live customer production traces, not filed). ## What changed ### Bug 1 - `Start-AzLocalClusterUpdate` (Step.07 main entry) Production emitted `Error processing cluster '<Name>': The property 'UpdateStartWindow' cannot be found on this object.` for clusters whose tag bag did not include `UpdateStartWindow` / `UpdateExclusionsWindow`. The old `if ($clusterTags -and $clusterTags.$($script:UpdateStartWindowTagName))` threw **before** `-and` short-circuited because bare `.$()` member access on a missing `PSCustomObject` property is strict-mode-fatal. **Fix**: branch on `$clusterTags -is [System.Collections.IDictionary]` and use `.Contains()` for hashtables / `PSObject.Properties[...]` for `PSCustomObject` tag bags. The semantic intent ("absent = any time eligible / no window restriction") is preserved: the outer `if ($windowTagValue -or $exclusionTagValue)` correctly skips the schedule gate when both are `$null`. ### Bug 2 - `Test-AzLocalClusterHealth` (Step.05/06 readiness gate) Production emitted `Checking: <Cluster>... Error: The property 'healthCheckResult' cannot be found on this object.` for clusters whose ARM update summary genuinely had no `healthCheckResult` field (typical for clusters not yet probed). The `catch` block then flagged the cluster `HealthState=Error / Passed=$false`, and the readiness gate falsely treated it as **blocked**, poisoning Step.5 / Step.7 / Step.9 readiness output. The same bare-access pattern was present in `Get-HealthCheckFailureSummary` (Private helper) and `Get-AzLocalFleetStatusData` (Public, `-IncludeHealthDetails`). **Fix**: all three sites now use the `PSObject.Properties[...]` guard; `Test-AzLocalClusterHealth` correctly classifies such clusters as `HealthState="No Data" / Passed=$true` and continues. ## Tests Two new Pester regression contexts feed the minimal real-world property-less shapes and assert `Should -Not -Throw` plus the correct downstream classification. Both bugs were invisible to parse-time analysis - only runtime against the property-less shape triggers the strict-mode throw. ``` Total: 1143 Passed: 1142 Failed: 0 Skipped: 1 Duration: 00:01:47 ``` ## Pipeline templates `GENERATED_AGAINST_MODULE_VERSION` bumped from `'0.8.76'` to `'0.8.77'` across all 22 bundled pipeline templates (11 github-actions + 11 azure-devops). ## API surface No public API change or new exports (still 60). See [CHANGELOG.md](AzLocal.UpdateManagement/CHANGELOG.md) for the full v0.8.77 entry.
1 parent 1e30e9b commit e6e2363

32 files changed

Lines changed: 251 additions & 61 deletions

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/apply-updates-schedule-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ parameters:
8787
default: false
8888

8989
variables:
90-
GENERATED_AGAINST_MODULE_VERSION: '0.8.76'
90+
GENERATED_AGAINST_MODULE_VERSION: '0.8.77'
9191
REQUIRED_MODULE_VERSION: '${{ parameters.moduleVersion }}'
9292
reportsPath: '$(Build.ArtifactStagingDirectory)/reports'
9393
# v0.8.7 sideload advisor defaults. Override at the pipeline / variable-group

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/apply-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ variables:
120120
# log if the YAML appears stale - prompting you to refresh via
121121
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
122122
- name: GENERATED_AGAINST_MODULE_VERSION
123-
value: '0.8.76'
123+
value: '0.8.77'
124124
# Resolution order for the module version pin (leave all unset to install the latest,
125125
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
126126
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/assess-update-readiness.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ variables:
7070
# the version actually installed and to the latest on PSGallery, and emits a warning
7171
# log if the YAML appears stale - prompting you to refresh via
7272
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
73-
GENERATED_AGAINST_MODULE_VERSION: '0.8.76'
73+
GENERATED_AGAINST_MODULE_VERSION: '0.8.77'
7474
# Resolution order for the module version pin (leave all unset to install the latest,
7575
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
7676
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/authentication-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ variables:
6060
# log if the YAML appears stale - prompting you to refresh via
6161
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
6262
- name: GENERATED_AGAINST_MODULE_VERSION
63-
value: '0.8.76'
63+
value: '0.8.77'
6464
# Resolution order for the module version pin (leave all unset to install the latest,
6565
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
6666
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/fleet-connectivity-status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ variables:
110110
# the version actually installed and to the latest on PSGallery, and emits a warning
111111
# log if the YAML appears stale - prompting you to refresh via
112112
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
113-
GENERATED_AGAINST_MODULE_VERSION: '0.8.76'
113+
GENERATED_AGAINST_MODULE_VERSION: '0.8.77'
114114
# Resolution order for the module version pin (leave all unset to install the latest,
115115
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
116116
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/fleet-health-status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ variables:
105105
# the version actually installed and to the latest on PSGallery, and emits a warning
106106
# log if the YAML appears stale - prompting you to refresh via
107107
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
108-
GENERATED_AGAINST_MODULE_VERSION: '0.8.76'
108+
GENERATED_AGAINST_MODULE_VERSION: '0.8.77'
109109
# Resolution order for the module version pin (leave all unset to install the latest,
110110
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
111111
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/fleet-update-status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ variables:
9393
# the version actually installed and to the latest on PSGallery, and emits a warning
9494
# log if the YAML appears stale - prompting you to refresh via
9595
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
96-
GENERATED_AGAINST_MODULE_VERSION: '0.8.76'
96+
GENERATED_AGAINST_MODULE_VERSION: '0.8.77'
9797
# Resolution order for the module version pin (leave all unset to install the latest,
9898
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
9999
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/inventory-clusters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ variables:
4343
# log if the YAML appears stale - prompting you to refresh via
4444
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
4545
- name: GENERATED_AGAINST_MODULE_VERSION
46-
value: '0.8.76'
46+
value: '0.8.77'
4747
# Resolution order for the module version pin (leave all unset to install the latest,
4848
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
4949
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/manage-updatering-tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ variables:
4646
# log if the YAML appears stale - prompting you to refresh via
4747
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
4848
- name: GENERATED_AGAINST_MODULE_VERSION
49-
value: '0.8.76'
49+
value: '0.8.77'
5050
# Resolution order for the module version pin (leave all unset to install the latest,
5151
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
5252
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/monitor-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ parameters:
8484
default: ''
8585

8686
variables:
87-
GENERATED_AGAINST_MODULE_VERSION: '0.8.76'
87+
GENERATED_AGAINST_MODULE_VERSION: '0.8.77'
8888
REQUIRED_MODULE_VERSION: '${{ parameters.moduleVersion }}'
8989
reportsPath: '$(Build.ArtifactStagingDirectory)/reports'
9090

0 commit comments

Comments
 (0)