mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
cleanup
This commit is contained in:
parent
0831839910
commit
c3b1d1721b
1 changed files with 0 additions and 33 deletions
|
@ -22,40 +22,7 @@ func cleanAnnotations(client *client.Client, obj interface{}) {
|
|||
return
|
||||
}
|
||||
// Get the resources that apply to the policy
|
||||
// key uid
|
||||
resourceMap := engine.ListResourcesThatApplyToPolicy(client, &policy)
|
||||
// for _, rule := range policy.Spec.Rules {
|
||||
// for _, k := range rule.Kinds {
|
||||
// if k == "Namespace" {
|
||||
// continue
|
||||
// }
|
||||
// // kind -> resource
|
||||
// gvr := client.DiscoveryClient.GetGVRFromKind(k)
|
||||
// // label selectors
|
||||
// // namespace ? should it be default or allow policy to specify it
|
||||
// namespace := "default"
|
||||
// if rule.ResourceDescription.Namespace != nil {
|
||||
// namespace = *rule.ResourceDescription.Namespace
|
||||
// }
|
||||
// list, err := client.ListResource(k, namespace, rule.ResourceDescription.Selector)
|
||||
// if err != nil {
|
||||
// glog.Errorf("unable to list resource for %s with label selector %s", gvr.Resource, rule.Selector.String())
|
||||
// glog.Errorf("unable to apply policy %s rule %s. err: %s", policy.Name, rule.Name, err)
|
||||
// continue
|
||||
// }
|
||||
// for _, res := range list.Items {
|
||||
// name := rule.ResourceDescription.Name
|
||||
// if name != nil {
|
||||
// // wild card matching
|
||||
// if !wildcard.Match(*name, res.GetName()) {
|
||||
// continue
|
||||
// }
|
||||
// }
|
||||
// resourceMap[string(res.GetUID())] = res
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// remove annotations for the resources
|
||||
for _, obj := range resourceMap {
|
||||
// get annotations
|
||||
|
|
Loading…
Add table
Reference in a new issue