Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ModRules based on the operation type #103

Closed
orbatschow opened this issue Nov 7, 2022 · 0 comments · Fixed by #104
Closed

Support ModRules based on the operation type #103

orbatschow opened this issue Nov 7, 2022 · 0 comments · Fixed by #104

Comments

@orbatschow
Copy link
Contributor

At the moment kubemod does not differentiate between the admissions request operation type.

It would be great to have a feature, that allows the user to apply ModRules only to certain admission requests, e.g. "DELETE".

With this feature implemented one could utilize ModRules like the one below:

apiVersion: api.kubemod.io/v1beta1
kind: ModRule
metadata:
  name: reject-namespace-deletion
  namespace: kubemod-system
spec:
  type: Reject
  operation:
    - DELETE

  rejectMessage: 'deletion of protected namespaces is not allowed'

  match:
    - select: '$.kind'
      matchValue: 'Namespace'

    - select: '$.metadata.labels.protected =~ "yes"'
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 a pull request may close this issue.

1 participant