Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor NewWorkerOpt function so it accepts a pre-created containerd client #4365

Closed
wants to merge 1 commit into from

Conversation

slonopotamus
Copy link
Contributor

This gives calling side more flexibility and allows to avoid creation of redundant client in Moby.

… client

This gives calling side more flexibility and allows to avoid creation of redundant client in Moby.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
@@ -80,13 +70,13 @@ func newContainerd(root string, client *containerd.Client, snapshotterName, ns s
if apparmorProfile != "" {
xlabels[wlabel.ApparmorProfile] = apparmorProfile
}
xlabels[wlabel.ContainerdNamespace] = ns
xlabels[wlabel.ContainerdNamespace] = client.DefaultNamespace()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like containerd guarantees that DefaultNamespace() returns a non-zero value. In that case we need to validate it in this function before using.

@slonopotamus slonopotamus deleted the worker-opt branch December 14, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants