Skip to content

Commit

Permalink
Fix instance DiskSize and FloatingIpId (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
skirsten authored Apr 19, 2024
1 parent 03e503d commit 3445275
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/provider/instance_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (r *InstanceResource) Create(ctx context.Context, req resource.CreateReques
body.Type = genesiscloud.InstanceType(data.Type.ValueString())
body.Image = data.Image.ValueString()

if !data.FloatingIpId.IsNull() {
if !data.FloatingIpId.IsNull() && !data.FloatingIpId.IsUnknown() {
body.FloatingIp = data.FloatingIpId.ValueStringPointer()
}

Expand All @@ -269,7 +269,7 @@ func (r *InstanceResource) Create(ctx context.Context, req resource.CreateReques
}
}

if !data.DiskSize.IsNull() {
if !data.DiskSize.IsNull() && !data.DiskSize.IsUnknown() {
diskSize := pointer(int(data.DiskSize.ValueInt64()))
body.DiskSize = diskSize
}
Expand Down Expand Up @@ -454,7 +454,7 @@ func (r *InstanceResource) Update(ctx context.Context, req resource.UpdateReques
body.Volumes = &volumeIds
}

if !data.DiskSize.IsNull() {
if !data.DiskSize.IsNull() && !data.DiskSize.IsUnknown() {
diskSize := pointer(int(data.DiskSize.ValueInt64()))
body.DiskSize = diskSize
}
Expand Down

0 comments on commit 3445275

Please sign in to comment.