mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-05 05:24:01 +00:00
fix(vm): default disk cache is not set to none
if not specified for an existing disk (#478)
Also fixes missing `ForceNew` for `file` resources.
This commit is contained in:
parent
185e98fe80
commit
8d0b3ed25f
1
Makefile
1
Makefile
@ -33,7 +33,6 @@ example: example-build example-init example-apply example-destroy
|
||||
|
||||
example-apply:
|
||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||
&& export TF_REATTACH_PROVIDERS='{"registry.terraform.io/bpg/proxmox":{"Protocol":"grpc","ProtocolVersion":6,"Pid":82711,"Test":true,"Addr":{"Network":"unix","String":"/var/folders/xx/4plpx_3133lbctp7b7v1yfch0000gn/T/plugin3121225613"}}}' \
|
||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
||||
&& cd ./example \
|
||||
|
@ -196,6 +196,7 @@ func File() *schema.Resource {
|
||||
Type: schema.TypeInt,
|
||||
Description: "Timeout for uploading ISO/VSTMPL files in seconds",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Default: dvResourceVirtualEnvironmentFileTimeoutUpload,
|
||||
},
|
||||
},
|
||||
|
@ -3706,13 +3706,13 @@ func vmReadCustom(
|
||||
if dd.Discard != nil {
|
||||
disk[mkResourceVirtualEnvironmentVMDiskDiscard] = *dd.Discard
|
||||
} else {
|
||||
disk[mkResourceVirtualEnvironmentVMDiskDiscard] = ""
|
||||
disk[mkResourceVirtualEnvironmentVMDiskDiscard] = dvResourceVirtualEnvironmentVMDiskDiscard
|
||||
}
|
||||
|
||||
if dd.Cache != nil {
|
||||
disk[mkResourceVirtualEnvironmentVMDiskCache] = *dd.Cache
|
||||
} else {
|
||||
disk[mkResourceVirtualEnvironmentVMDiskCache] = ""
|
||||
disk[mkResourceVirtualEnvironmentVMDiskCache] = dvResourceVirtualEnvironmentVMDiskCache
|
||||
}
|
||||
|
||||
diskMap[di] = disk
|
||||
@ -5007,6 +5007,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D
|
||||
tmp.BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps
|
||||
tmp.MaxReadSpeedMbps = value.MaxReadSpeedMbps
|
||||
tmp.MaxWriteSpeedMbps = value.MaxWriteSpeedMbps
|
||||
tmp.Cache = value.Cache
|
||||
|
||||
switch prefix {
|
||||
case "virtio":
|
||||
|
Loading…
Reference in New Issue
Block a user