mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: remove duplicate case
This commit is contained in:
parent
fffe1d6249
commit
af083ffa5d
@ -214,20 +214,15 @@ export const addDomainToCompose = async (
|
||||
httpLabels.push(...httpsLabels);
|
||||
}
|
||||
|
||||
let labels: DefinitionsService["labels"] = [];
|
||||
if (compose.composeType === "docker-compose") {
|
||||
if (!result.services[serviceName].labels) {
|
||||
result.services[serviceName].labels = [];
|
||||
}
|
||||
|
||||
const labels = result.services[serviceName].labels;
|
||||
|
||||
if (Array.isArray(labels)) {
|
||||
if (!labels.includes("traefik.enable=true")) {
|
||||
labels.push("traefik.enable=true");
|
||||
}
|
||||
labels.push(...httpLabels);
|
||||
}
|
||||
labels = result.services[serviceName].labels;
|
||||
} else {
|
||||
// Stack Case
|
||||
if (!result.services[serviceName].deploy) {
|
||||
result.services[serviceName].deploy = {};
|
||||
}
|
||||
@ -235,7 +230,8 @@ export const addDomainToCompose = async (
|
||||
result.services[serviceName].deploy.labels = [];
|
||||
}
|
||||
|
||||
const labels = result.services[serviceName].deploy.labels;
|
||||
labels = result.services[serviceName].deploy.labels;
|
||||
}
|
||||
|
||||
if (Array.isArray(labels)) {
|
||||
if (!labels.includes("traefik.enable=true")) {
|
||||
@ -243,7 +239,6 @@ export const addDomainToCompose = async (
|
||||
}
|
||||
labels.push(...httpLabels);
|
||||
}
|
||||
}
|
||||
|
||||
// Add the dokploy-network to the service
|
||||
result.services[serviceName].networks = addDokployNetworkToService(
|
||||
|
Loading…
Reference in New Issue
Block a user