-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add containerd cri #19
Conversation
b333e6d
to
ea527a1
Compare
Signed-off-by: Miguel Duarte Barroso <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of them are nits on naming
netnsPath, err := pnc.netnsPath(newPod) | ||
if err != nil { | ||
klog.Errorf("failed to figure out the pod's network namespace: %v", err) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A DynamicAttachmentRequest
without PodNetNS
is legit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why we don't return the error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the UpdateFunc
of the controller; how can it return errors?
podInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{
UpdateFunc: podNetworksController.handlePodUpdate,
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe better send an event more than an error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be, but events go away after an hour. I prefer to just log.
ea527a1
to
184ee5a
Compare
Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Miguel Duarte Barroso <[email protected]>
184ee5a
to
c80852f
Compare
Signed-off-by: Miguel Duarte Barroso <[email protected]>
c80852f
to
4bcb812
Compare
By making the `DynamicAttachmentRequest` implement the stringer interface, we can have proper information whenever we log those requests. Signed-off-by: Miguel Duarte Barroso <[email protected]>
4bcb812
to
f5c801a
Compare
func (c Container) ID() string { | ||
return c.id | ||
} | ||
|
||
func (Container) Info(context.Context, ...containerd.InfoOpts) (containers.Container, error) { | ||
return containers.Container{}, nil | ||
} | ||
|
||
func (Container) Delete(context.Context, ...containerd.DeleteOpts) error { | ||
return nil | ||
} | ||
|
||
func (Container) NewTask(context.Context, cio.Creator, ...containerd.NewTaskOpts) (containerd.Task, error) { | ||
return nil, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault I se it now
"github.com/containerd/containerd" | ||
) | ||
|
||
type Client interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault the containerd concept is called Client https://github.com/containerd/containerd/blob/main/client.go#L85
@@ -9,3 +9,9 @@ const ( | |||
// Containerd represents the containerd container runtime | |||
Containerd RuntimeType = "containerd" | |||
) | |||
|
|||
// ContainerRuntime interface | |||
type ContainerRuntime interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah all fine
This PR adds the
containerd
CRI implementation to the project, along with unit tests.Fixes: #20