Hello Pulumi Team, It seems there might be some d...
# general
a
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
@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
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.