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++ }