https://pulumi.com logo
#general
Title
# general
a

acceptable-diamond-55380

06/09/2023, 2:08 PM
Hello Pulumi Team, It seems there might be some discrepancies with the documentation regarding Helm Release resource. On this page section, it states the following to specify a Helm Chart Values file (specifically in Go), using the
pulumi.NewFileAsset
method under the
ValueYamlFiles
release arguments.
Copy code
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:
Copy code
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?
b

billowy-army-68599

06/09/2023, 3:22 PM
@acceptable-diamond-55380
ValueYamlFiles
takes an array, so I think you need:
Copy code
pulumi.AssetOrArchiveArrayInput{ pulumi.NewFileAsset("./metrics.yml")  }
untested, but hopefully you get the idea
a

acceptable-diamond-55380

06/09/2023, 4:20 PM
pulumi.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.