From 79ed5ce04719074fa9c72fa41b689ef776f59bb9 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Mon, 22 Jan 2024 13:42:30 -0800 Subject: [PATCH] Remove dependency on unsupported `k8s.io/kubernetes` library (#457) --- go.mod | 1 - go.sum | 2 -- pkg/sandbox/start.go | 12 ++++++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 4beaf4d5a6..700445c958 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,6 @@ require ( k8s.io/api v0.24.1 k8s.io/apimachinery v0.24.1 k8s.io/client-go v0.24.1 - k8s.io/kubernetes v1.13.0 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 00892a2001..88b64583da 100644 --- a/go.sum +++ b/go.sum @@ -1429,8 +1429,6 @@ k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAG k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= -k8s.io/kubernetes v1.13.0 h1:qTfB+u5M92k2fCCCVP2iuhgwwSOv1EkAkvQY1tQODD8= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/pkg/sandbox/start.go b/pkg/sandbox/start.go index ee7b8bc275..7ba775f702 100644 --- a/pkg/sandbox/start.go +++ b/pkg/sandbox/start.go @@ -28,7 +28,6 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/clientcmd" - "k8s.io/kubernetes/pkg/api/v1/pod" ) const ( @@ -103,12 +102,13 @@ func WatchFlyteDeployment(ctx context.Context, appsClient corev1.CoreV1Interface ready = 0 if total != 0 { for _, v := range pods.Items { - // TODO (jeev): We should really be using - // `IsContainersReadyConditionTrue`, but that is not available until - // version v1.22.11. We are on v1.13.0 for some reason. - if pod.IsPodReadyConditionTrue(v.Status) { - ready++ + for _, condition := range v.Status.Conditions { + if string(condition.Type) == string(corev1api.PodReady) && condition.Status == corev1api.ConditionTrue { + ready++ + break + } } + if len(v.Status.Conditions) > 0 { table.Append([]string{v.GetName(), string(v.Status.Phase), v.GetNamespace()}) }