From 832ffa7d3c1870979c147f3d5108e2834b93aa16 Mon Sep 17 00:00:00 2001 From: andres gutierrez Date: Thu, 7 Dec 2023 11:25:54 -0800 Subject: [PATCH] update HCA status for non IB --- internal/common/util.go | 2 +- internal/vm/vm_resource.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/common/util.go b/internal/common/util.go index 1c9eac8..6d69fb7 100644 --- a/internal/common/util.go +++ b/internal/common/util.go @@ -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 diff --git a/internal/vm/vm_resource.go b/internal/vm/vm_resource.go index 4c6030d..f316190 100644 --- a/internal/vm/vm_resource.go +++ b/internal/vm/vm_resource.go @@ -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 @@ -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{