diff --git a/pkg/kubectl/stop.go b/pkg/kubectl/stop.go index e664167148..9112decf7e 100644 --- a/pkg/kubectl/stop.go +++ b/pkg/kubectl/stop.go @@ -42,7 +42,8 @@ const ( // A Reaper handles terminating an object as gracefully as possible. // timeout is how long we'll wait for the termination to be successful -// gracePeriod is time given to an API object for it to delete itself cleanly (e.g. pod shutdown) +// gracePeriod is time given to an API object for it to delete itself cleanly, +// e.g., pod shutdown. It may or may not be supported by the API object. type Reaper interface { Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error } @@ -272,7 +273,7 @@ func (reaper *ReplicaSetReaper) Stop(namespace, name string, timeout time.Durati } } - if err := rsc.Delete(name, gracePeriod); err != nil { + if err := rsc.Delete(name, nil); err != nil { return err } return nil @@ -355,7 +356,7 @@ func (reaper *JobReaper) Stop(namespace, name string, timeout time.Duration, gra return utilerrors.NewAggregate(errList) } // once we have all the pods removed we can safely remove the job itself - return jobs.Delete(name, gracePeriod) + return jobs.Delete(name, nil) } func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error { @@ -406,7 +407,7 @@ func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Durati // Delete deployment at the end. // Note: We delete deployment at the end so that if removing RSs fails, we atleast have the deployment to retry. - return deployments.Delete(name, gracePeriod) + return deployments.Delete(name, nil) } type updateDeploymentFunc func(d *extensions.Deployment) diff --git a/test/e2e/job.go b/test/e2e/job.go index bf20cf6a22..50e9ff19b0 100644 --- a/test/e2e/job.go +++ b/test/e2e/job.go @@ -264,7 +264,7 @@ func createJob(c *client.Client, ns string, job *extensions.Job) (*extensions.Jo } func deleteJob(c *client.Client, ns, name string) error { - return c.Extensions().Jobs(ns).Delete(name, api.NewDeleteOptions(0)) + return c.Extensions().Jobs(ns).Delete(name, nil) } // Wait for all pods to become Running. Only use when pods will run for a long time, or it will be racy. diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index 0ad66da711..b4a71ca21c 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -448,7 +448,7 @@ var _ = Describe("Kubectl client", func() { execOrDie() Expect(runOutput).To(ContainSubstring("abcd1234")) Expect(runOutput).To(ContainSubstring("stdin closed")) - Expect(c.Extensions().Jobs(ns).Delete("run-test", api.NewDeleteOptions(0))).To(BeNil()) + Expect(c.Extensions().Jobs(ns).Delete("run-test", nil)).To(BeNil()) By("executing a command with run and attach without stdin") runOutput = newKubectlCommand(fmt.Sprintf("--namespace=%v", ns), "run", "run-test-2", "--image=busybox", "--restart=Never", "--attach=true", "--leave-stdin-open=true", "--", "sh", "-c", "cat && echo 'stdin closed'"). @@ -456,7 +456,7 @@ var _ = Describe("Kubectl client", func() { execOrDie() Expect(runOutput).ToNot(ContainSubstring("abcd1234")) Expect(runOutput).To(ContainSubstring("stdin closed")) - Expect(c.Extensions().Jobs(ns).Delete("run-test-2", api.NewDeleteOptions(0))).To(BeNil()) + Expect(c.Extensions().Jobs(ns).Delete("run-test-2", nil)).To(BeNil()) By("executing a command with run and attach with stdin with open stdin should remain running") runOutput = newKubectlCommand(nsFlag, "run", "run-test-3", "--image=busybox", "--restart=Never", "--attach=true", "--leave-stdin-open=true", "--stdin", "--", "sh", "-c", "cat && echo 'stdin closed'"). @@ -486,7 +486,7 @@ var _ = Describe("Kubectl client", func() { } Expect(err).To(BeNil()) - Expect(c.Extensions().Jobs(ns).Delete("run-test-3", api.NewDeleteOptions(0))).To(BeNil()) + Expect(c.Extensions().Jobs(ns).Delete("run-test-3", nil)).To(BeNil()) }) It("should support port-forward", func() {