Skip to content

Commit

Permalink
Set last_cname only if we have some CNAME resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
hightoxicity committed Dec 18, 2023
1 parent e877da6 commit 819af0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/provider/data_dns_recursive_cname_record_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ func (d *dnsCNAMERecursiveRecordSetDataSource) Read(ctx context.Context, req dat
}

config.CNAMES, _ = types.ListValueFrom(ctx, types.StringType, cnames)
config.LastCNAME = types.StringValue(cnames[len(cnames)-1])
if len(cnames) > 0 {
config.LastCNAME = types.StringValue(cnames[len(cnames)-1])
}
config.ID = config.Host
resp.Diagnostics.Append(resp.State.Set(ctx, config)...)
}
Expand Down

0 comments on commit 819af0b

Please sign in to comment.