Skip to content

Commit

Permalink
NGT Creds: Added defensive check to update credentials when it is not…
Browse files Browse the repository at this point in the history
… passed in configuration
  • Loading branch information
siddharth-nutanix committed Nov 26, 2021
1 parent 9a029e4 commit 3dca802
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nutanix/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,10 @@ func flattenNutanixGuestTools(d *schema.ResourceData, guest *v3.GuestToolsStatus
return err
}

if err := d.Set("ngt_credentials", ngtCredentials); err != nil {
return err
if _, ok := d.GetOk("ngt_credentials"); !ok {
if err := d.Set("ngt_credentials", ngtCredentials); err != nil {
return err
}
}

if err := d.Set("nutanix_guest_tools", nutanixGuestTools); err != nil {
Expand Down

0 comments on commit 3dca802

Please sign in to comment.