From eb546b87a00c9e4bdc1abe0073b900d70a43c773 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Thu, 9 Nov 2017 19:49:41 +0200 Subject: [PATCH] Replace deprecate kubernetes client functions --- cluster-autoscaler/utils/drain/drain.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cluster-autoscaler/utils/drain/drain.go b/cluster-autoscaler/utils/drain/drain.go index 3aa37905bc..02c9aa73f2 100644 --- a/cluster-autoscaler/utils/drain/drain.go +++ b/cluster-autoscaler/utils/drain/drain.go @@ -109,7 +109,7 @@ func GetPodsForDeletionOnNodeDrain( } } else if refKind == "DaemonSet" { if checkReferences { - ds, err := client.Extensions().DaemonSets(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) + ds, err := client.ExtensionsV1beta1().DaemonSets(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) // Assume the only reason for an error is because the DaemonSet is // gone/missing, not for any other cause. TODO(mml): something more @@ -128,7 +128,7 @@ func GetPodsForDeletionOnNodeDrain( } } else if refKind == "Job" { if checkReferences { - job, err := client.Batch().Jobs(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) + job, err := client.BatchV1().Jobs(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) // Assume the only reason for an error is because the Job is // gone/missing, not for any other cause. TODO(mml): something more @@ -143,7 +143,7 @@ func GetPodsForDeletionOnNodeDrain( } } else if refKind == "ReplicaSet" { if checkReferences { - rs, err := client.Extensions().ReplicaSets(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) + rs, err := client.ExtensionsV1beta1().ReplicaSets(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) // Assume the only reason for an error is because the RS is // gone/missing, not for any other cause. TODO(mml): something more @@ -162,7 +162,7 @@ func GetPodsForDeletionOnNodeDrain( } } else if refKind == "StatefulSet" { if checkReferences { - ss, err := client.Apps().StatefulSets(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) + ss, err := client.AppsV1beta1().StatefulSets(controllerNamespace).Get(controllerRef.Name, metav1.GetOptions{}) // Assume the only reason for an error is because the StatefulSet is // gone/missing, not for any other cause. TODO(mml): something more