Skip to content

Commit 04f3552

Browse files
committed
Update integration tests
Signed-off-by: Alex Leong <[email protected]>
1 parent 4ec4217 commit 04f3552

File tree

4 files changed

+37
-24
lines changed

4 files changed

+37
-24
lines changed

pkg/healthcheck/healthcheck_multicluster.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ func (hc *HealthChecker) checkServiceMirrorLocalRBAC() error {
235235
return fmt.Errorf(strings.Join(errors, "\n"))
236236
}
237237

238+
if len(links) == 0 {
239+
return &SkipError{Reason: "no links"}
240+
}
241+
238242
return &VerboseSuccess{Message: strings.Join(links, "\n")}
239243
}
240244

@@ -271,6 +275,11 @@ func (hc *HealthChecker) checkServiceMirrorController() error {
271275
if len(errors) > 0 {
272276
return joinErrors(errors, 2)
273277
}
278+
279+
if len(clusterNames) == 0 {
280+
return &SkipError{Reason: "no links"}
281+
}
282+
274283
return &VerboseSuccess{Message: strings.Join(clusterNames, "\n")}
275284
}
276285

@@ -329,6 +338,11 @@ func (hc *HealthChecker) checkRemoteClusterConnectivity() error {
329338
if len(errors) > 0 {
330339
return joinErrors(errors, 2)
331340
}
341+
342+
if len(links) == 0 {
343+
return &SkipError{Reason: "no links"}
344+
}
345+
332346
return &VerboseSuccess{Message: strings.Join(links, "\n")}
333347
}
334348

@@ -404,6 +418,10 @@ func (hc *HealthChecker) checkRemoteClusterAnchors() error {
404418
return fmt.Errorf("Problematic clusters:\n %s", strings.Join(errors, "\n "))
405419
}
406420

421+
if len(links) == 0 {
422+
return &SkipError{Reason: "no links"}
423+
}
424+
407425
return &VerboseSuccess{Message: strings.Join(links, "\n")}
408426
}
409427

@@ -466,6 +484,11 @@ func (hc *HealthChecker) checkIfGatewayMirrorsHaveEndpoints(ctx context.Context)
466484
if len(errors) > 0 {
467485
return joinErrors(errors, 1)
468486
}
487+
488+
if len(links) == 0 {
489+
return &SkipError{Reason: "no links"}
490+
}
491+
469492
return &VerboseSuccess{Message: strings.Join(links, "\n")}
470493
}
471494

@@ -491,6 +514,11 @@ func (hc *HealthChecker) checkIfMirrorServicesHaveEndpoints() error {
491514
if len(servicesWithNoEndpoints) > 0 {
492515
return fmt.Errorf("Some mirror services do not have endpoints:\n %s", strings.Join(servicesWithNoEndpoints, "\n "))
493516
}
517+
518+
if len(mirrorServices.Items) == 0 {
519+
return &SkipError{Reason: "no mirror services"}
520+
}
521+
494522
return nil
495523
}
496524

@@ -522,6 +550,10 @@ func (hc *HealthChecker) checkForOrphanedServices() error {
522550
}
523551
}
524552

553+
if len(mirrorServices.Items) == 0 {
554+
return &SkipError{Reason: "no mirror services"}
555+
}
556+
525557
if len(errors) > 0 {
526558
return joinErrors(errors, 1)
527559
}

test/testdata/check.multicluster.golden

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,8 @@ linkerd-grafana
6868
√ grafana add-on config map exists
6969
√ grafana pod is running
7070

71-
linkerd-multicluster-source
71+
linkerd-multicluster
7272
---------------------------
73-
√ service mirror controller is running
74-
√ service mirror controller ClusterRoles exist
75-
√ service mirror controller ClusterRoleBindings exist
76-
√ service mirror controller Roles exist
77-
√ service mirror controller RoleBindings exist
78-
√ service mirror controller ServiceAccounts exist
79-
√ service mirror controller has required permissions
80-
√ multicluster daisy chaining is avoided
81-
√ all mirror services have endpoints
82-
√ all gateway mirrors have endpoints
73+
√ Link CRD exists
8374

8475
Status check results are √

test/testdata/check.multicluster.proxy.golden

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,8 @@ linkerd-grafana
7575
√ grafana add-on config map exists
7676
√ grafana pod is running
7777

78-
linkerd-multicluster-source
78+
linkerd-multicluster
7979
---------------------------
80-
√ service mirror controller is running
81-
√ service mirror controller ClusterRoles exist
82-
√ service mirror controller ClusterRoleBindings exist
83-
√ service mirror controller Roles exist
84-
√ service mirror controller RoleBindings exist
85-
√ service mirror controller ServiceAccounts exist
86-
√ service mirror controller has required permissions
87-
√ multicluster daisy chaining is avoided
88-
√ all mirror services have endpoints
89-
√ all gateway mirrors have endpoints
80+
√ Link CRD exists
9081

9182
Status check results are √

testutil/test_helper.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ func NewGenericTestHelper(
113113
// MulticlusterDeployReplicas is a map containing the number of replicas for each Deployment and the main
114114
// container name for multicluster components
115115
var MulticlusterDeployReplicas = map[string]DeploySpec{
116-
"linkerd-gateway": {1, []string{"nginx"}},
117-
"linkerd-service-mirror": {1, []string{"service-mirror"}},
116+
"linkerd-gateway": {1, []string{"nginx"}},
118117
}
119118

120119
// NewTestHelper creates a new instance of TestHelper for the current test run.

0 commit comments

Comments
 (0)