X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fxds%2Fxds-cli.git;a=blobdiff_plain;f=main.go;h=668738c34cb58f79873b0207b0e746369a0c5d7f;hp=72a9d22c05d57b32b76f5ea64fa01bbc603a4853;hb=2f718c72a51850f3ab1af8d93a381b594fb2c825;hpb=3e178f01710e2e50860c3d5e6e8e346f2d378a5c diff --git a/main.go b/main.go index 72a9d22..668738c 100644 --- a/main.go +++ b/main.go @@ -389,6 +389,9 @@ func XdsConnInit(ctx *cli.Context) error { if err := XdsConfigGet(&xdsConf); err != nil { return cli.NewExitError("ERROR while getting XDS config: "+err.Error(), 1) } + if len(xdsConf.Servers) < 1 { + return cli.NewExitError("No XDS Server connected", 1) + } svrCfg := xdsConf.Servers[XdsServerIndexGet()] if (serverURL != "" && svrCfg.URL != serverURL) || !svrCfg.Connected { Log.Infof("Update XDS Server config: serverURL=%v, svrCfg=%v", serverURL, svrCfg)