Closed TairuiWang closed 4 years ago
I can use some other APIs like apis and v1. However, I got storage not defined error during using the storage API. Here is part of my code
apis
v1
storage
import { Client1_10, config } from 'kubernetes-client'; ... client = new Client1_10({ config: config.fromKubeconfig(), version: '1.9'}); client.loadSpec(); ... const response: any = await client.apis.storage.k8s.io.v1beta1.storageclasses.get();
This is the error I got:
[8/28/2020, 5:34:55 PM] ERROR [ 'TypeError: Cannot read property \'k8s\' of undefined\n at ...]
However, if I print the client.apis, I can find the storage.k8s.io under it.
client.apis
storage.k8s.io
templatedEndpoints: null, parameter: null, splits: [ 'apis' ], http: Request { requestOptions: [Object], authProvider: [Object] }, getNames: [Function], children: [ 'autoscaling', 'apps', 'app', 'rbac.authorization.k8s.io', 'v1', 'policy', 'networking.k8s.io', 'extensions', 'extension', 'events.k8s.io', 'batch', 'settings.k8s.io', 'storage.k8s.io', 'scheduling.k8s.io', 'apiregistration.k8s.io', 'apiextensions.k8s.io', 'admissionregistration.k8s.io', 'certificates.k8s.io', 'authorization.k8s.io', 'authentication.k8s.io' ],
my bad, wrong api call
I can use some other APIs like
apis
andv1
. However, I gotstorage
not defined error during using the storage API. Here is part of my codeThis is the error I got:
However, if I print the
client.apis
, I can find thestorage.k8s.io
under it.