fix: drop the client-side -Storage/-Full guard from the Copy cmdlets

PVE returns the same error itself when storage is sent on a linked
clone, so the guard only saved one round trip, had no test, and rested
on a behaviour claim the OpenAPI spec does not document.
This commit is contained in:
goodolclint-claude[bot]
2026-09-02 19:34:11 +00:00
committed by GitHub
parent 4ec528edbc
commit bfe2483d22
2 changed files with 1 additions and 15 deletions
@@ -72,13 +72,6 @@ namespace PSProxmoxVE.Cmdlets.Containers
protected override void ProcessRecord() protected override void ProcessRecord()
{ {
if (!string.IsNullOrEmpty(Storage) && !Full.IsPresent)
ThrowTerminatingError(new ErrorRecord(
new PSArgumentException("-Storage is only valid together with -Full; PVE rejects a target storage on a linked clone.", nameof(Storage)),
"StorageRequiresFullClone",
ErrorCategory.InvalidArgument,
Storage));
var target = TargetNode ?? SourceNode; var target = TargetNode ?? SourceNode;
if (!ShouldProcess($"Container {VmId} on node '{SourceNode}' to new container on node '{target}'", "Copy-PveContainer")) if (!ShouldProcess($"Container {VmId} on node '{SourceNode}' to new container on node '{target}'", "Copy-PveContainer"))
return; return;
@@ -103,7 +96,7 @@ namespace PSProxmoxVE.Cmdlets.Containers
if (Wait.IsPresent) if (Wait.IsPresent)
{ {
var taskService = new TaskService(); var taskService = new TaskService();
task = taskService.WaitForTask(session, task.Node ?? SourceNode, task.Upid!, null, null, null); task = taskService.WaitForTask(session, task.Node ?? SourceNode, task.Upid!);
} }
WriteObject(task); WriteObject(task);
@@ -72,13 +72,6 @@ namespace PSProxmoxVE.Cmdlets.Vms
protected override void ProcessRecord() protected override void ProcessRecord()
{ {
if (!string.IsNullOrEmpty(Storage) && !Full.IsPresent)
ThrowTerminatingError(new ErrorRecord(
new PSArgumentException("-Storage is only valid together with -Full; PVE rejects a target storage on a linked clone.", nameof(Storage)),
"StorageRequiresFullClone",
ErrorCategory.InvalidArgument,
Storage));
var target = TargetNode ?? SourceNode; var target = TargetNode ?? SourceNode;
if (!ShouldProcess($"VM {VmId} on node '{SourceNode}' to new VM on node '{target}'", "Copy-PveVm")) if (!ShouldProcess($"VM {VmId} on node '{SourceNode}' to new VM on node '{target}'", "Copy-PveVm"))
return; return;