Mutating policies
Mutating policies are structured in the same way as validating ones:
- They have to register
validateandvalidate_settingswaPC functions. - The communication API used between the host and the policy is the same as that used by validating policies.
Mutating policies accept a request and can propose a mutation of the incoming
object by returning a ValidationResponse object that looks like this:
{
"accepted": true,
"mutated_object": <object to be created>
}
The mutated_object field contains the object the policy wants to be created in the Kubernetes cluster,
serialized to JSON.