mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 07:13:53 +00:00
[e2e] Update traffic distribution test
Skip traffic distribution test if cluster has < 3 zones. Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
This commit is contained in:
parent
a2a709077f
commit
6a77140cb0
@ -121,6 +121,17 @@ func SkipUnlessMultizone(ctx context.Context, c clientset.Interface) {
|
||||
}
|
||||
}
|
||||
|
||||
// SkipUnlessAtLeastNZones skips if the cluster does not have n multizones.
|
||||
func SkipUnlessAtLeastNZones(ctx context.Context, c clientset.Interface, n int) {
|
||||
zones, err := e2enode.GetClusterZones(ctx, c)
|
||||
if err != nil {
|
||||
skipInternalf(1, "Error listing cluster zones")
|
||||
}
|
||||
if zones.Len() < n {
|
||||
skipInternalf(1, "Requires >= %d zones", n)
|
||||
}
|
||||
}
|
||||
|
||||
// SkipIfMultizone skips if the cluster has multizone.
|
||||
func SkipIfMultizone(ctx context.Context, c clientset.Interface) {
|
||||
zones, err := e2enode.GetClusterZones(ctx, c)
|
||||
|
@ -49,7 +49,7 @@ var _ = common.SIGDescribe("TrafficDistribution", func() {
|
||||
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
c = f.ClientSet
|
||||
e2eskipper.SkipUnlessMultizone(ctx, c)
|
||||
e2eskipper.SkipUnlessAtLeastNZones(ctx, c, 3)
|
||||
})
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user