mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-19 10:25:20 +00:00
refactor: simplify Docker resource type determination logic by consolidating command structure
This commit is contained in:
@@ -257,20 +257,14 @@ export const getDockerResourceType = async (
|
|||||||
console.log("resourceName", resourceName);
|
console.log("resourceName", resourceName);
|
||||||
let result = "";
|
let result = "";
|
||||||
const command = `
|
const command = `
|
||||||
RESOURCE_NAME="${resourceName}"
|
RESOURCE_NAME="${resourceName}"
|
||||||
if docker service inspect "$RESOURCE_NAME" &>/dev/null; then
|
if docker service inspect "$RESOURCE_NAME" >/dev/null 2>&1; then
|
||||||
echo "service"
|
echo "service"
|
||||||
exit 0
|
elif docker inspect "$RESOURCE_NAME" >/dev/null 2>&1; then
|
||||||
fi
|
echo "standalone"
|
||||||
|
else
|
||||||
if docker inspect "$RESOURCE_NAME" &>/dev/null; then
|
echo "unknown"
|
||||||
echo "standalone"
|
fi`;
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "unknown"
|
|
||||||
exit 0
|
|
||||||
`;
|
|
||||||
|
|
||||||
console.log("command", command);
|
console.log("command", command);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user