Skip to content

Commit

Permalink
Merge pull request kubernetes#20645 from pmorie/namespace-controller-…
Browse files Browse the repository at this point in the history
…config

Auto commit by PR queue bot
  • Loading branch information
k8s-merge-robot committed Feb 10, 2016
2 parents 86a7a95 + 3a505ac commit afc5564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controller/namespace/namespace_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV
strings.Join([]string{"list", "pods", ""}, "-"),
strings.Join([]string{"delete-collection", "resourcequotas", ""}, "-"),
strings.Join([]string{"delete-collection", "secrets", ""}, "-"),
strings.Join([]string{"delete-collection", "configmaps", ""}, "-"),
strings.Join([]string{"delete-collection", "limitranges", ""}, "-"),
strings.Join([]string{"delete-collection", "events", ""}, "-"),
strings.Join([]string{"delete-collection", "serviceaccounts", ""}, "-"),
Expand Down
8 changes: 8 additions & 0 deletions pkg/controller/namespace/namespace_controller_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func deleteAllContent(kubeClient clientset.Interface, versions *unversioned.APIV
if err != nil {
return estimate, err
}
err = deleteConfigMaps(kubeClient, namespace)
if err != nil {
return estimate, err
}
err = deletePersistentVolumeClaims(kubeClient, namespace)
if err != nil {
return estimate, err
Expand Down Expand Up @@ -315,6 +319,10 @@ func deleteSecrets(kubeClient clientset.Interface, ns string) error {
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 {
return kubeClient.Core().PersistentVolumeClaims(ns).DeleteCollection(nil, api.ListOptions{})
}
Expand Down

0 comments on commit afc5564

Please sign in to comment.