Update client-go methods to support context and and new create and delete options
This commit is contained in:
parent
f4b17d345f
commit
a46126a034
32 changed files with 167 additions and 132 deletions
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package settings
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
|
|
@ -64,7 +65,7 @@ var _ = framework.IngressNginxDescribe("[Status] status update", func() {
|
|||
args = append(args, "--publish-status-address=1.1.0.0")
|
||||
|
||||
deployment.Spec.Template.Spec.Containers[0].Args = args
|
||||
_, err := f.KubeClientSet.AppsV1().Deployments(f.Namespace).Update(deployment)
|
||||
_, err := f.KubeClientSet.AppsV1().Deployments(f.Namespace).Update(context.TODO(), deployment, metav1.UpdateOptions{})
|
||||
return err
|
||||
})
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "unexpected error updating ingress controller deployment flags")
|
||||
|
|
@ -84,17 +85,17 @@ var _ = framework.IngressNginxDescribe("[Status] status update", func() {
|
|||
err = cmd.Process.Kill()
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "unexpected error terminating kubectl proxy")
|
||||
|
||||
ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{})
|
||||
ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(context.TODO(), host, metav1.GetOptions{})
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "unexpected error getting %s/%v Ingress", f.Namespace, host)
|
||||
|
||||
ing.Status.LoadBalancer.Ingress = []apiv1.LoadBalancerIngress{}
|
||||
_, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).UpdateStatus(ing)
|
||||
_, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).UpdateStatus(context.TODO(), ing, metav1.UpdateOptions{})
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "unexpected error cleaning Ingress status")
|
||||
time.Sleep(10 * time.Second)
|
||||
|
||||
err = f.KubeClientSet.CoreV1().
|
||||
ConfigMaps(f.Namespace).
|
||||
Delete("ingress-controller-leader-nginx", &metav1.DeleteOptions{})
|
||||
Delete(context.TODO(), "ingress-controller-leader-nginx", metav1.DeleteOptions{})
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "unexpected error deleting leader election configmap")
|
||||
|
||||
_, cmd, err = f.KubectlProxy(port)
|
||||
|
|
@ -107,7 +108,7 @@ var _ = framework.IngressNginxDescribe("[Status] status update", func() {
|
|||
}()
|
||||
|
||||
err = wait.Poll(5*time.Second, 4*time.Minute, func() (done bool, err error) {
|
||||
ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{})
|
||||
ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(context.TODO(), host, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return false, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue