Skip to content

libcontainerd/supervisor: consolidate platform-specific defaults#48353

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:libcontainer_consolidate_defaults_step1
Aug 20, 2024
Merged

libcontainerd/supervisor: consolidate platform-specific defaults#48353
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:libcontainer_consolidate_defaults_step1

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Commit a000934 updated the default MaxRecvMsgSize and MaxSendMsgSize for Linux, but did not modify the defaults for Windows. Those options should not be platform-specific, which means that the only difference between the Linux and Windows config are the addresses for GRPC and Debug (Windows defaulting to a named pipe, whereas Linux sockets within exec-root).

This patch

  • implements functions to return the default addresses for each platform
  • moves the defaults into supervisor.Start()
  • removes the now redundant remote.setDefaults() method

It's worth noting that prior to this path, remove.setDefaults() would be applied after any (custom) DaemonOpt was applied. However, none of the existing DaemonOpt options currently mutates these options. remote is also a non-exported type, so no external implementations can currently be created. It is therefore safe to set these defaults before options are applied.

Commit a000934 updated the default
MaxRecvMsgSize and MaxSendMsgSize for Linux, but did not modify the
defaults for Windows. Those options should not be platform-specific,
which means that the only difference between the Linux and Windows
config are the addresses for GRPC and Debug (Windows defaulting
to a named pipe, whereas Linux sockets within exec-root).

This patch

- implements functions to return the default addresses for each platform
- moves the defaults into `supervisor.Start()`
- removes the now redundant `remote.setDefaults()` method

It's worth noting that prior to this path, `remove.setDefaults()` would
be applied _after_ any (custom) `DaemonOpt` was applied. However, none of
the existing `DaemonOpt` options currently mutates these options. `remote`
is also a non-exported type, so no external implementations can currently
be created. It is therefore safe to set these defaults before options are
applied.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added area/runtime Runtime status/2-code-review area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code labels Aug 19, 2024
@thaJeztah thaJeztah added this to the 28.0.0 milestone Aug 19, 2024
@thaJeztah thaJeztah self-assigned this Aug 19, 2024
@thaJeztah
Copy link
Copy Markdown
Member Author

Thanks! Let me bring this one in, and continue looking at the original PR what part CI didn't like 😂 (I'm starting to suspect the second commit there)

@thaJeztah thaJeztah merged commit 7e864f1 into moby:master Aug 20, 2024
@thaJeztah thaJeztah deleted the libcontainer_consolidate_defaults_step1 branch August 20, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine area/runtime Runtime kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants