Skip to content

Commit

Permalink
refactor: state template changed return if diags
Browse files Browse the repository at this point in the history
  • Loading branch information
gersonsosa committed Nov 28, 2024
1 parent 3e63619 commit e2e9454
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (m useStateForUnknownUnlessMigrationIsRequired) UseState(ctx context.Contex
var diags diag.Diagnostics

var parentResState attr.Value
diags.Append(state.GetAttribute(ctx, path.Root(m.resourceKind), &parentResState)...)
if d := state.GetAttribute(ctx, path.Root(m.resourceKind), &parentResState); d.HasError() {
return false, d
}

resourceIsBeingCreated := parentResState.IsNull()

Expand Down

0 comments on commit e2e9454

Please sign in to comment.