Skip to content

Commit

Permalink
connectivity: Run echo-ingress-l7-via-hostport-with-encryption for IPsec
Browse files Browse the repository at this point in the history
Since cilium/cilium#32897 has been fixed, it's
time to cover it.

Signed-off-by: gray <[email protected]>
  • Loading branch information
jschwinger233 committed Aug 15, 2024
1 parent bec22b9 commit 313d6a5
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions connectivity/builder/echo_ingress_l7.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,27 @@ func (t echoIngressL7) build(ct *check.ConnectivityTest, _ map[string]string) {
WithCondition(func() bool {
return versioncheck.MustCompile(">=1.16.0")(ct.CiliumVersion)
}).
WithFeatureRequirements(
features.RequireEnabled(features.L7Proxy),
// Once https://github.com/cilium/cilium/issues/33168 is fixed, we
// can enable for IPsec too.
features.RequireMode(features.EncryptionPod, "wireguard"),
// Otherwise pod->hostport traffic will be policy
// denied on the ingress of dest node when
// routing=vxlan + kpr=1 + bpf_masq=1
features.RequireEnabled(features.EncryptionNode),
).
WithCondition(func() bool {
if ok, _ := ct.Features.MatchRequirements(features.RequireEnabled(features.L7Proxy)); !ok {
return false
}
// wireguard requires node encryption, otherwise
// pod->hostport traffic will be policy denied on the
// ingress of dest node when routing=tunnel + kpr=1.
if ok, _ := ct.Features.MatchRequirements(features.RequireMode(features.EncryptionPod, "wireguard")); ok {
ok, _ = ct.Features.MatchRequirements(features.RequireEnabled(features.EncryptionNode))
return ok
}
// ipsec can't do node encryption, so just skip the test when routing=tunnel + kpr=1.
if ok, _ := ct.Features.MatchRequirements(features.RequireMode(features.EncryptionPod, "ipsec")); ok {
ok, _ = ct.Features.MatchRequirements(
features.RequireEnabled(features.Tunnel),
features.RequireEnabled(features.KPRMode),
)
return !ok
}
return false
}).
WithCiliumPolicy(echoIngressL7HTTPPolicyYAML). // L7 allow policy with HTTP introspection
WithScenarios(tests.PodToHostPort()).
WithExpectations(expectation)
Expand Down

0 comments on commit 313d6a5

Please sign in to comment.