Skip to content

Commit

Permalink
set patchInstanceRequest.DefaultUser to an empty string
Browse files Browse the repository at this point in the history
This commit fix the issue where the default_user would be reset to admin
on reinstallation independently from the value set in terrafom
  • Loading branch information
m0build-io committed Dec 30, 2024
1 parent 746125c commit 33fceaa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contabo/resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ func updateInstanceValues(d *schema.ResourceData, client *openapi.APIClient, ctx

func reinstall(d *schema.ResourceData, client *openapi.APIClient, ctx context.Context, instanceId int64, diags diag.Diagnostics, m interface{}) diag.Diagnostics {
patchInstanceRequest := openapi.NewReinstallInstanceRequestWithDefaults()
// the pathInstanceRequest contains "admin" as default value for DefaulUser which is not desired
patchInstanceRequest.DefaultUser = &([]string{"default-value"}[0])

if d.HasChange("ssh_keys") {
sshKeys := d.Get("ssh_keys")
Expand Down

0 comments on commit 33fceaa

Please sign in to comment.