Skip to content

Commit

Permalink
connectivity: Skip IPv6 requests in north-south-loadbalancing-with-l7…
Browse files Browse the repository at this point in the history
…-policy when running on < 1.14.0 Cilium

cilium/cilium#21954 for the IPv6 path was
resolved only for v1.14, but not for v1.13. In order to be able to run
the latest connectivity tests on v1.13, we need to skip curl requests to
the IPv6 addresses in that particular test.

Fixes: cilium#1627

Signed-off-by: Zhichuan Liang <gray.liang@isovalent.com>
  • Loading branch information
jschwinger233 committed May 18, 2023
1 parent 0c69afa commit 329f3d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions connectivity/check/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,3 +655,11 @@ func (t *Test) ForEachIPFamily(do func(IPFamily)) {
func (t *Test) CertificateCAs() map[string][]byte {
return t.certificateCAs
}

func (t *Test) CiliumNetworkPolicies() map[string]*ciliumv2.CiliumNetworkPolicy {
return t.cnps
}

func (t *Test) KubernetesNetworkPolicies() map[string]*networkingv1.NetworkPolicy {
return t.knps
}
9 changes: 9 additions & 0 deletions connectivity/tests/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (

corev1 "k8s.io/api/core/v1"

"github.com/cilium/cilium/pkg/versioncheck"

"github.com/cilium/cilium-cli/connectivity/check"
)

Expand Down Expand Up @@ -214,6 +216,13 @@ func curlNodePort(ctx context.Context, s check.Scenario, t *check.Test,
}
}

// Skip IPv6 requests when running on <1.14.0 Cilium with CNPs
if check.GetIPFamily(addr.Address) == check.IPFamilyV6 &&
versioncheck.MustCompile("<1.14.0")(t.Context().CiliumVersion) &&
(len(t.CiliumNetworkPolicies()) > 0 || len(t.KubernetesNetworkPolicies()) > 0) {
continue
}

// Manually construct an HTTP endpoint to override the destination IP
// and port of the request.
ep := check.HTTPEndpoint(name, fmt.Sprintf("%s://%s:%d%s", svc.Scheme(), addr.Address, np, svc.Path()))
Expand Down

0 comments on commit 329f3d0

Please sign in to comment.