From fe7615afb4e941c145f7c2a24b953ef0defd4977 Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Mon, 7 Feb 2022 11:30:21 +0100 Subject: [PATCH] Update matchLabels in LabelSelectors Signed-off-by: Somtochi Onyekwere --- pkg/canary/deployment_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/canary/deployment_controller.go b/pkg/canary/deployment_controller.go index e6e990f0..d0e1bd1a 100644 --- a/pkg/canary/deployment_controller.go +++ b/pkg/canary/deployment_controller.go @@ -489,6 +489,11 @@ func (c *DeploymentController) appendPrimarySuffixToValuesIfNeeded(labelSelector } } } + for key, value := range labelSelector.MatchLabels { + if contains(c.labels, key) { + labelSelector.MatchLabels[key] = value + "-primary" + } + } } }