-
Notifications
You must be signed in to change notification settings - Fork 192
/
egress_gateway.go
31 lines (27 loc) · 976 Bytes
/
egress_gateway.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
package builder
import (
"github.com/cilium/cilium-cli/connectivity/check"
"github.com/cilium/cilium-cli/connectivity/tests"
"github.com/cilium/cilium-cli/utils/features"
)
type egressGateway struct{}
func (t egressGateway) build(ct *check.ConnectivityTest, _ map[string]string) {
newTest("egress-gateway", ct).
WithCondition(func() bool { return ct.Params().IncludeUnsafeTests }).
WithCiliumEgressGatewayPolicy(check.CiliumEgressGatewayPolicyParams{
Name: "cegp-sample-client",
PodSelectorKind: "client",
}).
WithCiliumEgressGatewayPolicy(check.CiliumEgressGatewayPolicyParams{
Name: "cegp-sample-echo",
PodSelectorKind: "echo",
}).
WithIPRoutesFromOutsideToPodCIDRs().
WithFeatureRequirements(
features.RequireEnabled(features.EgressGateway),
features.RequireEnabled(features.NodeWithoutCilium),
).
WithScenarios(tests.EgressGateway())
}