Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectivity: disrupt deployment improved #2679

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ jobs:
# disruption), but we want to make sure that the command works as expected.
#
# Dispatch interval is set to 100ms, b/c otherwise (default is 0), the flow validation might time out.
cilium connectivity test --test-namespace test-namespace \
--test-concurrency=5 \
cilium connectivity test --test-namespace test-namespace-1 \
--conn-disrupt-dispatch-interval 100ms \
--include-conn-disrupt-test --conn-disrupt-test-setup

Expand Down
1 change: 1 addition & 0 deletions cli/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ func newConnectivityTests(params check.Parameters, logger *check.ConcurrentLogge
for i := 0; i < params.TestConcurrency; i++ {
params := params
params.TestNamespace = fmt.Sprintf("%s-%d", params.TestNamespace, i+1)
params.TestNamespaceIndex = i
if params.ExternalTargetCANamespace == "" {
params.ExternalTargetCANamespace = params.TestNamespace
}
Expand Down
1 change: 1 addition & 0 deletions connectivity/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Parameters struct {
AssumeCiliumVersion string
CiliumNamespace string
TestNamespace string
TestNamespaceIndex int
TestConcurrency int
SingleNode bool
PrintFlows bool
Expand Down
2 changes: 1 addition & 1 deletion connectivity/check/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (ct *ConnectivityTest) SetupAndValidate(ctx context.Context, extra SetupHoo
return fmt.Errorf("unable to detect nodes w/o Cilium IPs: %w", err)
}
}
if match, _ := ct.Features.MatchRequirements((features.RequireEnabled(features.CIDRMatchNodes))); match {
if match, _ := ct.Features.MatchRequirements(features.RequireEnabled(features.CIDRMatchNodes)); match {
if err := ct.detectNodeCIDRs(ctx); err != nil {
return fmt.Errorf("unable to detect node CIDRs: %w", err)
}
Expand Down
7 changes: 4 additions & 3 deletions connectivity/check/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,9 @@ func (ct *ConnectivityTest) deploy(ctx context.Context) error {
return ct.deployPerf(ctx)
}

// Deploy test-conn-disrupt actors
if ct.params.ConnDisruptTestSetup {
// Deploy test-conn-disrupt actors (only in the first
// test namespace in case of tests concurrent run)
if ct.params.ConnDisruptTestSetup && ct.params.TestNamespaceIndex == 0 {
_, err = ct.clients.src.GetDeployment(ctx, ct.params.TestNamespace, testConnDisruptServerDeploymentName, metav1.GetOptions{})
if err != nil {
ct.Logf("✨ [%s] Deploying %s deployment...", ct.clients.src.ClusterName(), testConnDisruptServerDeploymentName)
Expand Down Expand Up @@ -1156,7 +1157,7 @@ func (ct *ConnectivityTest) deploymentList() (srcList []string, dstList []string
}
}

if ct.params.IncludeConnDisruptTest {
if ct.params.IncludeConnDisruptTest && ct.params.TestNamespaceIndex == 0 {
// We append the server and client deployment names to two different
// lists. This matters when running in multi-cluster mode, because
// the server is deployed in the local cluster (targeted by the "src"
Expand Down
Loading