Remove unused backup utility and refactor service container retrieval

- Deleted the `createBackupLabels` function from the backup utilities as it was no longer needed.
- Removed the `getServiceContainerIV2` function from the Docker utilities and updated references to use the existing `getServiceContainer` function, streamlining the codebase and improving maintainability.
This commit is contained in:
Mauricio Siu
2025-05-03 13:36:49 -06:00
parent a8159e5f99
commit b3e2af3b40
3 changed files with 2 additions and 31 deletions

View File

@@ -520,31 +520,6 @@ export const getServiceContainer = async (
}
};
export const getServiceContainerIV2 = async (
appName: string,
serverId?: string | null,
) => {
try {
const filter = {
status: ["running"],
label: [`com.docker.swarm.service.name=${appName}`],
};
const remoteDocker = await getRemoteDocker(serverId);
const containers = await remoteDocker.listContainers({
filters: JSON.stringify(filter),
});
if (containers.length === 0 || !containers[0]) {
throw new Error(`No container found with name: ${appName}`);
}
const container = containers[0];
return container;
} catch (error) {
throw error;
}
};
export const getComposeContainer = async (
compose: Compose,
serviceName: string,