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
pull/6/head
Kubernetes Submit Queue 2017-02-19 14:42:33 -08:00 committed by GitHub
commit c2ad28be92
1 changed files with 4 additions and 2 deletions

View File

@ -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