Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion helm/resource_helm_release_stateupgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@ func (r *HelmRelease) buildUpgradeStateMap(_ context.Context) map[int64]resource
}
}

normalizeKeyring := func(val tftypes.Value) tftypes.Value {
if val.IsNull() {
return tftypes.NewValue(tftypes.String, nil)
}
var str string
if err := val.As(&str); err == nil && str == "" {
return tftypes.NewValue(tftypes.String, nil)
}
return val
}

// Creating new type in FW
newType := tftypes.Object{
AttributeTypes: map[string]tftypes.Type{
Expand Down Expand Up @@ -293,7 +304,7 @@ func (r *HelmRelease) buildUpgradeStateMap(_ context.Context) map[int64]resource
"disable_webhooks": oldState["disable_webhooks"],
"force_update": oldState["force_update"],
"id": oldState["id"],
"keyring": oldState["keyring"],
"keyring": normalizeKeyring(oldState["keyring"]),
"lint": oldState["lint"],
"manifest": oldState["manifest"],
"max_history": oldState["max_history"],
Expand Down
Loading