Add weighted-round-robin policy to loadbalance plugin (#5662)

* Add weighted-round-robin policy to loadbalance plugin

Signed-off-by: Gabor Dozsa <gabor.dozsa@ibm.com>
This commit is contained in:
Gabor Dozsa
2023-01-27 17:36:56 +01:00
committed by GitHub
parent bf7c2cf37b
commit 7da2cedaf0
8 changed files with 975 additions and 36 deletions

View File

@@ -11,8 +11,8 @@ import (
"github.com/miekg/dns"
)
func TestLoadBalance(t *testing.T) {
rm := RoundRobin{Next: handler()}
func TestLoadBalanceRandom(t *testing.T) {
rm := LoadBalance{Next: handler(), shuffle: randomShuffle}
// the first X records must be cnames after this test
tests := []struct {
@@ -124,7 +124,7 @@ func TestLoadBalance(t *testing.T) {
}
func TestLoadBalanceXFR(t *testing.T) {
rm := RoundRobin{Next: handler()}
rm := LoadBalance{Next: handler()}
answer := []dns.RR{
test.SOA("skydns.test. 30 IN SOA ns.dns.skydns.test. hostmaster.skydns.test. 1542756695 7200 1800 86400 30"),