From e5106e3ae06fad8bf25908a785bc1d3f03641b17 Mon Sep 17 00:00:00 2001 From: Nick Mitchell Date: Wed, 15 Sep 2021 17:28:38 -0400 Subject: [PATCH] fix(plugins/plugin-kubectl): k delete via API does not properly handle proxy errors we are returning the error, rather than throwing it part of #8004 --- .../plugin-kubectl/src/controller/client/direct/delete.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/plugin-kubectl/src/controller/client/direct/delete.ts b/plugins/plugin-kubectl/src/controller/client/direct/delete.ts index 8d1b3671e40..1408a87e060 100644 --- a/plugins/plugin-kubectl/src/controller/client/direct/delete.ts +++ b/plugins/plugin-kubectl/src/controller/client/direct/delete.ts @@ -61,9 +61,10 @@ export default async function deleteDirect(args: Arguments, _kind?: // then dissect it into errors and non-errors const { errors, ok } = await handleErrors(responses, formatUrl, kind, args.REPL) if (ok.length === 0) { - // all 404 errors? then tell the user about them (no need to re-invoke the CLI) if (errors.length > 0 && errors.every(is404)) { - return errors.map(_ => _.message).join('\n') + // all 404 errors? then tell the user about them (no need to re-invoke the CLI) + debug('throwing delete errors from the API', errors) + throw new Error(errors.map(_ => _.message).join('\n')) } // otherwise: intentional fall-through, returning void; let // kubectl CLI handle the errors for now