From 6a7137fbac839365e4c548893fa9c41d3f2b91e2 Mon Sep 17 00:00:00 2001 From: Marco Attia <54147992+Vaneixus@users.noreply.github.com> Date: Tue, 24 Jun 2025 14:33:49 -0400 Subject: [PATCH] doc: properly update documentation and comments. Signed-off-by: Marco Attia <54147992+Vaneixus@users.noreply.github.com> --- docs/resources/virtual_environment_download_file.md | 4 ++-- fwprovider/nodes/resource_download_file.go | 11 +++++++---- templates/guides/setup-proxmox-for-tests.md.tmpl | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/resources/virtual_environment_download_file.md b/docs/resources/virtual_environment_download_file.md index 74609db3..f0d31ca6 100644 --- a/docs/resources/virtual_environment_download_file.md +++ b/docs/resources/virtual_environment_download_file.md @@ -73,7 +73,7 @@ resource "proxmox_virtual_environment_download_file" "latest_ubuntu_22_jammy_lxc ### Required -- `content_type` (String) The file content type. Must be `iso` for VM images or `vztmpl` for LXC images. +- `content_type` (String) The file content type. Must be `iso` or `import` for VM images or `vztmpl` for LXC images. - `datastore_id` (String) The identifier for the target datastore. - `node_name` (String) The node name. - `url` (String) The URL to download the file from. Must match regex: `https?://.*`. @@ -83,7 +83,7 @@ resource "proxmox_virtual_environment_download_file" "latest_ubuntu_22_jammy_lxc - `checksum` (String) The expected checksum of the file. - `checksum_algorithm` (String) The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`. - `decompression_algorithm` (String) Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst` | `bz2`. -- `file_name` (String) The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead. +- `file_name` (String) The file name. If not provided, it is calculated using `url`. - `overwrite` (Boolean) By default `true`. If `true` and file size has changed in the datastore, it will be replaced. If `false`, there will be no check. - `overwrite_unmanaged` (Boolean) If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned. - `upload_timeout` (Number) The file download timeout seconds. Default is 600 (10min). diff --git a/fwprovider/nodes/resource_download_file.go b/fwprovider/nodes/resource_download_file.go index e253eb8d..c3ed5cdc 100644 --- a/fwprovider/nodes/resource_download_file.go +++ b/fwprovider/nodes/resource_download_file.go @@ -169,10 +169,13 @@ func (r *downloadFileResource) Schema( }, }, "file_name": schema.StringAttribute{ - Description: "The file name. If not provided, it is calculated using `url`.", - Computed: true, - Required: false, - Optional: true, + Description: "The file name. If not provided, it is calculated " + + "using `url`. PVE will raise 'wrong file extension' error for some popular " + + "extensions file `.raw` or `.qcow2` on PVE versions prior to 8.4. " + + "Workaround is to use e.g. `.img` instead.", + Computed: true, + Required: false, + Optional: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown(), diff --git a/templates/guides/setup-proxmox-for-tests.md.tmpl b/templates/guides/setup-proxmox-for-tests.md.tmpl index 2d2f9f72..71ea146f 100644 --- a/templates/guides/setup-proxmox-for-tests.md.tmpl +++ b/templates/guides/setup-proxmox-for-tests.md.tmpl @@ -92,4 +92,4 @@ Goal is to have a proxmox node in VM using for a job 10. Now you can run `make example`. -11. If you see error with proxmox_virtual_environment_file: the datastore "local" does not support content type "snippets"; supported content types are: `[backup, iso, vztmpl]`, you need to enable them, see . +11. If you see error with proxmox_virtual_environment_file: the datastore "local" does not support content type "snippets"; supported content types are: `[backup, iso, vztmpl, import]`, you need to enable them, see .