mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Merge pull request #88929 from liggitt/expansions
client-go: plumb context to expansions methods
This commit is contained in:
@@ -246,7 +246,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
||||
}
|
||||
|
||||
if c.shouldDeny {
|
||||
err = cs.CoreV1().Pods(ns).Evict(e)
|
||||
err = cs.CoreV1().Pods(ns).Evict(context.TODO(), e)
|
||||
gomega.Expect(err).Should(gomega.MatchError("Cannot evict pod as it would violate the pod's disruption budget."))
|
||||
} else {
|
||||
// Only wait for running pods in the "allow" case
|
||||
@@ -257,7 +257,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
||||
// Since disruptionAllowed starts out false, if an eviction is ever allowed,
|
||||
// that means the controller is working.
|
||||
err = wait.PollImmediate(framework.Poll, timeout, func() (bool, error) {
|
||||
err = cs.CoreV1().Pods(ns).Evict(e)
|
||||
err = cs.CoreV1().Pods(ns).Evict(context.TODO(), e)
|
||||
if err != nil {
|
||||
return false, nil
|
||||
}
|
||||
@@ -284,7 +284,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
||||
Namespace: ns,
|
||||
},
|
||||
}
|
||||
err = cs.CoreV1().Pods(ns).Evict(e)
|
||||
err = cs.CoreV1().Pods(ns).Evict(context.TODO(), e)
|
||||
gomega.Expect(err).Should(gomega.MatchError("Cannot evict pod as it would violate the pod's disruption budget."))
|
||||
|
||||
ginkgo.By("Updating the pdb to allow a pod to be evicted")
|
||||
@@ -297,7 +297,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
||||
ginkgo.By("Trying to evict the same pod we tried earlier which should now be evictable")
|
||||
waitForPodsOrDie(cs, ns, 3)
|
||||
waitForPdbToObserveHealthyPods(cs, ns, 3)
|
||||
err = cs.CoreV1().Pods(ns).Evict(e)
|
||||
err = cs.CoreV1().Pods(ns).Evict(context.TODO(), e)
|
||||
framework.ExpectNoError(err) // the eviction is now allowed
|
||||
|
||||
ginkgo.By("Patching the pdb to disallow a pod to be evicted")
|
||||
@@ -319,7 +319,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
||||
Namespace: ns,
|
||||
},
|
||||
}
|
||||
err = cs.CoreV1().Pods(ns).Evict(e)
|
||||
err = cs.CoreV1().Pods(ns).Evict(context.TODO(), e)
|
||||
gomega.Expect(err).Should(gomega.MatchError("Cannot evict pod as it would violate the pod's disruption budget."))
|
||||
|
||||
ginkgo.By("Deleting the pdb to allow a pod to be evicted")
|
||||
@@ -327,7 +327,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
||||
|
||||
ginkgo.By("Trying to evict the same pod we tried earlier which should now be evictable")
|
||||
waitForPodsOrDie(cs, ns, 3)
|
||||
err = cs.CoreV1().Pods(ns).Evict(e)
|
||||
err = cs.CoreV1().Pods(ns).Evict(context.TODO(), e)
|
||||
framework.ExpectNoError(err) // the eviction is now allowed
|
||||
})
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ var _ = SIGDescribe("Certificates API", func() {
|
||||
Message: "Set from an e2e test",
|
||||
},
|
||||
}
|
||||
csr, err = csrs.UpdateApproval(csr)
|
||||
csr, err = csrs.UpdateApproval(context.TODO(), csr, metav1.UpdateOptions{})
|
||||
if err != nil {
|
||||
csr, _ = csrs.Get(context.TODO(), csrName, metav1.GetOptions{})
|
||||
framework.Logf("err updating approval: %v", err)
|
||||
|
||||
@@ -430,7 +430,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() {
|
||||
}
|
||||
ginkgo.By("evicting host0Pod")
|
||||
err = wait.PollImmediate(framework.Poll, podEvictTimeout, func() (bool, error) {
|
||||
if err := cs.CoreV1().Pods(ns).Evict(evictTarget); err != nil {
|
||||
if err := cs.CoreV1().Pods(ns).Evict(context.TODO(), evictTarget); err != nil {
|
||||
framework.Logf("Failed to evict host0Pod, ignoring error: %v", err)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user