Skip to content

Commit

Permalink
Merge pull request #16 from crusoecloud/hca-tweak
Browse files Browse the repository at this point in the history
Update HCAs for non IB VMs
  • Loading branch information
agutierrez8 authored Dec 7, 2023
2 parents b9e7094 + 832ffa7 commit e868b99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

const (
// TODO: pull from config set during build
version = "v0.5.1"
version = "v0.5.2"

pollInterval = 2 * time.Second

Expand Down
5 changes: 4 additions & 1 deletion internal/vm/vm_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (r *vmResource) Schema(ctx context.Context, req resource.SchemaRequest, res
},
},
"host_channel_adapters": schema.ListNestedAttribute{
Computed: true,
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, // maintain across updates
NestedObject: schema.NestedAttributeObject{
PlanModifiers: []planmodifier.Object{objectplanmodifier.UseStateForUnknown()}, // maintain across updates
Expand Down Expand Up @@ -300,6 +300,9 @@ func (r *vmResource) Create(ctx context.Context, req resource.CreateRequest, res
},
}
}
} else {
// explicitly set a null value for non IB enabled VMs
plan.HostChannelAdapters = types.ListNull(vmHostChannelAdapterSchema)
}

dataResp, httpResp, err := r.client.VMsApi.CreateInstance(ctx, swagger.InstancesPostRequestV1Alpha5{
Expand Down

0 comments on commit e868b99

Please sign in to comment.