Skip to content

Commit 1cfe335

Browse files
committed
test: log during Service tests
1 parent 325b7cd commit 1cfe335

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

test-deployment-service.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: test-app
5+
namespace: default
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: test-app
11+
template:
12+
metadata:
13+
labels:
14+
app: test-app
15+
spec:
16+
containers:
17+
- name: test-app
18+
image: k8s.gcr.io/e2e-test-images/agnhost:2.33
19+
args:
20+
- netexec
21+
- --http-port=8080
22+
ports:
23+
- name: http
24+
containerPort: 8080
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: test-app
30+
namespace: default
31+
spec:
32+
type: LoadBalancer
33+
selector:
34+
app: test-app
35+
ports:
36+
- name: http
37+
port: 80
38+
protocol: TCP
39+
targetPort: 8080

test/e2e/serviceloadbalancer_helpers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
"k8s.io/apimachinery/pkg/util/intstr"
23+
"k8s.io/klog/v2"
2324
"k8s.io/utils/ptr"
2425
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2526
"sigs.k8s.io/cluster-api/test/framework"
@@ -168,8 +169,10 @@ func EnsureLoadBalancerService(
168169
Host: getLoadBalancerAddress(svc),
169170
Path: "/clientip",
170171
}
172+
klog.Infof("Testing the LoadBalancer Service on: %q", getClientIPURL.String())
171173
output := testServiceLoadBalancer(ctx, getClientIPURL, input.ServiceIntervals)
172174
Expect(output).ToNot(BeEmpty())
175+
klog.Infof("Got output from Kubernetes LoadBalancer Service: %q", output)
173176
}
174177

175178
func createTestService(

0 commit comments

Comments
 (0)