Skip to content
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

Using middleware with 1.x clients #1925

Open
memoselyk opened this issue Oct 11, 2024 · 1 comment
Open

Using middleware with 1.x clients #1925

memoselyk opened this issue Oct 11, 2024 · 1 comment

Comments

@memoselyk
Copy link

I gather from the docs, that the standard pattern to create a client is with KubeConfig's makeApiClient (see here ).

However, there is no way to create a client with middlewares.

My use case is to add a proxy or use impersonation headers to a client, that was possible in the client's instance with apiclient.addInterceptor and it seem the new mechanism is using middlewares.

What would be the best place to give a middleware?
Should it be an argument to the makeApiClient factory or is it better to make them part of the kube config, eg, config.addMiddlewares?

I feel inclined towards the first option, but I'm relatively new to this library.

@brendandburns
Copy link
Contributor

Yeah, I think that's fine, as long as it is optional, we can't break existing callers of makeApiClient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants