From 68859205f79bf51354a8a329ce77ee5ce92b512a Mon Sep 17 00:00:00 2001 From: yunbo Date: Tue, 10 Dec 2024 18:47:40 +0800 Subject: [PATCH] fix a bug caused by previous merged PR Signed-off-by: yunbo --- pkg/controller/rollout/rollout_progressing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/rollout/rollout_progressing.go b/pkg/controller/rollout/rollout_progressing.go index e4ed86e6..dbdbe314 100644 --- a/pkg/controller/rollout/rollout_progressing.go +++ b/pkg/controller/rollout/rollout_progressing.go @@ -626,7 +626,8 @@ func newTrafficRoutingContext(c *RolloutContext) *trafficrouting.TrafficRoutingC revisionLabelKey = c.Workload.RevisionLabelKey } var selectorPatch map[string]string - if !c.Rollout.Spec.Strategy.DisableGenerateCanaryService() && c.Rollout.Spec.Strategy.Canary.PatchPodTemplateMetadata != nil { + if !c.Rollout.Spec.Strategy.DisableGenerateCanaryService() && c.Rollout.Spec.Strategy.Canary != nil && + c.Rollout.Spec.Strategy.Canary.PatchPodTemplateMetadata != nil { selectorPatch = c.Rollout.Spec.Strategy.Canary.PatchPodTemplateMetadata.Labels } return &trafficrouting.TrafficRoutingContext{