mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-20 18:02:16 +00:00
fix(test): fix integration test failures for SDN, containers, OVA, suspend
- SDN: zone ID cannot contain hyphens — rename 'pester-zone' to 'pesterz' - SDN: subnet removal uses original CIDR, not transformed ID - Containers: New-PveContainer now auto-assigns VM ID via /cluster/nextid when -VmId is omitted (was missing, unlike New-PveVm) - OVA: enable 'images' content type on local storage for import-from - Suspend: add delay before status check, use Should -Not -Throw pattern Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@ using System.Collections.Generic;
|
||||
using System.Management.Automation;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PSProxmoxVE.Core.Client;
|
||||
using PSProxmoxVE.Core.Models.Vms;
|
||||
using PSProxmoxVE.Core.Services;
|
||||
|
||||
@@ -133,7 +135,17 @@ namespace PSProxmoxVE.Cmdlets.Containers
|
||||
var config = new Dictionary<string, object>();
|
||||
|
||||
if (VmId.HasValue)
|
||||
{
|
||||
config["vmid"] = VmId.Value.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Auto-allocate the next available ID from the cluster.
|
||||
using var allocClient = new PveHttpClient(session);
|
||||
var nextIdJson = allocClient.GetAsync("cluster/nextid").GetAwaiter().GetResult();
|
||||
var nextIdData = JObject.Parse(nextIdJson)["data"];
|
||||
config["vmid"] = int.Parse(nextIdData!.ToString());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Hostname))
|
||||
config["hostname"] = Hostname!;
|
||||
if (Memory.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user