Skip to content

Commit 82ed9c5

Browse files
authored
Merge pull request kubernetes#115800 from shogohida/switch-image-in-grpc-probe-tests-to-agnhost
Switch image in gRPC probe tests to agnhost
2 parents acf0ef4 + ad0a941 commit 82ed9c5

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

‎test/e2e/common/node/container_probe.go‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"context"
2121
"errors"
2222
"fmt"
23-
"net"
2423
"net/url"
2524
"strings"
2625
"time"
@@ -525,7 +524,7 @@ var _ = SIGDescribe("Probing container", func() {
525524
livenessProbe := &v1.Probe{
526525
ProbeHandler: v1.ProbeHandler{
527526
GRPC: &v1.GRPCAction{
528-
Port: 2379,
527+
Port: 5000,
529528
Service: nil,
530529
},
531530
},
@@ -534,7 +533,7 @@ var _ = SIGDescribe("Probing container", func() {
534533
FailureThreshold: 1,
535534
}
536535

537-
pod := gRPCServerPodSpec(nil, livenessProbe, "etcd")
536+
pod := gRPCServerPodSpec(nil, livenessProbe, "agnhost")
538537
RunLivenessTest(ctx, f, pod, 0, defaultObservationTimeout)
539538
})
540539

@@ -555,7 +554,7 @@ var _ = SIGDescribe("Probing container", func() {
555554
TimeoutSeconds: 5, // default 1s can be pretty aggressive in CI environments with low resources
556555
FailureThreshold: 1,
557556
}
558-
pod := gRPCServerPodSpec(nil, livenessProbe, "etcd")
557+
pod := gRPCServerPodSpec(nil, livenessProbe, "agnhost")
559558
RunLivenessTest(ctx, f, pod, 1, defaultObservationTimeout)
560559
})
561560

@@ -630,7 +629,7 @@ done
630629
podClient := e2epod.NewPodClient(f)
631630
terminationGracePeriod := int64(30)
632631
script := `
633-
_term() {
632+
_term() {
634633
rm -f /tmp/ready
635634
rm -f /tmp/liveness
636635
sleep 20
@@ -641,7 +640,7 @@ trap _term SIGTERM
641640
touch /tmp/ready
642641
touch /tmp/liveness
643642
644-
while true; do
643+
while true; do
645644
echo \"hello\"
646645
sleep 10
647646
done
@@ -1036,27 +1035,18 @@ func runReadinessFailTest(ctx context.Context, f *framework.Framework, pod *v1.P
10361035
}
10371036

10381037
func gRPCServerPodSpec(readinessProbe, livenessProbe *v1.Probe, containerName string) *v1.Pod {
1039-
etcdLocalhostAddress := "127.0.0.1"
1040-
if framework.TestContext.ClusterIsIPv6() {
1041-
etcdLocalhostAddress = "::1"
1042-
}
1043-
etcdURL := fmt.Sprintf("http://%s", net.JoinHostPort(etcdLocalhostAddress, "2379"))
10441038
return &v1.Pod{
10451039
ObjectMeta: metav1.ObjectMeta{Name: "test-grpc-" + string(uuid.NewUUID())},
10461040
Spec: v1.PodSpec{
10471041
Containers: []v1.Container{
10481042
{
10491043
Name: containerName,
1050-
Image: imageutils.GetE2EImage(imageutils.Etcd),
1044+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
10511045
Command: []string{
1052-
"/usr/local/bin/etcd",
1053-
"--listen-client-urls",
1054-
"http://0.0.0.0:2379", //should listen on all addresses
1055-
"--advertise-client-urls",
1056-
etcdURL,
1046+
"/agnhost",
1047+
"grpc-health-checking",
10571048
},
1058-
// 2380 is an automatic peer URL
1059-
Ports: []v1.ContainerPort{{ContainerPort: int32(2379)}, {ContainerPort: int32(2380)}},
1049+
Ports: []v1.ContainerPort{{ContainerPort: int32(5000)}, {ContainerPort: int32(8080)}},
10601050
LivenessProbe: livenessProbe,
10611051
ReadinessProbe: readinessProbe,
10621052
},

0 commit comments

Comments
 (0)