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

Revert "fix(MeshLoadBalancingStrategy): set all priorities equal if localityAware is disabled" #11984

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,6 @@ func configureEndpoints(
}
}
}
if conf.LocalityAwareness != nil && pointer.Deref(conf.LocalityAwareness.Disabled) {
for _, cla := range endpoints {
for _, localityLbEndpoints := range cla.Endpoints {
if localityLbEndpoints.Locality != nil && localityLbEndpoints.Locality.Zone != localZone {
localityLbEndpoints.Priority = 0
}
}
}
}
return nil
}

Expand Down
38 changes: 2 additions & 36 deletions test/e2e_env/multizone/localityawarelb/meshmultizoneservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
testserver.WithMesh(meshName),
testserver.WithEchoArgs("echo", "--instance", "kube-test-server-1"),
)).
Install(democlient.Install(democlient.WithNamespace(namespace), democlient.WithMesh(meshName))).
SetupInGroup(multizone.KubeZone1, &group)

NewClusterSetup().
Expand Down Expand Up @@ -96,9 +95,7 @@ spec:
It("should fallback only to first zone", func() {
// given traffic to other zones
Eventually(responseFromInstance(multizone.KubeZone2), "30s", "1s").
Should(Equal("kube-test-server-1"))
Eventually(responseFromInstance(multizone.KubeZone2), "30s", "1s").
Should(Equal("uni-test-server"))
MustPassRepeatedly(5).Should(Or(Equal("kube-test-server-1"), Equal("uni-test-server")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just revert this part?


// when
policy := `
Expand All @@ -112,7 +109,7 @@ spec:
- targetRef:
kind: MeshMultiZoneService
labels:
kuma.io/display-name: test-server
kuma.io/display-name: test-server
default:
localityAwareness:
crossZone:
Expand All @@ -134,35 +131,4 @@ spec:
Eventually(responseFromInstance(multizone.KubeZone2), "30s", "1s").
MustPassRepeatedly(5).Should(Equal("kube-test-server-1"))
})

It("should be locality aware unless disabled", func() {
// given traffic only to the local zone
Eventually(responseFromInstance(multizone.KubeZone1), "30s", "1s").
MustPassRepeatedly(5).Should(Equal("kube-test-server-1"))

// when
policy := `
type: MeshLoadBalancingStrategy
name: mlb-mzms
mesh: mlb-mzms
spec:
targetRef:
kind: Mesh
to:
- targetRef:
kind: MeshMultiZoneService
labels:
kuma.io/display-name: test-server
default:
localityAwareness:
disabled: true
`
err := multizone.Global.Install(YamlUniversal(policy))

// then
Expect(err).ToNot(HaveOccurred())

Eventually(responseFromInstance(multizone.KubeZone1), "30s", "1s").
Should(Equal("uni-test-server"))
})
}
Loading