From 8a0da1e4d49cebd6611147cd966bbd95fae657a7 Mon Sep 17 00:00:00 2001 From: Neo Liang Date: Thu, 3 Dec 2020 22:20:32 +0800 Subject: [PATCH] use get to get shoot --- pkg/cmd/utils.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/cmd/utils.go b/pkg/cmd/utils.go index 083a30875..222cc2ee1 100644 --- a/pkg/cmd/utils.go +++ b/pkg/cmd/utils.go @@ -393,14 +393,7 @@ func waitShootReconciled(shoot *gardencorev1beta1.Shoot, targetReader TargetRead target := targetReader.ReadTarget(pathTarget) gardenClientset, err := target.GardenerClient() checkError(err) - shootList, err := gardenClientset.CoreV1beta1().Shoots(shoot.GetNamespace()).List(metav1.ListOptions{}) - checkError(err) - for index, s := range shootList.Items { - if s.Name == shoot.Name && *s.Spec.SeedName == *shoot.Spec.SeedName { - newShoot = &shootList.Items[index] - break - } - } + newShoot, err = gardenClientset.CoreV1beta1().Shoots(shoot.GetNamespace()).Get(shoot.Name, metav1.GetOptions{}) checkError(err) if newShoot.Status.LastOperation.State == "Succeeded" && newShoot.Status.LastOperation.Type == "Reconcile" &&