acceptable-diamond-55380
06/09/2023, 2:08 PMpulumi.NewFileAsset
method under the ValueYamlFiles
release arguments.
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := helm.NewRelease(ctx, "redis", helm.ReleaseArgs{
Chart: pulumi.String("redis"),
RepositoryOpts: helm.RepositoryOptsArgs{
Repo: pulumi.String("<https://charts.helm.sh/stable>"),
},
ValueYamlFiles: pulumi.NewFileAsset("./metrics.yml"),
Value: pulumi.Map{
"cluster": pulumi.Map{
"enabled": pulumi.Bool(true),
},
"rbac": pulumi.Map{
"create": pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
return nil
})
}
But I get the following compiler error:
cannot use pulumi.NewFileAsset("./metrics.yaml") (value of type pulumi.Asset) as pulumi.AssetOrArchiveArrayInput value in struct literal: pulumi.Asset does not implement pulumi.AssetOrArchiveArrayInput (missing method ToAssetOrArchiveArrayOutput)
It seems there's an issue with the implementation of pulumi.Asset
that is called within the NewFileAsset
method?billowy-army-68599
ValueYamlFiles
takes an array, so I think you need:
pulumi.AssetOrArchiveArrayInput{ pulumi.NewFileAsset("./metrics.yml") }
acceptable-diamond-55380
06/09/2023, 4:20 PMpulumi.AssetOrArchiveArray{pulumi.NewFileAsset("metrics.yml")}
Seems to work and is able to be parsed. I guess the official documentation should be updated for Pulumi newcomers as it is a bit misleading and/or confusing.