Repository navigation
docs: fix readNamespace/deleteNamespace calls in README example - #2881
k8s-ci-robot merged 1 commit into
Conversation
The exported CoreV1Api is the object-parameter API, so its methods take
a single request object. The "Create a namespace" example already uses
createNamespace({ body }) correctly, but readNamespace and
deleteNamespace are still called with a bare string, which doesn't match
the current signature (readNamespace(param: CoreV1ApiReadNamespaceRequest)
and deleteNamespace(param: CoreV1ApiDeleteNamespaceRequest), both
requiring { name }). Update them to pass { name }.
Signed-off-by: Emmanuel Yusufu Kimaswa <kimaswaemma36@gmail.com>
|
|
|
Welcome @emmayusufu! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: emmayusufu, mstruebing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The "Create a namespace" example in the README mixes API call styles.
makeApiClient(k8s.CoreV1Api)returns the object-parameter API (gen/index.tsexportsObjectCoreV1Api as CoreV1Api), so every method takes a single request object. The example getscreateNamespace({ body: namespace })right, but the following calls don't:readNamespace(namespace.metadata.name)— the signature isreadNamespace(param: CoreV1ApiReadNamespaceRequest), and that interface requires{ name: string }. Passing a bare string is a type error andparam.nameends up undefined at runtime.deleteNamespace(namespace.metadata.name, {})— same problem;deleteNamespace(param: CoreV1ApiDeleteNamespaceRequest)also requires{ name }.This updates both to
{ name: namespace.metadata.name }so the example type-checks and runs against the current API. Docs-only, no generated code touched.