From 11d82614e628d24d9ee8db5cccc33427bf5a811c Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Wed, 30 Aug 2023 20:26:01 -0400 Subject: [PATCH] fix(file): forced replacement of file resources that missing `timeout_upload` attribute (#528) --- proxmoxtf/resource/file.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxmoxtf/resource/file.go b/proxmoxtf/resource/file.go index 016d133d..7ca1fd4b 100644 --- a/proxmoxtf/resource/file.go +++ b/proxmoxtf/resource/file.go @@ -196,13 +196,13 @@ func File() *schema.Resource { Type: schema.TypeInt, Description: "Timeout for uploading ISO/VSTMPL files in seconds", Optional: true, - ForceNew: true, Default: dvResourceVirtualEnvironmentFileTimeoutUpload, }, }, CreateContext: fileCreate, ReadContext: fileRead, DeleteContext: fileDelete, + UpdateContext: fileUpdate, Importer: &schema.ResourceImporter{ StateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) ([]*schema.ResourceData, error) { node, datastore, volumeID, err := fileParseImportID(d.Id()) @@ -803,3 +803,9 @@ func fileDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag return nil } + +func fileUpdate(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { + // a pass-through update function -- no actual resource update is needed / allowed + // only the TF state is updated, for example, a timeout_upload attribute value + return nil +}