mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #893 from Dokploy/510-fractional-cpu-reservation-and-limit
refactor: remove calculation and pass resources as the docker api expect
This commit is contained in:
@@ -317,16 +317,12 @@ export const calculateResources = ({
|
|||||||
}: Resources): ResourceRequirements => {
|
}: Resources): ResourceRequirements => {
|
||||||
return {
|
return {
|
||||||
Limits: {
|
Limits: {
|
||||||
MemoryBytes: memoryLimit ? memoryLimit * 1024 * 1024 : undefined,
|
MemoryBytes: memoryLimit ?? undefined,
|
||||||
NanoCPUs: cpuLimit ? (cpuLimit || 1) * 1000 * 1000 * 1000 : undefined,
|
NanoCPUs: cpuLimit ?? undefined,
|
||||||
},
|
},
|
||||||
Reservations: {
|
Reservations: {
|
||||||
MemoryBytes: memoryReservation
|
MemoryBytes: memoryReservation ?? undefined,
|
||||||
? (memoryReservation || 1) * 1024 * 1024
|
NanoCPUs: cpuReservation ?? undefined,
|
||||||
: undefined,
|
|
||||||
NanoCPUs: cpuReservation
|
|
||||||
? (cpuReservation || 1) * 1000 * 1000 * 1000
|
|
||||||
: undefined,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user