Skip to content

Commit

Permalink
Set password to null if it's unknown
Browse files Browse the repository at this point in the history
In the case of Secure Note Items, the password is never set, which leaves it in the Unknown state. Now we set it to null in such scenarios.
  • Loading branch information
edif2008 committed May 30, 2024
1 parent 69451ed commit 866dfce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/provider/onepassword_item_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ func (r *OnePasswordItemResource) Schema(ctx context.Context, req resource.Schem
Optional: true,
Computed: true,
Sensitive: true,
//Default: stringdefault.StaticString(""),
PlanModifiers: []planmodifier.String{
ValueModifier(),
},
Expand Down Expand Up @@ -603,6 +604,10 @@ func itemToData(ctx context.Context, item *op.Item, data *OnePasswordItemResourc
}
}

if item.Category == op.SecureNote && data.Password.IsUnknown() {
data.Password = types.StringNull()
}

return nil
}

Expand Down

0 comments on commit 866dfce

Please sign in to comment.