Skip to content

docs: fix readNamespace/deleteNamespace calls in README example - #2881

Merged
k8s-ci-robot merged 1 commit into
kubernetes-client:mainfrom
emmayusufu:docs/fix-readme-namespace-example
May 28, 2026
Merged

k8s-ci-robot merged 1 commit into
kubernetes-client:mainfrom
emmayusufu:docs/fix-readme-namespace-example

Conversation

@emmayusufu

Copy link
Copy Markdown
Contributor

The "Create a namespace" example in the README mixes API call styles.

makeApiClient(k8s.CoreV1Api) returns the object-parameter API (gen/index.ts exports ObjectCoreV1Api as CoreV1Api), so every method takes a single request object. The example gets createNamespace({ body: namespace }) right, but the following calls don't:

  • readNamespace(namespace.metadata.name) — the signature is readNamespace(param: CoreV1ApiReadNamespaceRequest), and that interface requires { name: string }. Passing a bare string is a type error and param.name ends 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.

NONE

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>
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 28, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: emmayusufu / name: Emmanuel Yusufu Kimaswa (a5241f8)

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @emmayusufu!

It looks like this is your first PR to kubernetes-client/javascript 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/javascript has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 28, 2026

@mstruebing mstruebing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

Thanks 🚀

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 28, 2026
@k8s-ci-robot
k8s-ci-robot merged commit 4341d5e into kubernetes-client:main May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants