Skip to content

add pub fn namespace(&self) -> Option<&str> to Api #1788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

tgrushka
Copy link
Contributor

@tgrushka tgrushka commented Jul 9, 2025

Signed-off-by: Tom Grushka [email protected]

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Motivation

There is currently no way to access the namespace: Option<String> private field of the Api instance. In case the Api is passed around code, as a developer of a kube-rs operator / controller, I want to be able to verify the namespace scope of the Api instance.

Further details in Feature Request: #1787

Solution

Provide immutable access to the namespace: Option<String> private field as a Deref.

Further details in Feature Request: #1787

Signed-off-by: Tom Grushka <[email protected]>

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.1%. Comparing base (06e843b) to head (8cf3e70).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
kube-client/src/api/mod.rs 0.0% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1788     +/-   ##
=======================================
- Coverage   75.2%   75.1%   -0.0%     
=======================================
  Files         84      84             
  Lines       7789    7791      +2     
=======================================
- Hits        5851    5849      -2     
- Misses      1938    1942      +4     
Files with missing lines Coverage Δ
kube-client/src/api/mod.rs 65.4% <0.0%> (-2.7%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clux clux added the changelog-add changelog added category for prs label Jul 10, 2025
@clux clux merged commit 6590ea9 into kube-rs:main Jul 10, 2025
16 of 17 checks passed
@clux clux added this to the 1.2.0 milestone Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Api::namespace(&self) -> Option<&str> to get current namespace of Api instance
2 participants