2020-12-22 00:26:10 +00:00
|
|
|
package auditor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Execute audits container data.
|
|
|
|
func (c *Context) Execute() {
|
|
|
|
c.init()
|
|
|
|
|
2020-12-22 08:08:31 +00:00
|
|
|
checks := []struct {
|
2020-12-22 00:26:10 +00:00
|
|
|
name string
|
|
|
|
exec func()
|
|
|
|
}{
|
|
|
|
{name: "PoR", exec: c.executePoR},
|
|
|
|
{name: "PoP", exec: c.executePoP},
|
|
|
|
{name: "PDP", exec: c.executePDP},
|
2020-12-22 08:08:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for i := range checks {
|
|
|
|
c.log.Debug(fmt.Sprintf("executing %s check...", checks[i].name))
|
2020-12-22 00:26:10 +00:00
|
|
|
|
|
|
|
if c.expired() {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
2020-12-22 08:08:31 +00:00
|
|
|
checks[i].exec()
|
|
|
|
|
|
|
|
if i == len(checks)-1 {
|
|
|
|
c.complete()
|
|
|
|
}
|
2020-12-22 00:26:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
c.writeReport()
|
|
|
|
}
|