Skip to content

Commit 3204ae2

Browse files
author
OpenShift Bot
authored
Merge pull request openshift#673 from enj/automated-cherry-pick-of-#13563-upstream-ose-enterprise-3.5
Merged by openshift-bot
2 parents 2ad3fef + 76e7b63 commit 3204ae2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

pkg/project/controller/controller.go

+18
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ func deleteAllContent(client osclient.Interface, namespace string) (err error) {
9797
if err != nil {
9898
return err
9999
}
100+
err = deleteRoleBindingRestrictions(client, namespace)
101+
if err != nil {
102+
return err
103+
}
104+
return nil
105+
}
106+
107+
func deleteRoleBindingRestrictions(client osclient.Interface, ns string) error {
108+
items, err := client.RoleBindingRestrictions(ns).List(kapi.ListOptions{})
109+
if err != nil {
110+
return err
111+
}
112+
for i := range items.Items {
113+
err := client.RoleBindingRestrictions(ns).Delete(items.Items[i].Name)
114+
if err != nil && !errors.IsNotFound(err) {
115+
return err
116+
}
117+
}
100118
return nil
101119
}
102120

pkg/project/controller/controller_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func TestSyncNamespaceThatIsTerminating(t *testing.T) {
5252
core.NewListAction(unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "namespace"}, "", kapi.ListOptions{}),
5353
core.NewListAction(unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "deploymentconfig"}, "", kapi.ListOptions{}),
5454
core.NewListAction(unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "egressnetworkpolicy"}, "", kapi.ListOptions{}),
55+
core.NewListAction(unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "rolebindingrestrictions"}, "", kapi.ListOptions{}),
5556
}
5657
kubeActionSet := []core.Action{}
5758
originActionSet := []core.Action{}

0 commit comments

Comments
 (0)