Skip to content

Any way to get namespace configuration? #2239

@johnflavin-fw

Description

@johnflavin-fw

I'm currently using the ClientBuilder.defaultClient() method to create an ApiClient. I like that it covers all the standard ways where configuration might be.

But I also want to know the namespace configuration. The ApiClient doesn't know anything about the namespace. If I want to get the namespace while retaining the flexibility of finding the configuration in all the different places, it seems like I would need to reimplement the logic within ClientBuilder.defaultClient(), dig into the methods it calls, and also read the namespace. But most of the methods it calls that ultimately read the kubeconfig or the mounted service account secret are private.

It looks to me like I'll need to copy/paste a lot of the util methods to find and read these files just to find the namespace configuration. Is that correct? Is there an easier way?

Would it make sense for namespace to be added to the ApiClient and set in the various ClientBuilder methods? And then if a namespace is configured on the ApiClient could that value automatically be used on all client methods that require a namespace arg? (I'm aware that would be a ton more work but it would be very very nice as a user.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions