mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
23 lines
842 B
Go
23 lines
842 B
Go
package engine
|
|
|
|
import (
|
|
types "github.com/nirmata/kyverno/pkg/apis/policy/v1alpha1"
|
|
"github.com/nirmata/kyverno/pkg/event"
|
|
"github.com/nirmata/kyverno/pkg/violation"
|
|
)
|
|
|
|
// As the logic to process the policies in stateless, we do not need to define struct and implement behaviors for it
|
|
// Instead we expose them as standalone functions passing the required atrributes
|
|
// The each function returns the changes that need to be applied on the resource
|
|
// the caller is responsible to apply the changes to the resource
|
|
|
|
// ProcessExisting checks for mutation and validation violations of existing resources
|
|
func ProcessExisting(policy types.Policy, rawResource []byte) ([]violation.Info, []event.Info, error) {
|
|
var violations []violation.Info
|
|
var events []event.Info
|
|
|
|
// TODO:
|
|
// Mutate()
|
|
// Validate()
|
|
return violations, events, nil
|
|
}
|