mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-27 15:36:57 +00:00
fix: address PR #60 review feedback
- SizeParser: wrap TB-suffix overflow in try/catch so callers get ArgumentException with the parameter name rather than OverflowException. - New-PveVm/New-PveContainer: validate -DiskSize/-RootFsSize before ShouldProcess so typos like "512M" are rejected even with -WhatIf and even when the matching -DiskStorage/-RootFsStorage is omitted. - Add Pester tests for the new DiskSize and RootFsSize validation paths, including a new New-PveContainer.Tests.ps1. - Add SizeParserTests coverage for the TB overflow path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2843,8 +2843,8 @@
|
||||
],
|
||||
"resolution": {
|
||||
"scan_date": "2026-05-20",
|
||||
"evidence": "Added SizeParser.NormalizeToGibibytes() which strips G/GB/T/TB suffixes (and rejects sub-GB units with a clear error). New-PveVm and New-PveContainer normalize -DiskSize and -RootFsSize through it before constructing the disk spec, so '32G' becomes '<storage>:32' on every storage type.",
|
||||
"verified_by": "dotnet build + dotnet test (576 passed, 31 new SizeParserTests)"
|
||||
"evidence": "Added SizeParser.NormalizeToGibibytes() which strips G/GB/T/TB suffixes, rejects sub-GB units with a clear error, and converts TB overflows to ArgumentException. New-PveVm and New-PveContainer normalize -DiskSize and -RootFsSize before ShouldProcess so typos are caught with -WhatIf, regardless of whether the matching -DiskStorage/-RootFsStorage was supplied.",
|
||||
"verified_by": "dotnet build + dotnet test (577 passed, 32 SizeParserTests) + Pester (39 passed, new DiskSize/RootFsSize validation contexts)"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user