Skip to content

Commit

Permalink
feat: use common params for kv.Update
Browse files Browse the repository at this point in the history
kv.Update and kv.UpdateStatus methods do not allow to pass the context and UpdateOptions.
In order to align the custom methods signature with the generated ones introduce
the context and the UpdateOptions.
This effort, once all the common methods' signatures are aligned with
the generated ones, will converge in the deletion of the
custom methods' implementations, embedding the generated interface.

Signed-off-by: fossedihelm <[email protected]>
  • Loading branch information
fossedihelm committed Apr 15, 2024
1 parent e844a59 commit d475ba2
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 65 deletions.
4 changes: 2 additions & 2 deletions pkg/util/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (u *updater) updateUnstructured(obj runtime.Object) (oldStatus interface{},
return oldObj.Status, newObj.Status, nil
case *v1.KubeVirt:
oldObj := obj.(*v1.KubeVirt)
newObj, err := u.cli.KubeVirt(a.GetNamespace()).Update(oldObj)
newObj, err := u.cli.KubeVirt(a.GetNamespace()).Update(context.Background(), oldObj, metav1.UpdateOptions{})
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -225,7 +225,7 @@ func (u *updater) updateStatusUnstructured(obj runtime.Object) (err error) {
_, err = u.cli.VirtualMachineInstanceMigration(a.GetNamespace()).UpdateStatus(context.Background(), oldObj, metav1.UpdateOptions{})
case *v1.KubeVirt:
oldObj := obj.(*v1.KubeVirt)
_, err = u.cli.KubeVirt(a.GetNamespace()).UpdateStatus(oldObj)
_, err = u.cli.KubeVirt(a.GetNamespace()).UpdateStatus(context.Background(), oldObj, metav1.UpdateOptions{})
case *clonev1alpha1.VirtualMachineClone:
oldObj := obj.(*clonev1alpha1.VirtualMachineClone)
_, err = u.cli.VirtualMachineClone(oldObj.Namespace).UpdateStatus(context.Background(), oldObj, metav1.UpdateOptions{})
Expand Down
38 changes: 19 additions & 19 deletions pkg/util/status/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ var _ = Describe("Status", func() {
It("should continuously use the /status subresource if no errors occur", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(2)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(2)
Expect(updater.UpdateStatus(kv)).To(Succeed())
Expect(updater.UpdateStatus(kv)).To(Succeed())
})

It("should fall back on a 404 error on the /status subresource to an ordinary update", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().Update(kv).Return(kv, nil).Times(2)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(2)
Expect(updater.UpdateStatus(kv)).To(Succeed())
Expect(updater.UpdateStatus(kv)).To(Succeed())
})

It("should fall back on a 404 error on the /status subresource to an ordinary update but keep in mind that objects may have disappeared", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().Update(kv).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(1)
Expect(updater.UpdateStatus(kv)).To(Succeed())
})

Expand All @@ -71,18 +71,18 @@ var _ = Describe("Status", func() {
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
newKV := kv.DeepCopy()
newKV.Status.Phase = v1.KubeVirtPhaseDeleted
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().Update(kv).Return(newKV, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(1)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(newKV, nil).Times(1)
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(1)
Expect(updater.UpdateStatus(kv)).To(Succeed())
})

It("should stick with /status if an arbitrary error occurs", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, fmt.Errorf("I am not 404")).Times(1)
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, fmt.Errorf("I am not 404")).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(1)
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
Expect(updater.UpdateStatus(kv)).To(Succeed())
})
Expand Down Expand Up @@ -152,7 +152,7 @@ var _ = Describe("Status", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
updater.updater.subresource = false
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().Update(kv).Return(kv, nil).Times(2)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(2)
Expect(updater.UpdateStatus(kv)).To(Succeed())
Expect(updater.UpdateStatus(kv)).To(Succeed())
})
Expand All @@ -161,7 +161,7 @@ var _ = Describe("Status", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
updater.updater.subresource = false
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().Update(kv).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(2)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, errors.NewNotFound(schema.GroupResource{}, "something")).Times(2)
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
})
Expand All @@ -170,7 +170,7 @@ var _ = Describe("Status", func() {
updater := NewKubeVirtStatusUpdater(virtClient)
updater.updater.subresource = false
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().Update(kv).Return(kv, fmt.Errorf("I am not 404")).Times(2)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, fmt.Errorf("I am not 404")).Times(2)
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
Expect(updater.UpdateStatus(kv)).ToNot(Succeed())
})
Expand All @@ -181,10 +181,10 @@ var _ = Describe("Status", func() {
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
oldKV := kv.DeepCopy()
oldKV.Status.Phase = v1.KubeVirtPhaseDeploying
kvInterface.EXPECT().Update(kv).Return(oldKV, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(1)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(oldKV, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(1)
Expect(updater.UpdateStatus(kv)).To(Succeed())
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(1)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(1)
Expect(updater.UpdateStatus(kv)).To(Succeed())
})
})
Expand Down Expand Up @@ -246,7 +246,7 @@ var _ = Describe("Status", func() {
By("checking the KubeVirt resource")
kvUpdater := NewKubeVirtStatusUpdater(virtClient)
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().UpdateStatus(kv).Return(kv, nil).Times(2)
kvInterface.EXPECT().UpdateStatus(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(2)
Expect(kvUpdater.UpdateStatus(kv)).To(Succeed())
Expect(kvUpdater.UpdateStatus(kv)).To(Succeed())

Expand Down Expand Up @@ -275,7 +275,7 @@ var _ = Describe("Status", func() {
kvUpdater := NewKubeVirtStatusUpdater(virtClient)
kvUpdater.updater.subresource = false
kv := &v1.KubeVirt{Status: v1.KubeVirtStatus{Phase: v1.KubeVirtPhaseDeployed}}
kvInterface.EXPECT().Update(kv).Return(kv, nil).Times(2)
kvInterface.EXPECT().Update(context.Background(), kv, metav1.UpdateOptions{}).Return(kv, nil).Times(2)
Expect(kvUpdater.UpdateStatus(kv)).To(Succeed())
Expect(kvUpdater.UpdateStatus(kv)).To(Succeed())

Expand Down
2 changes: 1 addition & 1 deletion pkg/virt-operator/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ func (c *KubeVirtController) execute(key string) error {
if !controller.ObservedLatestApiVersionAnnotation(kv) {
kv := kv.DeepCopy()
controller.SetLatestApiVersionAnnotation(kv)
_, err = c.clientset.KubeVirt(kv.ObjectMeta.Namespace).Update(kv)
_, err = c.clientset.KubeVirt(kv.ObjectMeta.Namespace).Update(context.Background(), kv, metav1.UpdateOptions{})
if err != nil {
logger.Reason(err).Errorf("Could not update the KubeVirt resource.")
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/virt-operator/kubevirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,24 +410,24 @@ func (k *KubeVirtTestData) shouldExpectKubeVirtFinalizersPatch(times int) {
}

func (k *KubeVirtTestData) shouldExpectKubeVirtUpdate(times int) {
update := k.kvInterface.EXPECT().Update(gomock.Any())
update := k.kvInterface.EXPECT().Update(context.Background(), gomock.Any(), metav1.UpdateOptions{})
update.Do(func(kv *v1.KubeVirt) {
k.kvInformer.GetStore().Update(kv)
update.Return(kv, nil)
}).Times(times)
}

func (k *KubeVirtTestData) shouldExpectKubeVirtUpdateStatus(times int) {
update := k.kvInterface.EXPECT().UpdateStatus(gomock.Any())
update.Do(func(kv *v1.KubeVirt) {
update := k.kvInterface.EXPECT().UpdateStatus(context.Background(), gomock.Any(), metav1.UpdateOptions{})
update.Do(func(ctx context.Context, kv *v1.KubeVirt, options metav1.UpdateOptions) {
k.kvInformer.GetStore().Update(kv)
update.Return(kv, nil)
}).Times(times)
}

func (k *KubeVirtTestData) shouldExpectKubeVirtUpdateStatusVersion(times int, config *util.KubeVirtDeploymentConfig) {
update := k.kvInterface.EXPECT().UpdateStatus(gomock.Any())
update.Do(func(kv *v1.KubeVirt) {
update := k.kvInterface.EXPECT().UpdateStatus(context.Background(), gomock.Any(), metav1.UpdateOptions{})
update.Do(func(ctx context.Context, kv *v1.KubeVirt, options metav1.UpdateOptions) {

Expect(kv.Status.TargetKubeVirtVersion).To(Equal(config.GetKubeVirtVersion()))
Expect(kv.Status.ObservedKubeVirtVersion).To(Equal(config.GetKubeVirtVersion()))
Expand All @@ -437,8 +437,8 @@ func (k *KubeVirtTestData) shouldExpectKubeVirtUpdateStatusVersion(times int, co
}

func (k *KubeVirtTestData) shouldExpectKubeVirtUpdateStatusFailureCondition(reason string) {
update := k.kvInterface.EXPECT().UpdateStatus(gomock.Any())
update.Do(func(kv *v1.KubeVirt) {
update := k.kvInterface.EXPECT().UpdateStatus(context.Background(), gomock.Any(), metav1.UpdateOptions{})
update.Do(func(ctx context.Context, kv *v1.KubeVirt, options metav1.UpdateOptions) {
Expect(kv.Status.Conditions).To(HaveLen(1))
Expect(kv.Status.Conditions[0].Reason).To(Equal(reason))
k.kvInformer.GetStore().Update(kv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2000,26 +2000,26 @@ func (_mr *_MockKubeVirtInterfaceRecorder) List(arg0, arg1 interface{}) *gomock.
return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0, arg1)
}

func (_m *MockKubeVirtInterface) Create(instance *v120.KubeVirt) (*v120.KubeVirt, error) {
ret := _m.ctrl.Call(_m, "Create", instance)
func (_m *MockKubeVirtInterface) Create(ctx context.Context, instance *v120.KubeVirt, opts v12.CreateOptions) (*v120.KubeVirt, error) {
ret := _m.ctrl.Call(_m, "Create", ctx, instance, opts)
ret0, _ := ret[0].(*v120.KubeVirt)
ret1, _ := ret[1].(error)
return ret0, ret1
}

func (_mr *_MockKubeVirtInterfaceRecorder) Create(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0)
func (_mr *_MockKubeVirtInterfaceRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0, arg1, arg2)
}

func (_m *MockKubeVirtInterface) Update(_param0 *v120.KubeVirt) (*v120.KubeVirt, error) {
ret := _m.ctrl.Call(_m, "Update", _param0)
func (_m *MockKubeVirtInterface) Update(ctx context.Context, kubeVirt *v120.KubeVirt, opts v12.UpdateOptions) (*v120.KubeVirt, error) {
ret := _m.ctrl.Call(_m, "Update", ctx, kubeVirt, opts)
ret0, _ := ret[0].(*v120.KubeVirt)
ret1, _ := ret[1].(error)
return ret0, ret1
}

func (_mr *_MockKubeVirtInterfaceRecorder) Update(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0)
func (_mr *_MockKubeVirtInterfaceRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0, arg1, arg2)
}

func (_m *MockKubeVirtInterface) Delete(name string, options *v12.DeleteOptions) error {
Expand Down Expand Up @@ -2048,15 +2048,15 @@ func (_mr *_MockKubeVirtInterfaceRecorder) Patch(arg0, arg1, arg2, arg3 interfac
return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...)
}

func (_m *MockKubeVirtInterface) UpdateStatus(_param0 *v120.KubeVirt) (*v120.KubeVirt, error) {
ret := _m.ctrl.Call(_m, "UpdateStatus", _param0)
func (_m *MockKubeVirtInterface) UpdateStatus(ctx context.Context, kubeVirt *v120.KubeVirt, opts v12.UpdateOptions) (*v120.KubeVirt, error) {
ret := _m.ctrl.Call(_m, "UpdateStatus", ctx, kubeVirt, opts)
ret0, _ := ret[0].(*v120.KubeVirt)
ret1, _ := ret[1].(error)
return ret0, ret1
}

func (_mr *_MockKubeVirtInterfaceRecorder) UpdateStatus(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "UpdateStatus", arg0)
func (_mr *_MockKubeVirtInterfaceRecorder) UpdateStatus(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "UpdateStatus", arg0, arg1, arg2)
}

func (_m *MockKubeVirtInterface) PatchStatus(name string, pt types.PatchType, data []byte, patchOptions *v12.PatchOptions) (*v120.KubeVirt, error) {
Expand Down
4 changes: 2 additions & 2 deletions staging/src/kubevirt.io/client-go/kubecli/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ type KubeVirtInterface interface {
Get(ctx context.Context, name string, options metav1.GetOptions) (*v1.KubeVirt, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.KubeVirtList, error)
Create(ctx context.Context, instance *v1.KubeVirt, opts metav1.CreateOptions) (*v1.KubeVirt, error)
Update(*v1.KubeVirt) (*v1.KubeVirt, error)
Update(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.UpdateOptions) (*v1.KubeVirt, error)
Delete(name string, options *metav1.DeleteOptions) error
Patch(name string, pt types.PatchType, data []byte, patchOptions *metav1.PatchOptions, subresources ...string) (result *v1.KubeVirt, err error)
UpdateStatus(*v1.KubeVirt) (*v1.KubeVirt, error)
UpdateStatus(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.UpdateOptions) (*v1.KubeVirt, error)
PatchStatus(name string, pt types.PatchType, data []byte, patchOptions *metav1.PatchOptions) (result *v1.KubeVirt, err error)
}

Expand Down
9 changes: 4 additions & 5 deletions staging/src/kubevirt.io/client-go/kubecli/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ func (o *kv) Get(ctx context.Context, name string, options k8smetav1.GetOptions)
}

// Update the KubeVirt instance in the cluster in given namespace
func (o *kv) Update(kv *v1.KubeVirt) (*v1.KubeVirt, error) {
updatedKv, err := o.KubeVirtInterface.Update(context.Background(), kv, k8smetav1.UpdateOptions{})
func (o *kv) Update(ctx context.Context, kv *v1.KubeVirt, opts k8smetav1.UpdateOptions) (*v1.KubeVirt, error) {
updatedKv, err := o.KubeVirtInterface.Update(ctx, kv, opts)
updatedKv.SetGroupVersionKind(v1.KubeVirtGroupVersionKind)

return updatedKv, err
}

Expand Down Expand Up @@ -98,8 +97,8 @@ func (o *kv) PatchStatus(name string, pt types.PatchType, data []byte, patchOpti
return o.Patch(name, pt, data, patchOptions, "status")
}

func (o *kv) UpdateStatus(kv *v1.KubeVirt) (result *v1.KubeVirt, err error) {
result, err = o.KubeVirtInterface.UpdateStatus(context.Background(), kv, k8smetav1.UpdateOptions{})
func (o *kv) UpdateStatus(ctx context.Context, kv *v1.KubeVirt, opts k8smetav1.UpdateOptions) (result *v1.KubeVirt, err error) {
result, err = o.KubeVirtInterface.UpdateStatus(ctx, kv, opts)
result.SetGroupVersionKind(v1.KubeVirtGroupVersionKind)
return
}
2 changes: 1 addition & 1 deletion staging/src/kubevirt.io/client-go/kubecli/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var _ = Describe("Kubevirt Client", func() {
ghttp.VerifyRequest("PUT", path.Join(proxyPath, kubevirtPath)),
ghttp.RespondWithJSONEncoded(http.StatusOK, kubevirt),
))
updatedKubeVirt, err := client.KubeVirt(k8sv1.NamespaceDefault).Update(kubevirt)
updatedKubeVirt, err := client.KubeVirt(k8sv1.NamespaceDefault).Update(context.Background(), kubevirt, k8smetav1.UpdateOptions{})

Expect(server.ReceivedRequests()).To(HaveLen(1))
Expect(err).ToNot(HaveOccurred())
Expand Down
4 changes: 2 additions & 2 deletions tests/canary_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var _ = Describe("[Serial][sig-operator]virt-handler canary upgrade", Serial, de
close(stopCh)

retry.RetryOnConflict(retry.DefaultRetry, func() error {
_, err := virtCli.KubeVirt(flags.KubeVirtInstallNamespace).Update(originalKV)
_, err := virtCli.KubeVirt(flags.KubeVirtInstallNamespace).Update(context.Background(), originalKV, metav1.UpdateOptions{})
return err
})

Expand Down Expand Up @@ -114,7 +114,7 @@ var _ = Describe("[Serial][sig-operator]virt-handler canary upgrade", Serial, de
},
}
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
_, err := virtCli.KubeVirt(flags.KubeVirtInstallNamespace).Update(kv)
_, err := virtCli.KubeVirt(flags.KubeVirtInstallNamespace).Update(context.Background(), kv, metav1.UpdateOptions{})
return err
})
}
Expand Down
4 changes: 2 additions & 2 deletions tests/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ var _ = Describe("[Serial][sig-monitoring]Monitoring", Serial, decorators.SigMon
}

Eventually(func() error {
kv, err = virtClient.KubeVirt(originalKv.Namespace).Update(kv)
kv, err = virtClient.KubeVirt(originalKv.Namespace).Update(context.Background(), kv, metav1.UpdateOptions{})
return err
}, 30*time.Second, 1*time.Second).ShouldNot(HaveOccurred())

Expand All @@ -164,7 +164,7 @@ var _ = Describe("[Serial][sig-monitoring]Monitoring", Serial, decorators.SigMon
kv.Spec.CustomizeComponents = v1.CustomizeComponents{}

Eventually(func() error {
kv, err = virtClient.KubeVirt(originalKv.Namespace).Update(kv)
kv, err = virtClient.KubeVirt(originalKv.Namespace).Update(context.Background(), kv, metav1.UpdateOptions{})
return err
}, 30*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
}
Expand Down
Loading

0 comments on commit d475ba2

Please sign in to comment.