INNER CODE UNIT · Go
NewCustomAuditor
Shopify/kubeaudit · example_custom_test.go:13
func NewCustomAuditor() kubeaudit.Auditable {
return &myAuditor{}
}
// Your auditor must implement the Auditable interface, which requires only one method: Audit().
type myAuditor struct{}
// The Audit function takes in a resource to audit and returns audit results for that resource.
//
// Params
// resource: Read-only. The resource to audit.
// resources: Read-only. A reference to all resources. Can be used for context though most auditors don't need this.
//
// Return
// auditResults: The results for the audit. Each result can optionally include a PendingFix object to
// define autofix behaviour (see below).
func (a *myAuditor) Audit(resource k8s.Resource, _ []k8s.Resource) ([]*kubeaudit.AuditResult, error) {
return []*kubeaudit.AuditResult{