Skip to content

Commit

Permalink
Fix import state test. ListUnkown > ListNull
Browse files Browse the repository at this point in the history
  • Loading branch information
JaylonmcShan03 committed Jan 7, 2025
1 parent 65ed46c commit f8d14e8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions helm-framework/helm/resource_helm_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -1994,30 +1994,29 @@ func (r *HelmRelease) ImportState(ctx context.Context, req resource.ImportStateR
return
}

// NOTE we can't read the config at import time, we have to set the values to unknown
state.Set = types.ListUnknown(types.ObjectType{
state.Set = types.ListNull(types.ObjectType{
AttrTypes: map[string]attr.Type{
"name": types.StringType,
"type": types.StringType,
"value": types.StringType,
},
})
state.SetSensitive = types.ListUnknown(types.ObjectType{
state.SetSensitive = types.ListNull(types.ObjectType{
AttrTypes: map[string]attr.Type{
"name": types.StringType,
"type": types.StringType,
"value": types.StringType,
},
})
state.SetList = types.ListUnknown(types.ObjectType{
state.SetList = types.ListNull(types.ObjectType{
AttrTypes: map[string]attr.Type{
"name": types.StringType,
"value": types.ListType{
ElemType: types.StringType,
},
},
})
state.Values = types.ListUnknown(types.StringType)
state.Values = types.ListNull(types.StringType)

tflog.Debug(ctx, fmt.Sprintf("Setting final state: %+v", state))
diags = resp.State.Set(ctx, &state)
Expand Down

0 comments on commit f8d14e8

Please sign in to comment.