From 9adc6e6ab8eb46a3f27e68f6d4be9fa41a4e0989 Mon Sep 17 00:00:00 2001 From: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com> Date: Thu, 30 May 2024 11:10:05 +0300 Subject: [PATCH] Update images/kube-api-proxy/pkg/rewriter/rule_rewriter.go Co-authored-by: Ivan Mikheykin Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com> --- images/kube-api-proxy/pkg/rewriter/rule_rewriter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go b/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go index 8bc427366..3fdbaec26 100644 --- a/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go +++ b/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go @@ -161,7 +161,11 @@ func (rw *RuleBasedRewriter) rewriteLabelSelector(rawQuery string) string { labels := make(map[string]string, len(listLabels)) for _, l := range listLabels { ll := strings.Split(l, "=") - labels[ll[0]] = ll[1] + if (len(ll)>1) { + labels[ll[0]] = ll[1] + } else { + labels[ll[0]] = "" + } } labels = rw.Rules.RenameLabels(labels) count := 0