Skip to content

Conversation

jschwinger233
Copy link
Member

@jschwinger233 jschwinger233 commented Dec 17, 2024

It wasn't until #23445 was fixed in 1.14 when Cilium had robust IPv6 connectivity for IPsec[1]. Previously CI workflows didn't run IPv6 connectivity test for IPsec in 1.13, until #35314 recently enabled it. Subsequently, We noticed a number of CI failures in ci-ipsec-upgrade, caused by testing IPv6 connectivity in 1.13.

This patch reverts the deletion of if <1.14 then skip made by #35314 [2]

[1] #23461
[2] git diff aabda4b aabda4b~ | grep '<1.14.0' -C8

 func (t *Test) ForEachIPFamily(do func(features.IPFamily)) {
 	ipFams := []features.IPFamily{features.IPFamilyV4, features.IPFamilyV6}
 
+	// The per-endpoint routes feature is broken with IPv6 on < v1.14 when there
+	// are any netpols installed (https://github.com/cilium/cilium/issues/23852
+	// and https://github.com/cilium/cilium/issues/23910).
+	if f, ok := t.Context().Feature(features.EndpointRoutes); ok &&
+		f.Enabled && (len(t.cnps) > 0 || len(t.knps) > 0) &&
+		versioncheck.MustCompile("<1.14.0")(t.Context().CiliumVersion) {
+
+		ipFams = []features.IPFamily{features.IPFamilyV4}
+	}
+
 	for _, ipFam := range ipFams {
 		switch ipFam {
 		case features.IPFamilyV4:
@@ -853,6 +979,18 @@ func (t *Test) CertificateCAs() map[string][]byte {
--
+	"github.com/cilium/cilium/pkg/versioncheck"
 )
 
 // PodToService sends an HTTP request from all client Pods
@@ -227,6 +228,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 features.GetIPFamily(addr.Address) == features.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()))
diff --git a/cilium-cli/k8s/client.go b/cilium-cli/k8s/client.go

1.14 ci-ipsec-upgrade test: #36668

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 17, 2024
@github-actions github-actions bot added cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary labels Dec 17, 2024
@jschwinger233 jschwinger233 added area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary release-note/misc This PR makes changes that have no direct user impact. and removed cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. labels Dec 17, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Dec 17, 2024
jschwinger233 added a commit that referenced this pull request Dec 17, 2024
Signed-off-by: gray <gray.liang@isovalent.com>
@jschwinger233
Copy link
Member Author

/ci-ipsec-upgrade

jschwinger233 added a commit that referenced this pull request Dec 17, 2024
Signed-off-by: gray <gray.liang@isovalent.com>
jschwinger233 added a commit that referenced this pull request Dec 17, 2024
Signed-off-by: gray <gray.liang@isovalent.com>
jschwinger233 added a commit that referenced this pull request Dec 17, 2024
Signed-off-by: gray <gray.liang@isovalent.com>
@jschwinger233
Copy link
Member Author

/test

@jschwinger233 jschwinger233 force-pushed the pr/gray/cli-skip-ipv6-conntest-for-1.13 branch from 0cb64a1 to 30c9a74 Compare December 18, 2024 03:21
@jschwinger233 jschwinger233 changed the title cilium-cli: skip IPv6 connectivity test for Cilium<1.14 cilium-cli: skip IPv6 connectivity test for Cilium<1.14 when IPsec is enabled Dec 18, 2024
@jschwinger233
Copy link
Member Author

/test

@jschwinger233 jschwinger233 marked this pull request as ready for review December 18, 2024 04:29
@jschwinger233 jschwinger233 requested a review from a team as a code owner December 18, 2024 04:29
Copy link
Member

@giorio94 giorio94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me, thanks.

Previously CI workflows didn't run IPv6 connectivity test for IPsec in 1.13, until #35314 recently enabled it.

Is #35314 actually the correct PR? I don't see how it changed the behavior here.

@jschwinger233
Copy link
Member Author

Is #35314 actually the correct PR? I don't see how it changed the behavior here.

git bisect said so 😶‍🌫️ I was also surprised

@julianwiedmann julianwiedmann added the feature/ipv6 Relates to IPv6 protocol support label Dec 19, 2024
@julianwiedmann julianwiedmann added the feature/ipsec Relates to Cilium's IPsec feature label Dec 19, 2024
@tklauser tklauser enabled auto-merge December 19, 2024 08:18
@julianwiedmann
Copy link
Member

Is #35314 actually the correct PR? I don't see how it changed the behavior here.

git bisect said so 😶‍🌫️ I was also surprised

That PR removes several "skip IPv6 on <v1.14" checks. So in essence this is a regression, and ideally we'd restore those checks so that the downgrade to v1.13 works again.

cc @squeed

@jschwinger233 jschwinger233 marked this pull request as draft December 26, 2024 09:53
auto-merge was automatically disabled December 26, 2024 09:53

Pull request was converted to draft

@jschwinger233 jschwinger233 force-pushed the pr/gray/cli-skip-ipv6-conntest-for-1.13 branch from 30c9a74 to a6cc4de Compare December 26, 2024 10:17
jschwinger233 added a commit that referenced this pull request Dec 26, 2024
Signed-off-by: gray <gray.liang@isovalent.com>
@jschwinger233 jschwinger233 force-pushed the pr/gray/cli-skip-ipv6-conntest-for-1.13 branch from a6cc4de to 313b84a Compare December 26, 2024 11:46
@jschwinger233
Copy link
Member Author

/test

@jschwinger233 jschwinger233 force-pushed the pr/gray/cli-skip-ipv6-conntest-for-1.13 branch from 313b84a to bd7a9fe Compare December 26, 2024 11:49
@jschwinger233
Copy link
Member Author

/test

@jschwinger233 jschwinger233 changed the title cilium-cli: skip IPv6 connectivity test for Cilium<1.14 when IPsec is enabled cilium-cli: skip some IPv6 connectivity tests for Cilium<1.14 when IPsec is enabled Dec 26, 2024
It wasn't until #23445 was fixed
in 1.14 when Cilium had robust IPv6 connectivity for IPsec[1].
Previously CI workflows didn't run IPv6 connectivity for IPsec in 1.13,
until #35314 recently enabled it.
Subsequently, We noticed a number of CI failures in ci-ipsec-upgrade,
caused by testing IPv6 connectivity in 1.13.

This patch reverts the deletion of `if <1.14 then skip` made by
#35314. [2]

[1] #23461
[2] git diff aabda4b aabda4b~

```
 func (t *Test) ForEachIPFamily(do func(features.IPFamily)) {
+	// The per-endpoint routes feature is broken with IPv6 on < v1.14 when there
+	// are any netpols installed (#23852
+	// and #23910).
+	if f, ok := t.Context().Feature(features.EndpointRoutes); ok &&
+		f.Enabled && (len(t.cnps) > 0 || len(t.knps) > 0) &&
+		versioncheck.MustCompile("<1.14.0")(t.Context().CiliumVersion) {
+
+		ipFams = []features.IPFamily{features.IPFamilyV4}
+	}
+

func curlNodePort(ctx context.Context, s check.Scenario, t *check.Test,
+			//  Skip IPv6 requests when running on <1.14.0 Cilium with CNPs
+			if features.GetIPFamily(addr.Address) == features.IPFamilyV6 &&
+				versioncheck.MustCompile("<1.14.0")(t.Context().CiliumVersion) &&
+				(len(t.CiliumNetworkPolicies()) > 0 || len(t.KubernetesNetworkPolicies()) > 0) {
+				continue
+			}
+
```

Signed-off-by: gray <gray.liang@isovalent.com>
@jschwinger233 jschwinger233 force-pushed the pr/gray/cli-skip-ipv6-conntest-for-1.13 branch from bd7a9fe to 4cc0d20 Compare December 27, 2024 03:17
@jschwinger233
Copy link
Member Author

/test

@jschwinger233 jschwinger233 marked this pull request as ready for review December 27, 2024 07:59
@jschwinger233 jschwinger233 requested a review from a team as a code owner December 27, 2024 07:59
Copy link
Member

@julianwiedmann julianwiedmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@julianwiedmann julianwiedmann removed the request for review from ysksuzuki January 6, 2025 06:03
@aanm aanm disabled auto-merge January 6, 2025 08:13
@aanm aanm merged commit e702d9e into main Jan 6, 2025
220 checks passed
@aanm aanm deleted the pr/gray/cli-skip-ipv6-conntest-for-1.13 branch January 6, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary feature/ipsec Relates to Cilium's IPsec feature feature/ipv6 Relates to IPv6 protocol support release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants