From 244e061779f05752bd0760ea6b5a15c869e26505 Mon Sep 17 00:00:00 2001 From: Moustafa Baiou Date: Thu, 10 Aug 2023 11:07:49 -0400 Subject: [PATCH] fix(user): make `password` attribute optional (#474) * fix(user): make password attribute optional The password is already optional in the terraform schema, but still serialized and sent as an empty string via the client. This addresses the request body serialization. Addresses #462 * add example template --------- Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- example/resource_virtual_environment_user.tf | 5 +++++ proxmox/access/users_types.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/example/resource_virtual_environment_user.tf b/example/resource_virtual_environment_user.tf index 9017a70d..1e516ea3 100644 --- a/example/resource_virtual_environment_user.tf +++ b/example/resource_virtual_environment_user.tf @@ -10,6 +10,11 @@ resource "proxmox_virtual_environment_user" "example" { user_id = "terraform-provider-proxmox-example@pve" } +resource "proxmox_virtual_environment_user" "example2" { + comment = "Managed by Terraform" + user_id = "terraform-provider-proxmox-example2@pve" +} + output "resource_proxmox_virtual_environment_user_example_acl" { value = proxmox_virtual_environment_user.example.acl } diff --git a/proxmox/access/users_types.go b/proxmox/access/users_types.go index 90ac5083..224eb061 100644 --- a/proxmox/access/users_types.go +++ b/proxmox/access/users_types.go @@ -27,7 +27,7 @@ type UserCreateRequestBody struct { ID string `json:"userid" url:"userid"` Keys *string `json:"keys,omitempty" url:"keys,omitempty"` LastName *string `json:"lastname,omitempty" url:"lastname,omitempty"` - Password string `json:"password" url:"password"` + Password string `json:"password" url:"password,omitempty"` } // UserGetResponseBody contains the body from a user get response.