mirror of https://github.com/k3s-io/k3s
Merge pull request #65838 from WanLinghao/clusterinfo_fix
Automatic merge from submit-queue (batch tested with PRs 65838, 65837). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix kubectl cluster-info bug **What this PR does / why we need it**: When api-server is not avaiable,` kubectl cluster-info `still prints information like: the cluster is running at ... This patch fixes this bug **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes: #65817 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
b6c52143be
|
@ -92,8 +92,6 @@ func (o *ClusterInfoOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ClusterInfoOptions) Run() error {
|
func (o *ClusterInfoOptions) Run() error {
|
||||||
printService(o.Out, "Kubernetes master", o.Client.Host)
|
|
||||||
|
|
||||||
// TODO use generalized labels once they are implemented (#341)
|
// TODO use generalized labels once they are implemented (#341)
|
||||||
b := o.Builder.
|
b := o.Builder.
|
||||||
WithScheme(legacyscheme.Scheme).
|
WithScheme(legacyscheme.Scheme).
|
||||||
|
@ -105,6 +103,8 @@ func (o *ClusterInfoOptions) Run() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
printService(o.Out, "Kubernetes master", o.Client.Host)
|
||||||
|
|
||||||
services := r.Object.(*api.ServiceList).Items
|
services := r.Object.(*api.ServiceList).Items
|
||||||
for _, service := range services {
|
for _, service := range services {
|
||||||
var link string
|
var link string
|
||||||
|
|
Loading…
Reference in New Issue