feat: add new test

This commit is contained in:
Mauricio Siu
2026-07-25 03:20:00 -06:00
parent aee15efac7
commit ec74035c70
4 changed files with 201 additions and 13 deletions

View File

@@ -6,13 +6,6 @@ import { z } from "zod";
import { organization } from "./account";
import { server } from "./server";
/**
* Docker network driver types. Only bridge and overlay are supported:
* "host"/"none" are Docker singletons that cannot be created, and
* macvlan/ipvlan require driver options (parent interface) we don't expose.
* Scope is derived from the driver (bridge = local, overlay = swarm), and
* ingress/config-only networks are not manageable from Dokploy.
*/
export const networkDriver = pgEnum("networkDriver", ["bridge", "overlay"]);
export const network = pgTable("network", {

View File

@@ -7,8 +7,6 @@ import { IS_CLOUD } from "../constants";
import type { ApplicationNested } from "../utils/builders";
import { getRemoteDocker } from "../utils/servers/remote-docker";
// Networks managed by Docker/Dokploy itself that must never be imported
// or deleted through the networks UI
const RESERVED_NETWORKS = [
"bridge",
"host",
@@ -325,7 +323,6 @@ export const inspectNetwork = async (networkId: string) => {
}
};
// Docker networks are immutable: there is no update, only create and remove.
export const removeNetwork = async (networkId: string) => {
const row = await findNetworkById(networkId);
@@ -333,7 +330,6 @@ export const removeNetwork = async (networkId: string) => {
try {
await docker.getNetwork(row.name).remove();
} catch (error) {
// If the network is already gone from Docker, still clean up the DB row
const statusCode = (error as { statusCode?: number })?.statusCode;
if (statusCode !== 404) {
throw new TRPCError({

View File

@@ -240,7 +240,7 @@ export const addDomainToCompose = async (
return result;
};
const applyServiceNetworks = async (
export const applyServiceNetworks = async (
result: ComposeSpecification,
compose: Compose,
) => {
@@ -282,7 +282,7 @@ const applyServiceNetworks = async (
return injectedNetworkNames;
};
const declareUsedNetworksInRoot = (
export const declareUsedNetworksInRoot = (
result: ComposeSpecification,
injectedNetworkNames: Set<string>,
) => {