mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-05 05:55:21 +02:00
feat(settings): add error handling for unsupported resource types in Traefik setup
- Introduced error handling for unsupported resource types in `readPorts` and `writeTraefikSetup` functions. - Enhanced `initializeStandaloneTraefik` to include image pulling with error logging for better debugging.
This commit is contained in:
@@ -342,6 +342,8 @@ export const readPorts = async (
|
||||
command = `docker service inspect ${resourceName} --format '{{json .Spec.EndpointSpec.Ports}}'`;
|
||||
} else if (resourceType === "standalone") {
|
||||
command = `docker container inspect ${resourceName} --format '{{json .NetworkSettings.Ports}}'`;
|
||||
} else {
|
||||
throw new Error("Resource type not found");
|
||||
}
|
||||
let result = "";
|
||||
if (serverId) {
|
||||
@@ -397,17 +399,20 @@ export const writeTraefikSetup = async (input: TraefikOptions) => {
|
||||
"dokploy-traefik",
|
||||
input.serverId,
|
||||
);
|
||||
|
||||
if (resourceType === "service") {
|
||||
await initializeTraefikService({
|
||||
env: input.env,
|
||||
additionalPorts: input.additionalPorts,
|
||||
serverId: input.serverId,
|
||||
});
|
||||
} else {
|
||||
} else if (resourceType === "standalone") {
|
||||
await initializeStandaloneTraefik({
|
||||
env: input.env,
|
||||
additionalPorts: input.additionalPorts,
|
||||
serverId: input.serverId,
|
||||
});
|
||||
} else {
|
||||
throw new Error("Traefik resource type not found");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user