(c *Checks, targetType, name, comment string, optional bool, fn CheckFunc[T], mp map[string]GenCheck[T])
| 98 | } |
| 99 | |
| 100 | func reg[T any](c *Checks, targetType, name, comment string, optional bool, fn CheckFunc[T], mp map[string]GenCheck[T]) { |
| 101 | ch := NewCheck(name, targetType, comment, optional) |
| 102 | check := GenCheck[T]{Check: ch, Fn: fn} |
| 103 | c.all = append(c.all, check.Check) |
| 104 | if !c.isEnabled(check.Check) { |
| 105 | return |
| 106 | } |
| 107 | mp[machineFriendlyName(ch.Name)] = check |
| 108 | } |
| 109 | |
| 110 | func (c *Checks) RegisterPodCheck(name, comment string, fn CheckFunc[ks.PodSpecer]) { |
| 111 | reg(c, "Pod", name, comment, false, fn, c.pods) |
no test coverage detected