Skip to content

Commit 4662c9f

Browse files
yashmehrotramoshloop
authored andcommitted
fix(kubernetes-resource): handle default display template error in case of timeout
1 parent d08c6fa commit 4662c9f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

checks/kubernetes_resource.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ func (c *KubernetesResourceChecker) Check(ctx context.Context, check v1.Kubernet
152152
backoff = retry.WithMaxDuration(maxRetryTimeout, backoff)
153153
}
154154

155+
// We do this before virtual check run in case the check times out
156+
// and returns an err, the default templating requires 'display' in env
157+
result.AddData(map[string]any{
158+
"display": make(map[string]any),
159+
})
160+
155161
retryErr := retry.Do(ctx, backoff, func(_ctx gocontext.Context) error {
156162
ctx.Logger.V(4).Infof("running check: %s", virtualCanary.Name)
157163

0 commit comments

Comments
 (0)