Skip to content

Commit 63c27e6

Browse files
committed
Draft changes to debug conformance test issues.
Signed-off-by: Prince Pereira <[email protected]>
1 parent 08ee8bd commit 63c27e6

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

pkg/proxy/winkernel/proxier.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ func (proxier *Proxier) newServiceInfo(port *v1.ServicePort, service *v1.Service
598598
}
599599

600600
info.preserveDIP = preserveDIP
601-
info.targetPort = targetPort
601+
info.targetPort = 0
602602
info.hns = proxier.hns
603603
info.localTrafficDSR = localTrafficDSR
604604
info.internalTrafficLocal = internalTrafficLocal
@@ -1323,6 +1323,12 @@ func (proxier *Proxier) syncProxyRules() {
13231323
klog.V(4).InfoS("Skipped terminating status check for all endpoints", "svcClusterIP", svcInfo.ClusterIP(), "ingressLBCount", len(svcInfo.loadBalancerIngressIPs))
13241324
}
13251325

1326+
epsMap := proxier.endpointsMap[svcName]
1327+
klog.V(4).InfoS("TEST: Endpoints map for service", "svcName", svcName, "endpointsCount", len(epsMap))
1328+
for svcName := range proxier.endpointsMap {
1329+
klog.V(4).InfoS("TEST: Available services in endpointmap", "svcName", svcName, "endpointsCount", len(proxier.endpointsMap[svcName]))
1330+
}
1331+
13261332
for _, epInfo := range proxier.endpointsMap[svcName] {
13271333
ep, ok := epInfo.(*endpointInfo)
13281334
if !ok {
@@ -1357,8 +1363,10 @@ func (proxier *Proxier) syncProxyRules() {
13571363
// Note that hnslib.AddLoadBalancer() doesn't support endpoints with different ports, so only port from first endpoint is used.
13581364
// TODO(feiskyer): add support of different endpoint ports after hnslib.AddLoadBalancer() add that.
13591365
if svcInfo.targetPort == 0 {
1366+
klog.V(3).InfoS("Prince: svcInfo.targetPort == 0 ", "EpIP", ep.ip, " EpPort", ep.port)
13601367
svcInfo.targetPort = int(ep.port)
13611368
}
1369+
klog.V(3).InfoS("Prince: After svcInfo.targetPort == 0 ", "EpIP", ep.ip, " EpPort", ep.port)
13621370
// There is a bug in Windows Server 2019 that can cause two endpoints to be created with the same IP address, so we need to check using endpoint ID first.
13631371
// TODO: Remove lookup by endpoint ID, and use the IP address only, so we don't need to maintain multiple keys for lookup.
13641372
if len(ep.hnsID) > 0 {
@@ -1522,7 +1530,7 @@ func (proxier *Proxier) syncProxyRules() {
15221530
if !proxier.requiresUpdateLoadbalancer(svcInfo.hnsID, len(clusterIPEndpoints)) {
15231531
proxier.deleteExistingLoadBalancer(hns, svcInfo.winProxyOptimization, &svcInfo.hnsID, svcInfo.ClusterIP().String(), Enum(svcInfo.Protocol()), uint16(svcInfo.targetPort), uint16(svcInfo.Port()), hnsEndpoints, queriedLoadBalancers)
15241532
if len(clusterIPEndpoints) > 0 {
1525-
1533+
klog.V(3).InfoS("Prince: Creating clusterip lb ", "svcInfo.targetPort", svcInfo.targetPort)
15261534
// If all endpoints are terminating, then no need to create Cluster IP LoadBalancer
15271535
// Cluster IP LoadBalancer creation
15281536
hnsLoadBalancer, err := hns.getLoadBalancer(

test/conformance/testdata/conformance.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,22 @@
17271727
MUST have Endpoints and EndpointSlices pointing to each API server instance.
17281728
release: v1.21
17291729
file: test/e2e/network/endpointslice.go
1730+
- testname: EndpointSlice, multiple IPs, multiple ports
1731+
codename: '[sig-network] EndpointSlice should support a Service with multiple endpoint
1732+
IPs specified in multiple EndpointSlices [Conformance]'
1733+
description: Given a selector-less Service with multiple manually-created EndpointSlices
1734+
(and no Endpoints) where the endpoints have different IPs and different Ports,
1735+
the service proxy MUST allow connections to both ports.
1736+
release: v1.34
1737+
file: test/e2e/network/endpointslice.go
1738+
- testname: EndpointSlice, single IP, multiple ports
1739+
codename: '[sig-network] EndpointSlice should support a Service with multiple ports
1740+
specified in multiple EndpointSlices [Conformance]'
1741+
description: Given a selector-less Service with multiple manually-created EndpointSlices
1742+
(and no Endpoints) where the endpoints have the same IP but different Ports, the
1743+
service proxy MUST allow connections to both ports.
1744+
release: v1.34
1745+
file: test/e2e/network/endpointslice.go
17301746
- testname: EndpointSlice API
17311747
codename: '[sig-network] EndpointSlice should support creating EndpointSlice API
17321748
operations [Conformance]'

test/e2e/network/endpointslice.go

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,21 +528,29 @@ var _ = common.SIGDescribe("EndpointSlice", func() {
528528
gomega.Expect(epsList.Items).To(gomega.BeEmpty(), "filtered list should have 0 items")
529529
})
530530

531-
ginkgo.It("should support a Service with multiple ports specified in multiple EndpointSlices", func(ctx context.Context) {
531+
/*
532+
Release: v1.34
533+
Testname: EndpointSlice, single IP, multiple ports
534+
Description: Given a selector-less Service with multiple manually-created
535+
EndpointSlices (and no Endpoints) where the endpoints have the same IP
536+
but different Ports, the service proxy MUST allow connections to both ports.
537+
*/
538+
framework.ConformanceIt("should support a Service with multiple ports specified in multiple EndpointSlices", func(ctx context.Context) {
532539
ns := f.Namespace.Name
533540
svc := createServiceReportErr(ctx, cs, f.Namespace.Name, &v1.Service{
534541
ObjectMeta: metav1.ObjectMeta{
535-
Name: "example-custom-endpoints",
542+
Name: "example-custom-endpoints",
543+
Namespace: ns,
536544
},
537545
Spec: v1.ServiceSpec{
538546
Ports: []v1.ServicePort{
539547
{
540-
Name: "port80",
548+
Name: "port80prince",
541549
Port: 80,
542550
Protocol: v1.ProtocolTCP,
543551
},
544552
{
545-
Name: "port81",
553+
Name: "port81prince",
546554
Port: 81,
547555
Protocol: v1.ProtocolTCP,
548556
},
@@ -585,7 +593,9 @@ var _ = common.SIGDescribe("EndpointSlice", func() {
585593
tcpProtocol := v1.ProtocolTCP
586594
readyCondTrue := true
587595
epsTemplate := &discoveryv1.EndpointSlice{
588-
ObjectMeta: metav1.ObjectMeta{GenerateName: "e2e-custom-slice",
596+
ObjectMeta: metav1.ObjectMeta{
597+
GenerateName: "e2e-custom-slice",
598+
Namespace: ns,
589599
Labels: map[string]string{
590600
discoveryv1.LabelServiceName: svc.Name,
591601
discoveryv1.LabelManagedBy: "e2e-test" + ns,
@@ -602,7 +612,7 @@ var _ = common.SIGDescribe("EndpointSlice", func() {
602612
ginkgo.By("creating")
603613
eps1 := epsTemplate.DeepCopy()
604614
eps1.Ports = []discoveryv1.EndpointPort{{
605-
Name: pointer.String("port80"),
615+
Name: pointer.String("port80prince"),
606616
Port: pointer.Int32(8090),
607617
Protocol: &tcpProtocol,
608618
}}
@@ -611,7 +621,7 @@ var _ = common.SIGDescribe("EndpointSlice", func() {
611621
framework.ExpectNoError(err)
612622
eps2 := epsTemplate.DeepCopy()
613623
eps2.Ports = []discoveryv1.EndpointPort{{
614-
Name: pointer.String("port81"),
624+
Name: pointer.String("port81prince"),
615625
Port: pointer.Int32(9090),
616626
Protocol: &tcpProtocol,
617627
}}
@@ -631,11 +641,19 @@ var _ = common.SIGDescribe("EndpointSlice", func() {
631641

632642
})
633643

634-
ginkgo.It("should support a Service with multiple endpoint IPs specified in multiple EndpointSlices", func(ctx context.Context) {
644+
/*
645+
Release: v1.34
646+
Testname: EndpointSlice, multiple IPs, multiple ports
647+
Description: Given a selector-less Service with multiple manually-created
648+
EndpointSlices (and no Endpoints) where the endpoints have different IPs
649+
and different Ports, the service proxy MUST allow connections to both ports.
650+
*/
651+
framework.ConformanceIt("should support a Service with multiple endpoint IPs specified in multiple EndpointSlices", func(ctx context.Context) {
635652
ns := f.Namespace.Name
636653
svc := createServiceReportErr(ctx, cs, f.Namespace.Name, &v1.Service{
637654
ObjectMeta: metav1.ObjectMeta{
638-
Name: "example-custom-endpoints",
655+
Name: "example-custom-endpoints",
656+
Namespace: ns,
639657
},
640658
Spec: v1.ServiceSpec{
641659
Ports: []v1.ServicePort{

0 commit comments

Comments
 (0)