From 8880544881f9be4674ff1c37904cc528050d2776 Mon Sep 17 00:00:00 2001 From: Megrez Lu Date: Fri, 29 Nov 2024 11:28:10 +0800 Subject: [PATCH] fix nil check Signed-off-by: Megrez Lu --- pkg/controller/rollout/rollout_progressing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/rollout/rollout_progressing.go b/pkg/controller/rollout/rollout_progressing.go index e834e100..24be281a 100644 --- a/pkg/controller/rollout/rollout_progressing.go +++ b/pkg/controller/rollout/rollout_progressing.go @@ -601,7 +601,7 @@ func newTrafficRoutingContext(c *RolloutContext) *trafficrouting.TrafficRoutingC revisionLabelKey = c.Workload.RevisionLabelKey } var selectorPatch map[string]string - if c.Rollout.Spec.Strategy.GetRollingStyle() == v1beta1.CanaryRollingStyle { + if !c.Rollout.Spec.Strategy.DisableGenerateCanaryService() && c.Rollout.Spec.Strategy.Canary.PatchPodTemplateMetadata != nil { selectorPatch = c.Rollout.Spec.Strategy.Canary.PatchPodTemplateMetadata.Labels } return &trafficrouting.TrafficRoutingContext{