Skip to content

Commit 3e18fb9

Browse files
authored
Merge pull request #526 from vshn/fix/cnpg-version
CNPG: Fix majorVersion
2 parents 3df5eb4 + 0caf2a8 commit 3e18fb9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

pkg/comp-functions/functions/vshnpostgrescnpg/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func createCnpgHelmValues(ctx context.Context, svc *runtime.ServiceRuntime, comp
228228
},
229229
},
230230
"version": map[string]string{
231-
"postgres": comp.Spec.Parameters.Service.MajorVersion,
231+
"postgresql": comp.Spec.Parameters.Service.MajorVersion,
232232
},
233233
}
234234

pkg/comp-functions/functions/vshnpostgrescnpg/deploy_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ func Test_instances(t *testing.T) {
4040
}
4141
}
4242

43+
func Test_version(t *testing.T) {
44+
svc, comp := getSvcCompCnpg(t)
45+
ctx := context.TODO()
46+
47+
for _, v := range []string{
48+
"15", "16", "17",
49+
} {
50+
comp.Spec.Parameters.Service.MajorVersion = v
51+
values, err := createCnpgHelmValues(ctx, svc, comp)
52+
assert.NoError(t, err)
53+
assert.NotNil(t, values)
54+
55+
assert.Equal(t, v, values["version"].(map[string]string)["postgresql"])
56+
}
57+
}
58+
4359
func Test_sizing(t *testing.T) {
4460
svc, comp := getSvcCompCnpg(t)
4561
ctx := context.TODO()

0 commit comments

Comments
 (0)