Commit 3a505ac3 authored by Paul Morie's avatar Paul Morie

Make namespace controller delete configMaps in namespace

parent 646cb70f
...@@ -108,6 +108,7 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV ...@@ -108,6 +108,7 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV
strings.Join([]string{"list", "pods", ""}, "-"), strings.Join([]string{"list", "pods", ""}, "-"),
strings.Join([]string{"delete-collection", "resourcequotas", ""}, "-"), strings.Join([]string{"delete-collection", "resourcequotas", ""}, "-"),
strings.Join([]string{"delete-collection", "secrets", ""}, "-"), strings.Join([]string{"delete-collection", "secrets", ""}, "-"),
strings.Join([]string{"delete-collection", "configmaps", ""}, "-"),
strings.Join([]string{"delete-collection", "limitranges", ""}, "-"), strings.Join([]string{"delete-collection", "limitranges", ""}, "-"),
strings.Join([]string{"delete-collection", "events", ""}, "-"), strings.Join([]string{"delete-collection", "events", ""}, "-"),
strings.Join([]string{"delete-collection", "serviceaccounts", ""}, "-"), strings.Join([]string{"delete-collection", "serviceaccounts", ""}, "-"),
......
...@@ -128,6 +128,10 @@ func deleteAllContent(kubeClient clientset.Interface, versions *unversioned.APIV ...@@ -128,6 +128,10 @@ func deleteAllContent(kubeClient clientset.Interface, versions *unversioned.APIV
if err != nil { if err != nil {
return estimate, err return estimate, err
} }
err = deleteConfigMaps(kubeClient, namespace)
if err != nil {
return estimate, err
}
err = deletePersistentVolumeClaims(kubeClient, namespace) err = deletePersistentVolumeClaims(kubeClient, namespace)
if err != nil { if err != nil {
return estimate, err return estimate, err
...@@ -315,6 +319,10 @@ func deleteSecrets(kubeClient clientset.Interface, ns string) error { ...@@ -315,6 +319,10 @@ func deleteSecrets(kubeClient clientset.Interface, ns string) error {
return kubeClient.Core().Secrets(ns).DeleteCollection(nil, api.ListOptions{}) return kubeClient.Core().Secrets(ns).DeleteCollection(nil, api.ListOptions{})
} }
func deleteConfigMaps(kubeClient clientset.Interface, ns string) error {
return kubeClient.Core().ConfigMaps(ns).DeleteCollection(nil, api.ListOptions{})
}
func deletePersistentVolumeClaims(kubeClient clientset.Interface, ns string) error { func deletePersistentVolumeClaims(kubeClient clientset.Interface, ns string) error {
return kubeClient.Core().PersistentVolumeClaims(ns).DeleteCollection(nil, api.ListOptions{}) return kubeClient.Core().PersistentVolumeClaims(ns).DeleteCollection(nil, api.ListOptions{})
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment