private Output <ImmutableDictionary <string, KubernetesResource> > ParseTemplate(Union <ChartArgsUnwrap, LocalChartArgsUnwrap> args, string releaseName, ImmutableHashSet <Resource> dependsOn) { // Build JSON args to Helm provider invoke. var serializeOptions = new JsonSerializerOptions { IgnoreNullValues = true, }; BaseChartArgsUnwrap cfgBase; // Convert args to JSON string format expected by the invoke function. JsonOpts jsonOpts; string jsonOptsString; if (args.IsT0) { var cfg = args.AsT0; cfgBase = cfg; jsonOpts = new JsonOpts { ApiVersions = cfgBase.ApiVersions, IncludeTestHookResources = cfgBase.IncludeTestHookResources, Namespace = cfgBase.Namespace, Values = cfgBase.Values, ReleaseName = releaseName, Repo = cfg.Repo, Chart = cfg.Chart, Version = cfg.Version, }; if (cfg.FetchOptions != null) { jsonOpts.FetchOptions = new JsonOptsFetch { Version = cfg.FetchOptions.Version, CAFile = cfg.FetchOptions.CAFile, CertFile = cfg.FetchOptions.CertFile, KeyFile = cfg.FetchOptions.KeyFile, Destination = cfg.FetchOptions.Destination, Keyring = cfg.FetchOptions.Keyring, Password = cfg.FetchOptions.Password, Repo = cfg.FetchOptions.Repo, UntarDir = cfg.FetchOptions.UntarDir, Username = cfg.FetchOptions.Username, Home = cfg.FetchOptions.Home, Devel = cfg.FetchOptions.Devel, Prov = cfg.FetchOptions.Prov, Untar = cfg.FetchOptions.Untar, Verify = cfg.FetchOptions.Verify, }; } } else { var cfg = args.AsT1; cfgBase = cfg; jsonOpts = new JsonOpts { ApiVersions = cfgBase.ApiVersions, IncludeTestHookResources = cfgBase.IncludeTestHookResources, Namespace = cfgBase.Namespace, Values = cfgBase.Values, ReleaseName = releaseName, Path = cfg.Path, }; } jsonOptsString = JsonSerializer.Serialize(jsonOpts, serializeOptions); return(Invokes .HelmTemplate(new HelmTemplateArgs { JsonOpts = jsonOptsString }) .Apply(objs => { var args = new ConfigGroupArgs { ResourcePrefix = cfgBase.ResourcePrefix, Objs = objs, Transformations = cfgBase.Transformations }; var opts = new ComponentResourceOptions { Parent = this, DependsOn = dependsOn.ToArray() }; return Parser.Parse(args, opts); })); }