Skip to content

Commit

Permalink
fix a bug caused by previous merged PR
Browse files Browse the repository at this point in the history
Signed-off-by: yunbo <[email protected]>
  • Loading branch information
Funinu committed Dec 10, 2024
1 parent 4811ca7 commit 6885920
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/rollout/rollout_progressing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 6885920

Please sign in to comment.