fix: adjust scaling command in backupVolume function

- Updated the backupVolume function to use the actual number of replicas when scaling services back up after a backup, improving accuracy in service management.
- Enhanced command generation for application service types to ensure proper restoration of service states.
This commit is contained in:
Mauricio Siu
2025-06-30 11:27:18 -06:00
parent 46d84eaa71
commit e21605030a

View File

@@ -32,8 +32,9 @@ const backupVolume = async (
if (serviceType === "application") {
return `
docker service scale ${volumeBackup.application?.appName}=0
ACTUAL_REPLICAS=$(docker service inspect ${volumeBackup.application?.appName} --format "{{.Spec.Mode.Replicated.Replicas}}")
${baseCommand}
docker service scale ${volumeBackup.application?.appName}=1
docker service scale ${volumeBackup.application?.appName}=$ACTUAL_REPLICAS
`;
}
if (serviceType === "compose") {