Skip to content

Commit

Permalink
add must_change_password information to rancher2_user data-source
Browse files Browse the repository at this point in the history
Signed-off-by: Alessio Greggi <[email protected]>
  • Loading branch information
alegrey91 committed Aug 2, 2024
1 parent 898f317 commit 30fa33e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions rancher2/data_source_rancher2_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions rancher2/resource_rancher2_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 30fa33e

Please sign in to comment.