-
Notifications
You must be signed in to change notification settings - Fork 544
Can't add middleware without passing the entire Configuration Object #2264
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
Comments
Thanks for the report and the reproduction, we'll try to validate and figure out what is going wrong. |
There is a known issue in v1.x around configuration being ignored inside the code generator: #2160 (comment). Is it possible that this is related to that? |
v1.1.0 is out https://www.npmjs.com/package/@kubernetes/client-node/v/1.1.0 it should include fixes to make progress on this issue |
@JanPfenning does v1.1.2 fix this issue for you? |
I looked into this, and the cause is:
{
baseServer: ServerConfiguration { url: '', variableConfiguration: {} },
httpApi: IsomorphicFetchHttpLibrary {},
middleware: [],
authMethods: {}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
I'm guessing the expected behavior is either:
|
I would argue that 2. is the desired behavior honestly. |
Describe the bug
when trying to add a promiseMiddleware to alter the result (post-query) i receive the the following error message:
Client Version
1.0.0
To Reproduce
run the provided typescript snipped
Expected behavior
When no configuration is passed to readNamespace at all it works fine to read the information.
As i do not change the configuration of the Target Server or the authentication in any way the addition of a middleware via the createConfiguration method should not change these values. The resulting config should be the same config that would be used if nothing is passed as explicit config but with the sole addition of the middleware
Example Code
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: