Skip to content

Commit

Permalink
v0.3.1 Fixes read issues with reservations.
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-silvas committed Sep 2, 2023
1 parent d1db702 commit c39615e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.3.0
v0.3.1
29 changes: 19 additions & 10 deletions internal/provider/reservation_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,28 @@ func (r *reservationResource) Read(ctx context.Context, req resource.ReadRequest

// Marshalling the response data taken from Kea, and write
// it into the TF Subnets model.
nextServer := ""
if respData.NextServer != "0.0.0.0" {
nextServer = respData.NextServer
}
config.ReservationHostname = types.StringValue(respData.Hostname)
config.BootFileName = types.StringValue(respData.BootFileName)
config.ClientID = types.StringValue(respData.ClientID)
config.CircuitID = types.StringValue(respData.CircuitID)
config.DuID = types.StringValue(respData.DuID)
config.FlexID = types.StringValue(respData.FlexID)
config.IPAddress = types.StringValue(respData.IPAddress)
config.HwAddress = types.StringValue(respData.HwAddress)
config.NextServer = types.StringValue(nextServer)

if respData.NextServer != "0.0.0.0" {
config.NextServer = types.StringValue(respData.NextServer)
}
if respData.BootFileName != "" {
config.BootFileName = types.StringValue(respData.BootFileName)
}
if respData.ClientID != "" {
config.ClientID = types.StringValue(respData.ClientID)
}
if respData.CircuitID != "" {
config.CircuitID = types.StringValue(respData.CircuitID)
}
if respData.DuID != "" {
config.DuID = types.StringValue(respData.DuID)
}
if respData.FlexID != "" {
config.FlexID = types.StringValue(respData.FlexID)
}

config.OptionData = func() []reservationOptionResourceModel {
r := make([]reservationOptionResourceModel, 0)
Expand Down

0 comments on commit c39615e

Please sign in to comment.