pkg/router/istio: use canary.GetAnalysis to prevent nil pointer

This commit is contained in:
mathetake
2020-03-10 15:28:20 +09:00
parent d911e1ddc5
commit 3425d6e965
+1 -1
View File
@@ -305,7 +305,7 @@ func (ir *IstioRouter) SetRoutes(
Host: canaryName,
}
if mw := canary.Spec.Analysis.MirrorWeight; mw > 0 {
if mw := canary.GetAnalysis().MirrorWeight; mw > 0 {
vsCopy.Spec.Http[0].MirrorPercentage = &istiov1alpha3.Percent{Value: mw}
}
}