Clean defaultAllowIPSet on namespace delete

This commit is contained in:
alok87 committed 2018-03-05 22:52:56 +05:30
1 parent 75bf62ca80
commit 91ab0e4a76
2 files changed
+15 -1

No files matched your search

+10 -1
View File
@@ -471,7 +471,16 @@ func (ns *ns) deleteNamespace(obj *coreapi.Namespace) error {
}
// Remove namespace ipset from any matching namespace selectors
return ns.nsSelectors.delFromMatching(obj.ObjectMeta.UID, obj.ObjectMeta.Labels, string(ns.allPods.ipsetName))
err := ns.nsSelectors.delFromMatching(obj.ObjectMeta.UID, obj.ObjectMeta.Labels, string(ns.allPods.ipsetName))
if err != nil {
return err
}
if !ns.legacy {
return ns.ips.Destroy(ns.defaultAllowIPSet)
}
return nil
}
func (ns *ns) isDefaultDeny(namespace *coreapi.Namespace) bool {