Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Created January 14, 2025 05:32
Show Gist options
  • Save ihcsim/96d42c4a5bcae8330e5a7aefc1736e63 to your computer and use it in GitHub Desktop.
Save ihcsim/96d42c4a5bcae8330e5a7aefc1736e63 to your computer and use it in GitHub Desktop.
func (v *validator) Validate(ctx context.Context, matchedResource schema.GroupVersionResource, versionedAttr *admission.VersionedAttributes, versionedParams runtime.Object, namespace *corev1.Namespace, runtimeCELCostBudget int64, authz authorizer.Authorizer) ValidateResult {
// ...
evalResults, remainingBudget, err := v.validationFilter.ForInput(ctx, versionedAttr, admissionRequest, optionalVars, ns, runtimeCELCostBudget)
if err != nil {
return ValidateResult{
Decisions: []PolicyDecision{
{
Action: policyDecisionActionForError(f),
Evaluation: EvalError,
Message: err.Error(),
},
},
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment