delete replicaset when delete namespace
This commit is contained in:
@@ -184,6 +184,12 @@ func deleteAllContent(kubeClient clientset.Interface, versions *unversioned.APIV
|
||||
return estimate, err
|
||||
}
|
||||
}
|
||||
if containsResource(resources, "replicasets") {
|
||||
err = deleteReplicaSets(kubeClient.Extensions(), namespace)
|
||||
if err != nil {
|
||||
return estimate, err
|
||||
}
|
||||
}
|
||||
}
|
||||
return estimate, nil
|
||||
}
|
||||
@@ -343,6 +349,10 @@ func deleteDeployments(expClient extensions_unversioned.ExtensionsInterface, ns
|
||||
return expClient.Deployments(ns).DeleteCollection(nil, api.ListOptions{})
|
||||
}
|
||||
|
||||
func deleteReplicaSets(expClient extensions_unversioned.ExtensionsInterface, ns string) error {
|
||||
return expClient.ReplicaSets(ns).DeleteCollection(nil, api.ListOptions{})
|
||||
}
|
||||
|
||||
func deleteIngress(expClient extensions_unversioned.ExtensionsInterface, ns string) error {
|
||||
return expClient.Ingresses(ns).DeleteCollection(nil, api.ListOptions{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user