1
- namespace SimCube . PulumiDeployments . Resources . Helm ;
1
+ using Pulumi . Kubernetes . Helm . V3 ;
2
+ using Pulumi . Kubernetes . Types . Inputs . Helm . V3 ;
3
+
4
+ namespace SimCube . PulumiDeployments . Resources . Helm ;
2
5
3
6
[ SuppressMessage ( "Design" , "CA1051:Do not declare visible instance fields" , Justification = "I Want them." ) ]
4
7
[ SuppressMessage ( "ReSharper" , "InconsistentNaming" , Justification = "I Want them." ) ]
@@ -23,6 +26,7 @@ protected BaseHelmChartResource(
23
26
} ;
24
27
25
28
protected abstract string HelmValuesFile { get ; }
29
+ protected abstract string ChartName { get ; }
26
30
27
31
protected string RenderYamlValues ( Dictionary < string , string ? > environmentalVariables )
28
32
{
@@ -41,5 +45,32 @@ protected string RenderYamlValues(Dictionary<string, string?> environmentalVaria
41
45
return helmValuesFile ;
42
46
}
43
47
48
+ protected Release CreateRelease (
49
+ NamespaceResource @namespace ,
50
+ string helmChartName ,
51
+ string helmRepository ,
52
+ string ? helmChartVersion = null ,
53
+ bool waitForJobs = true ,
54
+ bool skipAwait = false ,
55
+ int timeout = 1200 ,
56
+ List < FileAsset > ? helmValuesFiles = null ) =>
57
+ new (
58
+ ChartName ,
59
+ new ( )
60
+ {
61
+ Namespace = @namespace . NamespaceName ,
62
+ Chart = helmChartName ,
63
+ Version = helmChartVersion ?? string . Empty ,
64
+ WaitForJobs = waitForJobs ,
65
+ SkipAwait = skipAwait ,
66
+ Timeout = timeout ,
67
+ RepositoryOpts = new RepositoryOptsArgs
68
+ {
69
+ Repo = helmRepository ,
70
+ } ,
71
+ ValueYamlFiles = new List < AssetOrArchive > ( helmValuesFiles ?? new List < FileAsset > ( ) ) ,
72
+ } ,
73
+ CustomResourceOptions ) ;
74
+
44
75
private string GetHelmValuesFilePath ( ) => Path . Combine ( AppContext . BaseDirectory , HelmValuesFolder , HelmValuesFile ) ;
45
76
}
0 commit comments