mirror of https://github.com/k3s-io/k3s
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 @kargakispull/6/head
commit
c2ad28be92
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue