fix: support --memory-swap and --memory-swappiness in docker service update - #7130
fix: support --memory-swap and --memory-swappiness in docker service update#7130waterWang wants to merge 1 commit into
Conversation
…update The --memory-swap (flagSwapBytes) and --memory-swappiness (flagMemSwappiness) flags were handled in docker service create but missing from the update path in updateService(), causing docker service update --memory-swap to silently ignore the option. Fixes moby/moby#53196 Signed-off-by: waterWang <waterWang@users.noreply.github.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
It looks like the DCO check is failing; Can you;
(canned reply with more details below); Thank you for contributing! It looks like your commit message is missing a DCO sign-off, We require all commit messages to have a There is no need to open a new pull request, but to fix this (and make CI pass), Unfortunately, it's not possible to do so through GitHub's web UI, so this needs You can find some instructions in the output of the DCO check (which can be found Steps to do so "roughly" come down to:
Let me know if you need help or more detailed instructions! |
|
Hi maintainers, just a friendly ping — this PR has been open for a while. Could you take a look when you have a moment? Happy to address any feedback. Thanks! |
|
@waterWang Thanks for finding a fix for the issue I reported.
You were asked here to resolve issues related to DCO. From what I can gather, this is because your commit looked like this: Notice that the email address associated with the commit begins with To resolve this, you'll need to change the email address configured with your local Git client to |
|
@thaJeztah One issue I noticed with the canned reply is that it doesn't mention that including this line purportedly constitutes agreement to the Developer's Certificate of Origin 1.1. This is stated in the CONTRIBUTING file linked in your reply, but since following this link isn't necessary to follow the instructions in the canned reply, many contributors will include the sign-off without being aware of its purported significance. In my opinion, this makes the validity of the sign-off as a legally valid signature very dubious. Perhaps you should add a note to the canned reply, in bold and with a link to the DCO 1.1, saying explicitly that by calling |
Description
The
--memory-swapand--memory-swappinessflags are handled bydocker service createbut are missing from the update path inupdateService(). This causesdocker service update --memory-swap '1G'to silently ignore the option, leaving the service'sSwapBytesunchanged.Reproduction
docker service create --limit-memory '0.5G' --memory-swap '0.5G' ubuntu tail -f /dev/nulldocker service inspect <id> --format '{{.Spec.TaskTemplate.Resources.SwapBytes}}'→ 536870912docker service update <id> --memory-swap '1G' --forceFix
Added
flagSwapBytesandflagMemSwappinesshandling to theupdateServicefunction incli/command/service/update.go, matching the logic already present inresourceOptions.ToResourceRequirements()used bydocker service create.Fixes moby/moby#53196
Signed-off-by: waterWang waterWang@users.noreply.github.com