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{