Skip to content

Commit

Permalink
build: set name on resource import
Browse files Browse the repository at this point in the history
  • Loading branch information
DXTimer committed Mar 13, 2024
1 parent 38f6dca commit 556687d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/framework/resources/zone_record_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ func (r *ZoneRecordResource) updateModelFromAPIResponse(record *dnsimple.ZoneRec
data.TTL = types.Int64Value(int64(record.TTL))
data.Priority = types.Int64Value(int64(record.Priority))

if data.Name.IsNull() || data.Name.IsUnknown() {
// This can happen during a resource import, where the name is not in the state
data.Name = types.StringValue(record.Name)
}

if record.Name == "" {
data.QualifiedName = data.ZoneName
} else {
Expand Down

0 comments on commit 556687d

Please sign in to comment.