mirror of https://github.com/kubernetes/kops.git
Avoid panic when cluster not found
Based on the stack trace in #3011 Fix #3011
This commit is contained in:
parent
e8d2aa3d64
commit
c537c7271c
|
@ -90,6 +90,10 @@ func RunGetInstanceGroups(options *GetInstanceGroupsOptions, args []string) erro
|
|||
return fmt.Errorf("error fetching cluster %q: %v", clusterName, err)
|
||||
}
|
||||
|
||||
if cluster == nil {
|
||||
return fmt.Errorf("cluster %q was not found", clusterName)
|
||||
}
|
||||
|
||||
list, err := clientset.InstanceGroupsFor(cluster).List(metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue