Skip to content

Commit ade19a2

Browse files
committed
E2E test
Signed-off-by: Richard Wall <[email protected]>
1 parent f5afbcc commit ade19a2

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

deploy/charts/csi-driver/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# metrics:
2+
# enabled: false
3+
# podMonitor:
4+
# enabled: false
5+
16
image:
27
# Target image registry. This value is prepended to the target image repository, if set.
38
# For example:
@@ -130,7 +135,7 @@ nodeSelector:
130135
kubernetes.io/os: linux
131136

132137
# Kubernetes affinity: constraints for pod assignment.
133-
#
138+
#
134139
# For example:
135140
# affinity:
136141
# nodeAffinity:

make/test-e2e.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ endif
4646

4747
test-e2e-deps: INSTALL_OPTIONS :=
4848
test-e2e-deps: INSTALL_OPTIONS += --set image.repository=$(oci_manager_image_name_development)
49+
# test-e2e-deps: INSTALL_OPTIONS += --set metrics.enabled=true
4950
test-e2e-deps: e2e-setup-cert-manager
5051
test-e2e-deps: install
5152

test/e2e/suite/cases/metrics.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package cases
2+
3+
import (
4+
"context"
5+
6+
. "github.com/onsi/ginkgo/v2"
7+
. "github.com/onsi/gomega"
8+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9+
10+
"github.com/cert-manager/csi-driver/test/e2e/framework"
11+
)
12+
13+
const certManagerNamespace = "cert-manager"
14+
15+
var _ = framework.CasesDescribe("Metrics", func() {
16+
f := framework.NewDefaultFramework("metrics")
17+
18+
FIt("should serve metrics", func() {
19+
pods, err := f.KubeClientSet.CoreV1().Pods(certManagerNamespace).List(context.TODO(), metav1.ListOptions{
20+
LabelSelector: "app.kubernetes.io/instance=csi-driver",
21+
})
22+
Expect(err).NotTo(HaveOccurred())
23+
Expect(pods.Items).To(HaveLen(1))
24+
for _, p := range pods.Items {
25+
resp, err := f.KubeClientSet.
26+
CoreV1().
27+
Pods(p.Namespace).
28+
ProxyGet("http", p.Name, "8080", "/metrics", map[string]string{}).
29+
DoRaw(context.TODO())
30+
Expect(err).NotTo(HaveOccurred())
31+
Expect(string(resp)).To(Equal("foo"))
32+
}
33+
})
34+
})

0 commit comments

Comments
 (0)