When api-server is not avaiable, kubectl cluster-info still prints information like: the cluster is running at ...

This patch fixes this bug
pull/8/head
WanLinghao 2018-07-05 10:45:32 +08:00
parent a3d30dc939
commit 9407e2bb43
1 changed files with 2 additions and 2 deletions

View File

@ -92,8 +92,6 @@ func (o *ClusterInfoOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) err
}
func (o *ClusterInfoOptions) Run() error {
printService(o.Out, "Kubernetes master", o.Client.Host)
// TODO use generalized labels once they are implemented (#341)
b := o.Builder.
WithScheme(legacyscheme.Scheme).
@ -105,6 +103,8 @@ func (o *ClusterInfoOptions) Run() error {
if err != nil {
return err
}
printService(o.Out, "Kubernetes master", o.Client.Host)
services := r.Object.(*api.ServiceList).Items
for _, service := range services {
var link string