From 891f3c6d5bb5af85f563eb7d2e123b64e6aa9f33 Mon Sep 17 00:00:00 2001 From: Ivan Matmati Date: Mon, 15 May 2023 16:14:12 +0200 Subject: [PATCH] BUG: correct parsing of url_param option for load-balance algorithm --- pkg/annotations/service/loadbalance.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/annotations/service/loadbalance.go b/pkg/annotations/service/loadbalance.go index c7a7b55e..ef7fb7e6 100644 --- a/pkg/annotations/service/loadbalance.go +++ b/pkg/annotations/service/loadbalance.go @@ -72,6 +72,9 @@ func getParamsFromInput(value string) (*models.Balance, error) { } i := 1 if algorithm == "url_param" { + if i >= len(tokens) { + return balance, fmt.Errorf("missing parameter for algorithm '%s' in balance configuration", algorithm) + } balance.URLParam = tokens[i] i++ }