From 2925ae63f5b233e007ff4621a9edffd8dcb139f0 Mon Sep 17 00:00:00 2001 From: H3Krn Date: Sat, 1 Feb 2025 02:59:05 +0100 Subject: [PATCH] fix(lxc): allow container disk size 0 for lxc zfs/brfs subvols (#1737) * fix(container): allow 0 size disks for zfs/btrfs subvolumes * chore(docs): update docs --------- Signed-off-by: Harm Kroon --- docs/resources/virtual_environment_container.md | 3 ++- proxmoxtf/resource/container/container.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/resources/virtual_environment_container.md b/docs/resources/virtual_environment_container.md index 1ee286d2..fb360ab2 100644 --- a/docs/resources/virtual_environment_container.md +++ b/docs/resources/virtual_environment_container.md @@ -127,7 +127,8 @@ output "ubuntu_container_public_key" { - `datastore_id` - (Optional) The identifier for the datastore to create the disk in (defaults to `local`). - `size` - (Optional) The size of the root filesystem in gigabytes (defaults - to `4`). Requires `datastore_id` to be set. + to `4`). When set to 0 a directory or zfs/btrfs subvolume will be created. + Requires `datastore_id` to be set. - `initialization` - (Optional) The initialization configuration. - `dns` - (Optional) The DNS configuration. - `domain` - (Optional) The DNS search domain. diff --git a/proxmoxtf/resource/container/container.go b/proxmoxtf/resource/container/container.go index 78534981..bd3bc487 100644 --- a/proxmoxtf/resource/container/container.go +++ b/proxmoxtf/resource/container/container.go @@ -342,7 +342,7 @@ func Container() *schema.Resource { Optional: true, ForceNew: true, Default: dvDiskSize, - ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(1)), + ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(0)), }, }, },