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

bugfix: remove duplicate TypeUrl initialize #2082

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ctrd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func NewClient(homeDir string, opts ...ClientOpt) (APIClient, error) {
client.scheduler = scheduler

// start collect containerd events
initTypeURL()
go client.collectContainerdEvents()

return client, nil
Expand Down
9 changes: 0 additions & 9 deletions ctrd/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package ctrd
import (
"context"

eventstypes "github.com/containerd/containerd/api/events"
eventsapi "github.com/containerd/containerd/api/services/events/v1"
"github.com/containerd/containerd/runtime"
"github.com/gogo/protobuf/proto"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -38,10 +36,3 @@ func (c *Client) Events(ctx context.Context, ef ...string) (eventsapi.Events_Sub
Filters: ef,
})
}

// initTypeURL initializes URL type for containerd events url type,
// it works for typeurl.UnmarshalAny
func initTypeURL() {
proto.RegisterType((*eventstypes.ContainerDelete)(nil), "containerd.events.ContainerDelete")
proto.RegisterType((*eventstypes.TaskOOM)(nil), "containerd.events.TaskOOM")
}