Commit c2ad28be authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #41500 from luxas/kubeadm_set_orphans

Automatic merge from submit-queue (batch tested with PRs 41420, 41500) Set OrphanDependents=&falseVar so the GC will (or should) remove the dummy Pod **What this PR does / why we need it**: ref: https://github.com/kubernetes/kubeadm/issues/149 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: This doesn't remove the Pod yet, only the ReplicaSet, but once the GC is working as expected, it'll remove the Pod with this configuration **Release note**: ```release-note NONE ``` @errordeveloper @mikedanese @pires @caesarxuchao @krmayankk @kargakis
parents bd1a2221 8cc265d9
......@@ -139,8 +139,10 @@ func createAndWaitForADummyDeployment(client *clientset.Clientset) error {
fmt.Println("[apiclient] Test deployment succeeded")
// TODO: In the future, make sure the ReplicaSet and Pod are garbage collected
if err := client.ExtensionsV1beta1().Deployments(metav1.NamespaceSystem).Delete("dummy", &metav1.DeleteOptions{}); err != nil {
falseVar := false
if err := client.ExtensionsV1beta1().Deployments(metav1.NamespaceSystem).Delete("dummy", &metav1.DeleteOptions{
OrphanDependents: &falseVar,
}); err != nil {
fmt.Printf("[apiclient] Failed to delete test deployment [%v] (will ignore)\n", err)
}
return nil
......
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