upgrade k8s libs to 1.18.4

This commit is contained in:
Adrien Trouillaud
2020-06-29 13:03:50 -07:00
parent f934ded4a2
commit 845b4cd409
15 changed files with 240 additions and 233 deletions

View File

@@ -159,7 +159,7 @@ func (pc *PodController) handleProviderError(ctx context.Context, span trace.Spa
"reason": pod.Status.Reason,
})
_, err := pc.client.Pods(pod.Namespace).UpdateStatus(pod)
_, err := pc.client.Pods(pod.Namespace).UpdateStatus(ctx, pod, metav1.UpdateOptions{})
if err != nil {
logger.WithError(err).Warn("Failed to update pod status")
} else {
@@ -216,7 +216,7 @@ func (pc *PodController) updatePodStatus(ctx context.Context, podFromKubernetes
// the pod status, and we should be the sole writers of the pod status, we can blind overwrite it. Therefore
// we need to copy the pod and set ResourceVersion to 0.
podFromProvider.ResourceVersion = "0"
if _, err := pc.client.Pods(podFromKubernetes.Namespace).UpdateStatus(podFromProvider); err != nil {
if _, err := pc.client.Pods(podFromKubernetes.Namespace).UpdateStatus(ctx, podFromProvider, metav1.UpdateOptions{}); err != nil {
span.SetStatus(err)
return pkgerrors.Wrap(err, "error while updating pod status in kubernetes")
}
@@ -322,7 +322,7 @@ func (pc *PodController) deletePodHandler(ctx context.Context, key string) (retE
// We don't check with the provider before doing this delete. At this point, even if an outstanding pod status update
// was in progress,
err = pc.client.Pods(namespace).Delete(name, metav1.NewDeleteOptions(0))
err = pc.client.Pods(namespace).Delete(ctx, name, *metav1.NewDeleteOptions(0))
if errors.IsNotFound(err) {
return nil
}