Skip to content

Commit e7f3c6b

Browse files
authored
Merge pull request #40 from galal-hussein/more_tests
More helm tests and upgrade klipper
2 parents 809a41e + 474a032 commit e7f3c6b

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

pkg/helm/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type Controller struct {
3939
}
4040

4141
const (
42-
image = "rancher/klipper-helm:v0.2.4"
42+
image = "rancher/klipper-helm:v0.2.5"
4343
Label = "helmcharts.helm.cattle.io/chart"
4444
CRDName = "helmcharts.helm.cattle.io"
4545
Name = "helm-controller"

test/framework/framework.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ func (f *Framework) ListHelmCharts(labelSelector, namespace string) (*helmapiv1.
185185
// WaitForChartApp will check the for pods created by the chart
186186
func (f *Framework) WaitForChartApp(chart *helmapiv1.HelmChart, appName string, timeout time.Duration, count int) (pods []corev1.Pod, err error) {
187187
labelSelector := labels.SelectorFromSet(labels.Set{
188-
"app": appName,
189-
"heritage": "Helm",
188+
"app": appName,
189+
"release": chart.Name,
190190
})
191191

192192
return pods, wait.Poll(5*time.Second, timeout, func() (bool, error) {

test/suite/helm_test.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,51 @@ var _ = Describe("Helm Tests", func() {
118118
})
119119
})
120120

121+
Context("When a helm V3 chart version is updated with values", func() {
122+
var (
123+
err error
124+
chart *helmapiv1.HelmChart
125+
secrets []corev1.Secret
126+
pods []corev1.Pod
127+
)
128+
BeforeEach(func() {
129+
chart = framework.NewHelmChart("traefik-update-example-values",
130+
"stable/traefik",
131+
"1.86.1",
132+
"v3",
133+
map[string]intstr.IntOrString{
134+
"rbac.enabled": {
135+
Type: intstr.String,
136+
StrVal: "true",
137+
},
138+
"ssl.enabled": {
139+
Type: intstr.String,
140+
StrVal: "true",
141+
},
142+
})
143+
chart, err = framework.CreateHelmChart(chart, framework.Namespace)
144+
Expect(err).ToNot(HaveOccurred())
145+
146+
labelSelector := labels.SelectorFromSet(labels.Set{
147+
"owner": "helm",
148+
"name": chart.Name,
149+
})
150+
secrets, err = framework.WaitForRelease(chart, labelSelector, 120*time.Second, 1)
151+
Expect(err).ToNot(HaveOccurred())
152+
Expect(secrets).To(HaveLen(1))
153+
154+
chart, err = framework.GetHelmChart("traefik-update-example-values", framework.Namespace)
155+
chart.Spec.Set["replicas"] = intstr.FromString("3")
156+
chart, err = framework.UpdateHelmChart(chart, framework.Namespace)
157+
Expect(err).ToNot(HaveOccurred())
158+
pods, err = framework.WaitForChartApp(chart, "traefik", 120*time.Second, 3)
159+
Expect(err).ToNot(HaveOccurred())
160+
})
161+
It("Should upgrade the release successfully", func() {
162+
Expect(len(pods)).To(BeEquivalentTo(3))
163+
})
164+
})
165+
121166
Context("When a helm V2 chart is created", func() {
122167
var (
123168
err error

0 commit comments

Comments
 (0)