MCPcopy
hub / github.com/kubernetes/node-problem-detector / Run

Method Run

pkg/custompluginmonitor/plugin/plugin.go:62–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62func (p *Plugin) Run() {
63 defer func() {
64 klog.Info("Stopping plugin execution")
65 close(p.resultChan)
66 p.tomb.Done()
67 }()
68
69 runTicker := time.NewTicker(*p.config.PluginGlobalConfig.InvokeInterval)
70 defer runTicker.Stop()
71
72 // on boot run once
73 select {
74 case <-p.tomb.Stopping():
75 return
76 default:
77 p.runRules()
78 }
79
80 // run every InvokeInterval
81 for {
82 select {
83 case <-runTicker.C:
84 p.runRules()
85 case <-p.tomb.Stopping():
86 return
87 }
88 }
89}
90
91// run each rule in parallel and wait for them to complete
92func (p *Plugin) runRules() {

Callers

nothing calls this directly

Calls 4

runRulesMethod · 0.95
DoneMethod · 0.80
StoppingMethod · 0.80
StopMethod · 0.65

Tested by

no test coverage detected