You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Getting the following uncaght error when running cp.cpToPod with a wrong namespace or pod name.
Uncaught Error UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ErrorEvent>".
Traces down to connect(path, textHandler, binaryHandler) in WebSocketHandler, returning a 404 when trying to connect to the cluster+namespace+pod.
Client Version 0.18.1
Server Version 1.26.7
To Reproduce
Just run the following code using a wrong namespace or pod name
Expected behavior
Correct error handling by the cpToPod method.
Example Code
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const cp = new k8s.Cp(kc);
const main = async () => {
try{
await cp.cpToPod(NAMESPACE, , WRONG_POD_NAME, './test.txt', '/tmp');
}catch(err) {
console.log(err)
}
};
main();
Environment (please complete the following information):
Describe the bug
Getting the following uncaght error when running
cp.cpToPod
with a wrong namespace or pod name.Traces down to
connect(path, textHandler, binaryHandler)
inWebSocketHandler
, returning a 404 when trying to connect to the cluster+namespace+pod.Client Version
0.18.1
Server Version
1.26.7
To Reproduce
Just run the following code using a wrong namespace or pod name
Expected behavior
Correct error handling by the
cpToPod
method.Example Code
Environment (please complete the following information):
Additional context
I guess that the main problem is that there isn't an
await
herehttps://github.com/kubernetes-client/javascript/blob/6a8337ff8a97eba7bc143f87303754e4f488eb15/src/cp.ts#L81C6-L81C6
The text was updated successfully, but these errors were encountered: