From 3425d6e965fef33aeb90cde39932614b0837d976 Mon Sep 17 00:00:00 2001 From: mathetake Date: Tue, 10 Mar 2020 15:28:20 +0900 Subject: [PATCH] pkg/router/istio: use canary.GetAnalysis to prevent nil pointer --- pkg/router/istio.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/router/istio.go b/pkg/router/istio.go index 4122e821..f38d6b9a 100644 --- a/pkg/router/istio.go +++ b/pkg/router/istio.go @@ -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} } }