Code: small refactor, HA template: TCP backend fix
gitea/docker-discover/pipeline/head This commit looks good
Details
gitea/docker-discover/pipeline/head This commit looks good
Details
This commit is contained in:
parent
762fbffe3c
commit
a437b28cb0
8
index.js
8
index.js
|
@ -33,10 +33,6 @@ async function updateProxy(firstRun) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortFn(a, b) {
|
|
||||||
return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const workers = [];
|
const workers = [];
|
||||||
const managers = [];
|
const managers = [];
|
||||||
|
|
||||||
|
@ -85,6 +81,10 @@ async function updateProxy(firstRun) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sortFn(a, b) {
|
||||||
|
return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (const list of [workers, managers, http, tcp, udp])
|
for (const list of [workers, managers, http, tcp, udp])
|
||||||
list.sort(sortFn);
|
list.sort(sortFn);
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ backend {{name}}
|
||||||
|
|
||||||
{{#each tcp}}
|
{{#each tcp}}
|
||||||
listen {{name}}:{{port}}
|
listen {{name}}:{{port}}
|
||||||
|
bind :{{port}}
|
||||||
mode tcp
|
mode tcp
|
||||||
{{#each ../workers}}
|
{{#each ../workers}}
|
||||||
server {{name}} {{address}}:{{../port}} check
|
server {{name}} {{address}}:{{../port}} check
|
||||||
|
|
Reference in New Issue