quay / clair

Vulnerability Static Analysis for Containers

Home Page:https://quay.github.io/clair/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It is not possible to set a health function

iainduncani opened this issue · comments

A default health handler func is used if the health function supplied to introspection.New is nil, however, if it is not nil then i.health is never set so you get a panic:

2022/07/21 10:40:43 http: panic serving 127.0.0.6:51003: runtime error: invalid memory address or nil pointer dereference
goroutine 2888 [running]:
net/http.(*conn).serve.func1()
	/usr/local/go/src/net/http/server.go:1802 +0xb9
panic({0xda1a00, 0x173a0a0})
	/usr/local/go/src/runtime/panic.go:1047 +0x266
github.com/quay/clair/v4/introspection.(*Server).withDiagnostics.func1({0x1020528, 0xc00016a2a0}, 0x51426d)
	/build/vendor/github.com/quay/clair/v4/introspection/server.go:207 +0x174