1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

chore: Cleanup kubectlApplyAllChannelHandler

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-03 10:06:13 -04:00
parent 0696f466a8
commit a86361e09e

View File

@ -7,6 +7,7 @@ import { kubectlApplyAllChannel } from "../../common/kube-helpers/channels";
import getClusterByIdInjectable from "../../features/cluster/storage/common/get-by-id.injectable"; import getClusterByIdInjectable from "../../features/cluster/storage/common/get-by-id.injectable";
import resourceApplierInjectable from "../resource-applier/create-resource-applier.injectable"; import resourceApplierInjectable from "../resource-applier/create-resource-applier.injectable";
import { getRequestChannelListenerInjectable } from "@k8slens/messaging"; import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { result } from "@k8slens/utilities";
const kubectlApplyAllChannelHandlerInjectable = getRequestChannelListenerInjectable({ const kubectlApplyAllChannelHandlerInjectable = getRequestChannelListenerInjectable({
id: "kubectl-apply-all-channel-handler-listener", id: "kubectl-apply-all-channel-handler-listener",
@ -26,10 +27,7 @@ const kubectlApplyAllChannelHandlerInjectable = getRequestChannelListenerInjecta
emitAppEvent({ name: "cluster", action: "kubectl-apply-all" }); emitAppEvent({ name: "cluster", action: "kubectl-apply-all" });
if (!cluster) { if (!cluster) {
return { return result.error(`No cluster found for clusterId="${clusterId}"`);
isOk: false,
error: `No cluster found for clusterId="${clusterId}"`,
};
} }
const resourceApplier = di.inject(resourceApplierInjectable, cluster); const resourceApplier = di.inject(resourceApplierInjectable, cluster);