You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 2 types of policies: ClusterAdmissionPolicy and AdmissionPolicy.
All of our policies can be defined both as ClusterAdmissionPolicy and AdmissionPolicy. However, policies targeting cluster-wide resources are going to be evaluated only when deployed as ClusterAdmissionPolicy.
If I deploy a policy inspecting cluster-wide resources (like Namespace, PersistentVolume,...) as an AdmissionPolicy, the policy will never be invoked.
Expected Behavior
kwctl should have knowledge whether an official Kubernetes types is namespaced or not. When the user tries to scaffold a AdmissionPolicy and the policy is targeting a cluster-wide resource, the program should exit with an error
For policies targeting Custom Resource Definitions there's no way for kwctl to know whether this is a cluster wide resource or not. In this case, when scaffolding a AdmissionPolicy, kwctl should print a warning message. It's left to the user to figure out whether the CRD is cluster-wide or namespaced
The text was updated successfully, but these errors were encountered:
kravciak
changed the title
kwctl should prevent scaffold of AdmissionPolicies that can't target namespace
kwctl allows scaffold of AdmissionPolicies that can't target namespace
May 23, 2023
flavio
changed the title
kwctl allows scaffold of AdmissionPolicies that can't target namespace
kwctl allows scaffold of AdmissionPolicies that target cluster-wide resources
May 25, 2023
Current Behavior
There are 2 types of policies:
ClusterAdmissionPolicy
andAdmissionPolicy
.All of our policies can be defined both as
ClusterAdmissionPolicy
andAdmissionPolicy
. However, policies targeting cluster-wide resources are going to be evaluated only when deployed asClusterAdmissionPolicy
.If I deploy a policy inspecting cluster-wide resources (like
Namespace
,PersistentVolume
,...) as anAdmissionPolicy
, the policy will never be invoked.Expected Behavior
AdmissionPolicy
and the policy is targeting a cluster-wide resource, the program should exit with an errorAdmissionPolicy
, kwctl should print a warning message. It's left to the user to figure out whether the CRD is cluster-wide or namespacedThe text was updated successfully, but these errors were encountered: