feat(kubernetes): add kubernetes tool (#1929)

Co-authored-by: oussama Dahmaz <dahmaz@MacBook-Pro-de-odahmaz.local>
This commit is contained in:
oussama Dahmazandoussama Dahmaz authored and GitHub committed 2025-03-09 17:46:15 +01:00
1 parent f6f0d7c72b
commit f19aa29607
67 files changed
+3897 -67

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { TRPCError } from "@trpc/server";
import { env } from "@homarr/docker/env";
import { publicProcedure } from "../trpc";
export const dockerMiddleware = () => {
return publicProcedure.use(async ({ next }) => {
if (env.ENABLE_DOCKER) {
return await next();
}
throw new TRPCError({
code: "NOT_FOUND",
message: "Docker route is not available",
});
});
};
@@ -0,0 +1,17 @@
import { TRPCError } from "@trpc/server";
import { env } from "@homarr/docker/env";
import { publicProcedure } from "../trpc";
export const kubernetesMiddleware = () => {
return publicProcedure.use(async ({ next }) => {
if (env.ENABLE_KUBERNETES) {
return await next();
}
throw new TRPCError({
code: "NOT_FOUND",
message: "Kubernetes route is not available",
});
});
};