Skip to content

Commit a7cd211

Browse files
authored
chore: fix e2e upgrade test - add missing effective semver (#1128)
1 parent 9211e45 commit a7cd211

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

test/e2e/test_helm_install_upgrade.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ func TestHelmUpgrade(t *testing.T) {
5454
}
5555

5656
testCases := []struct {
57-
name string
58-
fromVersion string
59-
toVersion string
60-
objectsToDeploy []client.Object
61-
upgradeToCurrent bool
62-
assertionsAfterInstall []assertion
63-
assertionsAfterUpgrade []assertion
57+
name string
58+
fromVersion string
59+
toVersion string
60+
objectsToDeploy []client.Object
61+
upgradeToCurrent bool
62+
// If upgrading to an image tag that's not a valid semver, fill this to the effective semver so that charts
63+
// can correctly render semver-conditional templates.
64+
upgradeToEffectiveSemver string
65+
assertionsAfterInstall []assertion
66+
assertionsAfterUpgrade []assertion
6467
}{
6568
{
6669
name: "upgrade from one before latest to latest minor",
@@ -138,6 +141,9 @@ func TestHelmUpgrade(t *testing.T) {
138141
name: "upgrade from latest minor to current",
139142
fromVersion: "1.4.0", // renovate: datasource=docker packageName=kong/gateway-operator-oss
140143
upgradeToCurrent: true,
144+
// This is the effective semver of a next release. It's needed for the chart to properly render
145+
// semver-conditional templates.
146+
upgradeToEffectiveSemver: "1.5.0",
141147
objectsToDeploy: []client.Object{
142148
&operatorv1beta1.GatewayConfiguration{
143149
ObjectMeta: metav1.ObjectMeta{
@@ -332,6 +338,10 @@ func TestHelmUpgrade(t *testing.T) {
332338
"anonymous_reports": "false",
333339
}
334340

341+
if tc.upgradeToEffectiveSemver != "" {
342+
values["image.effectiveSemver"] = tc.upgradeToEffectiveSemver
343+
}
344+
335345
opts := &helm.Options{
336346
KubectlOptions: &k8s.KubectlOptions{
337347
Namespace: e.Namespace.Name,

0 commit comments

Comments
 (0)