INNER CODE UNIT · Go
func
Shopify/kubeaudit · example_custom_test.go:53
func (f *myAuditorFix) Plan() string {
return fmt.Sprintf("Set label 'hi' to '%s'", f.newVal)
}
// The Apply method applies a fix to a resource.
//
// Params
// resource: A reference to the resource that should be fixed.
//
// Return
// newResources: New resources created as part of the fix. Generally, it should not be necessary to create
// new resources, only modify the passed in resource.
func (f *myAuditorFix) Apply(resource k8s.Resource) []k8s.Resource {
setLabel(resource, "hi", f.newVal)
return nil
}
// This is just a helper function