Skip to content

Commit

Permalink
connectivity: use TestNamespace and ExternalDeploymentPort params
Browse files Browse the repository at this point in the history
in client-egress-l7-http-external-node CNP instead of the
fixed values to acconmodate the test namespace and external
deployment port change.

Signed-off-by: Yusuke Suzuki <[email protected]>
  • Loading branch information
ysksuzuki authored and jibi committed Jul 30, 2024
1 parent 1c5e05f commit 09486ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions connectivity/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ func renderTemplates(param check.Parameters) (map[string]string, error) {
"clientEgressL7TLSPolicyPortRangeYAML": clientEgressL7TLSPolicyPortRangeYAML,
"clientEgressL7HTTPMatchheaderSecretYAML": clientEgressL7HTTPMatchheaderSecretYAML,
"clientEgressL7HTTPMatchheaderSecretPortRangeYAML": clientEgressL7HTTPMatchheaderSecretPortRangeYAML,
"clientEgressL7HTTPExternalYAML": clientEgressL7HTTPExternalYAML,
"clientEgressNodeLocalDNSYAML": clientEgressNodeLocalDNSYAML,
"echoIngressFromCIDRYAML": echoIngressFromCIDRYAML,
"denyCIDRPolicyYAML": denyCIDRPolicyYAML,
Expand Down
6 changes: 3 additions & 3 deletions connectivity/builder/egress_gateway_with_l7_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ var clientEgressL7HTTPExternalYAML string

type egressGatewayWithL7Policy struct{}

func (t egressGatewayWithL7Policy) build(ct *check.ConnectivityTest, _ map[string]string) {
func (t egressGatewayWithL7Policy) build(ct *check.ConnectivityTest, templates map[string]string) {
newTest("egress-gateway-with-l7-policy", ct).
WithCondition(func() bool {
return versioncheck.MustCompile(">=1.16.0")(ct.CiliumVersion) && ct.Params().IncludeUnsafeTests
}).
WithCiliumPolicy(clientEgressICMPYAML).
WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). // DNS resolution only
WithCiliumPolicy(clientEgressL7HTTPExternalYAML). // L7 allow policy with HTTP introspection
WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). // DNS resolution only
WithCiliumPolicy(templates["clientEgressL7HTTPExternalYAML"]). // L7 allow policy with HTTP introspection
WithCiliumEgressGatewayPolicy(check.CiliumEgressGatewayPolicyParams{
Name: "cegp-sample-client",
PodSelectorKind: "client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ spec:
any:kind: client
egress:
- toFQDNs:
- matchName: "echo-external-node.cilium-test.svc.cluster.local"
- matchName: "echo-external-node.{{.TestNamespace}}.svc.cluster.local"
toPorts:
- ports:
- port: "8080"
- port: "{{.ExternalDeploymentPort}}"
protocol: TCP
rules:
http:
Expand Down

0 comments on commit 09486ff

Please sign in to comment.