From 30fa33e83370270c3c0661e663a42e96743de265 Mon Sep 17 00:00:00 2001 From: Alessio Greggi Date: Fri, 2 Aug 2024 13:08:16 +0200 Subject: [PATCH] add must_change_password information to rancher2_user data-source Signed-off-by: Alessio Greggi --- rancher2/data_source_rancher2_user.go | 4 ++++ rancher2/resource_rancher2_user.go | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rancher2/data_source_rancher2_user.go b/rancher2/data_source_rancher2_user.go index 1ff0a3c8..fcc9ebd5 100644 --- a/rancher2/data_source_rancher2_user.go +++ b/rancher2/data_source_rancher2_user.go @@ -26,6 +26,10 @@ func dataSourceRancher2User() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "must_change_password": { + Type: schema.TypeBool, + Computed: true, + }, "is_external": { Type: schema.TypeBool, Optional: true, diff --git a/rancher2/resource_rancher2_user.go b/rancher2/resource_rancher2_user.go index 3cdacdcd..6cb5347b 100644 --- a/rancher2/resource_rancher2_user.go +++ b/rancher2/resource_rancher2_user.go @@ -108,10 +108,11 @@ func resourceRancher2UserUpdate(d *schema.ResourceData, meta interface{}) error } update := map[string]interface{}{ - "name": d.Get("name").(string), - "enabled": d.Get("enabled").(bool), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), + "name": d.Get("name").(string), + "enabled": d.Get("enabled").(bool), + "must_change_password": d.Get("must_change_password").(bool), + "annotations": toMapString(d.Get("annotations").(map[string]interface{})), + "labels": toMapString(d.Get("labels").(map[string]interface{})), } newUser, err := client.User.Update(user, update)