Exemple #1
0
// ValidateUpdate is the default update validation for an end user.
func (networkPolicyStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) field.ErrorList {
	validationErrorList := validation.ValidateNetworkPolicy(obj.(*extensions.NetworkPolicy))
	updateErrorList := validation.ValidateNetworkPolicyUpdate(obj.(*extensions.NetworkPolicy), old.(*extensions.NetworkPolicy))
	return append(validationErrorList, updateErrorList...)
}
Exemple #2
0
// Validate validates a new NetworkPolicy.
func (networkPolicyStrategy) Validate(ctx api.Context, obj runtime.Object) field.ErrorList {
	networkPolicy := obj.(*extensions.NetworkPolicy)
	return validation.ValidateNetworkPolicy(networkPolicy)
}