MCPcopy
hub / github.com/zegl/kube-score / reg

Function reg

score/checks/checks.go:100–108  ·  view source on GitHub ↗
(c *Checks, targetType, name, comment string, optional bool, fn CheckFunc[T], mp map[string]GenCheck[T])

Source from the content-addressed store, hash-verified

98}
99
100func 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
110func (c *Checks) RegisterPodCheck(name, comment string, fn CheckFunc[ks.PodSpecer]) {
111 reg(c, "Pod", name, comment, false, fn, c.pods)

Calls 3

NewCheckFunction · 0.85
machineFriendlyNameFunction · 0.85
isEnabledMethod · 0.45

Tested by

no test coverage detected