Skip to content

libcontainerd/supervisor: clean up (dead) code#43901

Merged
cpuguy83 merged 2 commits intomoby:masterfrom
thaJeztah:libcontainerd_cleanup_supervisor
Aug 9, 2022
Merged

libcontainerd/supervisor: clean up (dead) code#43901
cpuguy83 merged 2 commits intomoby:masterfrom
thaJeztah:libcontainerd_cleanup_supervisor

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

(still some other clutter that can be cleaned up, but keeping that for a later exercise)

libcontainerd/supervisor: remove unused options

This removes the WithRemoteAddr(), WithRemoteAddrUser(), WithDebugAddress(),
and WithMetricsAddress() options, added in ddae20c,
but most of them were never used, and WithRemoteAddr() no longer in use since
dd2e19e.

libcontainerd/supervisor: simplify logic for disabling CRI plugin

The existing implementation used a nil value for the CRI plugin's configuration
to indicate that the plugin had to be disabled. Effectively, the Plugins value
was only used as an intermediate step, only to be removed later on, and to instead
add the given plugin to DisabledPlugins in the containerd configuration.

This patch removes the intermediate step; as a result we also don't need to mask
the containerd Plugins field, which was added to allow serializing the toml.

A code comment was added as well to explain why we're (currently) disabling the
CRI plugin by default, which may help future visitors of the code to determin
if that default is still needed.

- A picture of a cute animal (not mandatory but encouraged)

This removes the `WithRemoteAddr()`, `WithRemoteAddrUser()`, `WithDebugAddress()`,
and `WithMetricsAddress()` options, added in ddae20c,
but most of them were never used, and `WithRemoteAddr()` no longer in use since
dd2e19e.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
The existing implementation used a `nil` value for the CRI plugin's configuration
to indicate that the plugin had to be disabled. Effectively, the `Plugins` value
was only used as an intermediate step, only to be removed later on, and to instead
add the given plugin to `DisabledPlugins` in the containerd configuration.

This patch removes the intermediate step; as a result we also don't need to mask
the containerd `Plugins` field, which was added to allow serializing the toml.

A code comment was added as well to explain why we're (currently) disabling the
CRI plugin by default, which may help future visitors of the code to determin
if that default is still needed.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added area/runtime Runtime status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Aug 3, 2022
@thaJeztah thaJeztah added this to the v-next milestone Aug 3, 2022
@thaJeztah
Copy link
Copy Markdown
Member Author

@corhere @cpuguy83 PTAL

@cpuguy83 cpuguy83 merged commit c8fc989 into moby:master Aug 9, 2022
@thaJeztah thaJeztah deleted the libcontainerd_cleanup_supervisor branch August 9, 2022 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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