We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 806cdd1 + c767f40 commit 6b82274Copy full SHA for 6b82274
src/k8s-engine/client.ts
@@ -243,7 +243,15 @@ export class KubeClient extends events.EventEmitter {
243
// the k3s server must be running. But with wsl we've observed that the service
244
// watcher needs more time to start up. When this call returns at least one
245
// service, it's ready.
246
- if ((await this.coreV1API.listServiceForAllNamespaces()).body.items.length === 0) {
+ try {
247
+ const { body } = await this.coreV1API.listServiceForAllNamespaces();
248
+
249
+ if (!(body.items.length > 0)) {
250
+ return null;
251
+ }
252
+ } catch (ex) {
253
+ console.debug(`Error fetching services: ${ ex }`);
254
255
return null;
256
}
257
this.services = new k8s.ListWatch(
0 commit comments