Skip to content

Commit 0870634

Browse files
authored
fix: pulumi postgres chart version (#1139)
* fix: pulumi postgres chart version * fix: missing init
1 parent 6079b03 commit 0870634

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

deployments/pulumi/pkg/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ type PostgresInstall struct {
157157

158158
// Password is the password for the Postgres database
159159
Password string `json:"password" yaml:"password"`
160+
161+
// ChartVersion is the bitnami/postgres chart version
162+
ChartVersion string `json:"chartVersion" yaml:"chartVersion"`
160163
}
161164

162165
type PostgresDatabase struct {
@@ -185,6 +188,7 @@ func (a *PostgresDatabase) toInput() *storage.PostgresDatabaseArgs {
185188
Install: &storage.PostgresInstallArgs{
186189
Username: pulumix.Val(a.Install.Username),
187190
Password: pulumix.Val(a.Install.Password),
191+
ChartVersion: pulumix.Val(a.Install.ChartVersion),
188192
},
189193
}
190194
}

deployments/pulumi/pkg/storage/component_postgres.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ func (cmp *PostgresDatabaseComponent) GetPort() pulumix.Input[int] {
5757
}
5858

5959
type PostgresInstallArgs struct {
60-
Username pulumix.Input[string]
61-
Password pulumix.Input[string]
60+
Username pulumix.Input[string]
61+
Password pulumix.Input[string]
62+
ChartVersion pulumix.Input[string]
6263
}
6364

6465
func (args *PostgresInstallArgs) SetDefaults() {
6566
if args.Username == nil {
6667
args.Username = pulumix.Val("")
6768
}
69+
if args.ChartVersion == nil {
70+
args.ChartVersion = pulumix.Val("")
71+
}
6872
args.Username = pulumix.Apply(args.Username, func(username string) string {
6973
if username == "" {
7074
return "root"
@@ -98,7 +102,7 @@ func newPostgresComponent(ctx *pulumi.Context, name string, args *PostgresCompon
98102

99103
cmp.Chart, err = helm.NewChart(ctx, "postgres", &helm.ChartArgs{
100104
Chart: pulumi.String("oci://registry-1.docker.io/bitnamicharts/postgresql"),
101-
Version: pulumi.String("16.4.7"),
105+
Version: args.ChartVersion.ToOutput(ctx.Context()).Untyped().(pulumi.StringOutput),
102106
Name: pulumi.String("postgres"),
103107
Namespace: args.Namespace.ToOutput(ctx.Context()).Untyped().(pulumi.StringOutput),
104108
Values: pulumi.Map{

0 commit comments

Comments
 (0)