fix: keep round-robin as default routing

This commit is contained in:
gwizz
2025-12-22 23:39:41 +11:00
parent b078be4613
commit c020fa60d0
3 changed files with 5 additions and 5 deletions

View File

@@ -130,7 +130,7 @@ type QuotaExceeded struct {
// RoutingConfig configures how credentials are selected for requests. // RoutingConfig configures how credentials are selected for requests.
type RoutingConfig struct { type RoutingConfig struct {
// Strategy selects the credential selection strategy. // Strategy selects the credential selection strategy.
// Supported values: "fill-first" (default), "round-robin". // Supported values: "round-robin" (default), "fill-first".
Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"` Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"`
} }

View File

@@ -120,7 +120,7 @@ type Manager struct {
// NewManager constructs a manager with optional custom selector and hook. // NewManager constructs a manager with optional custom selector and hook.
func NewManager(store Store, selector Selector, hook Hook) *Manager { func NewManager(store Store, selector Selector, hook Hook) *Manager {
if selector == nil { if selector == nil {
selector = &FillFirstSelector{} selector = &RoundRobinSelector{}
} }
if hook == nil { if hook == nil {
hook = NoopHook{} hook = NoopHook{}

View File

@@ -205,10 +205,10 @@ func (b *Builder) Build() (*Service, error) {
} }
var selector coreauth.Selector var selector coreauth.Selector
switch strategy { switch strategy {
case "round-robin", "roundrobin", "rr": case "fill-first", "fillfirst", "ff":
selector = &coreauth.RoundRobinSelector{}
default:
selector = &coreauth.FillFirstSelector{} selector = &coreauth.FillFirstSelector{}
default:
selector = &coreauth.RoundRobinSelector{}
} }
coreManager = coreauth.NewManager(tokenStore, selector, nil) coreManager = coreauth.NewManager(tokenStore, selector, nil)