From 93c92d73c57e46d1103b320904252b74e0ffcb53 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 20 Jul 2023 16:39:36 +0530 Subject: [PATCH] fix: handle nil assignment error for canary transformation --- checks/common.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/checks/common.go b/checks/common.go index 73ff71fbf..20585fd85 100644 --- a/checks/common.go +++ b/checks/common.go @@ -88,10 +88,10 @@ func transform(ctx *context.Context, in *pkg.CheckResult) ([]*pkg.CheckResult, e r := t.ToCheckResult() r.Canary = in.Canary r.Canary.Namespace = def(t.Namespace, r.Canary.Namespace) + if r.Canary.Labels == nil { + r.Canary.Labels = make(map[string]string) + } for k, v := range t.Labels { - if r.Canary.Labels == nil { - r.Canary.Labels = make(map[string]string) - } r.Canary.Labels[k] = v } // We use this label to set the transformed column to true