Skip to content

Conversation

@JagjeevanAK
Copy link

Summary

This PR adds an optional expiresAt field to PolicyException to support time-based expiration of policy exceptions for CEL-based policies.

Changes

  • Add expiresAt field (metav1.Time) to PolicyExceptionSpec in all API versions (v1, v1alpha1, v1beta1)
  • Add IsExpired() method to PolicyException to check if the exception has expired
  • Update CRDs and generated code

Related Issues

Usage

apiVersion: policies.kyverno.io/v1beta1
kind: PolicyException
metadata:
  name: temporary-exception
spec:
  policyRefs:
  - name: my-policy
    kind: ValidatingPolicy
  matchConditions:
  - name: match-specific-resource
    expression: "object.metadata.name == 'test-resource'"
  # Exception expires on Jan 1, 2025
  expiresAt: "2025-01-01T00:00:00Z"

Once the expiresAt time has passed, the exception will no longer be applied to incoming requests.

This adds an optional expiresAt field to PolicyException across all API
versions (v1, v1alpha1, v1beta1) to support time-based expiration of
policy exceptions.

Changes:
- Add expiresAt field (metav1.Time) to PolicyExceptionSpec
- Add IsExpired() method to check if exception has expired
- Update CRDs and generated code

Related to: kyverno/kyverno#14491
Related PR: kyverno/kyverno#14539

Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant