Implemented using a specialized version of convertBody called convertHelmReleaseResource which handles converting the supported fields, their required renames, nesting and rewrites (see examples below or full example added to the tests)
It doesn't handle the helm provider blocks, haven't looked into these for this implementation, only the helm_release itself.
In tf, the helm_release resources uses blocksset_value, set_list and set_sensitive that have attributes name and value. With this implementation, these blocks are converted to a single values map as follows:
resource "helm_release" "example" {
name = "redis"
chart = "redis"
set {
name = "set_1"
value = "value1"
}
set_list {
name = "set_list_1"
value = "value1"
}
set_sensitive {
name = "set_sensitive_1"
value = "value1"
type = "string"
}
}
The block postrender { binaryPath = "bin", args = ["args"] } and field values = ["key:value"] are not converted yet. I need to think a bit more about these two because postrender block should be combined into a single string postrender = "bin arg"
the values field need to map to valueYamlFiles where each element of the list should be wrapped in stringAsset:
Description
This PR implements custom conversion handling for
helm_release
resources and maps them to resources of typekubernetes:helm.sh/v3:Release
.Addresses #58 Fixes https://github.com/pulumi/pulumi-kubernetes/issues/2744 because the type mapping is also handled for state conversions.
Implemented using a specialized version of
convertBody
calledconvertHelmReleaseResource
which handles converting the supported fields, their required renames, nesting and rewrites (see examples below or full example added to the tests)It doesn't handle the
helm
provider blocks, haven't looked into these for this implementation, only thehelm_release
itself.Basic example
becomes:
Example with repository options
Repository options in the tf schema are top-level fields but in pulumi-kubernetes, these are subfields of an options object
repositoryOpts
:becomes:
Example with custom chart values
In tf, the
helm_release
resources uses blocksset_value
,set_list
andset_sensitive
that have attributesname
andvalue
. With this implementation, these blocks are converted to a singlevalues
map as follows:becomes:
TODOs for other fields:
The block
postrender { binaryPath = "bin", args = ["args"] }
and fieldvalues = ["key:value"]
are not converted yet. I need to think a bit more about these two becausepostrender
block should be combined into a single stringpostrender = "bin arg"
the
values
field need to map tovalueYamlFiles
where each element of the list should be wrapped instringAsset
: