Skip to content

Commit

Permalink
Merge pull request containerd#9891 from dmcgowan/move-events-plugin
Browse files Browse the repository at this point in the history
Move events to plugins and core
  • Loading branch information
fuweid authored Feb 29, 2024
2 parents 1f69774 + 72f2183 commit 6333db7
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/core/content"
contentproxy "github.com/containerd/containerd/v2/core/content/proxy"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/images"
"github.com/containerd/containerd/v2/core/leases"
leasesproxy "github.com/containerd/containerd/v2/core/leases/proxy"
Expand All @@ -53,7 +54,6 @@ import (
snproxy "github.com/containerd/containerd/v2/core/snapshots/proxy"
"github.com/containerd/containerd/v2/defaults"
"github.com/containerd/containerd/v2/pkg/dialer"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/plugins/services/introspection"
Expand Down
2 changes: 1 addition & 1 deletion client/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

eventsapi "github.com/containerd/containerd/v2/api/services/events/v1"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/protobuf"
"github.com/containerd/errdefs"
"github.com/containerd/typeurl/v2"
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package builtins
// register containerd builtins here
import (
_ "github.com/containerd/containerd/v2/core/runtime/v2"
_ "github.com/containerd/containerd/v2/pkg/events/plugin"
_ "github.com/containerd/containerd/v2/pkg/nri/plugin"
_ "github.com/containerd/containerd/v2/plugins/events"
_ "github.com/containerd/containerd/v2/plugins/gc"
_ "github.com/containerd/containerd/v2/plugins/imageverifier"
_ "github.com/containerd/containerd/v2/plugins/leases"
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"

"github.com/containerd/containerd/v2/cmd/ctr/commands"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/log"
"github.com/containerd/typeurl/v2"
"github.com/urfave/cli/v2"
Expand Down
2 changes: 1 addition & 1 deletion contrib/fuzz/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package fuzz
import (
// base containerd imports
_ "github.com/containerd/containerd/v2/core/runtime/v2"
_ "github.com/containerd/containerd/v2/pkg/events/plugin"
_ "github.com/containerd/containerd/v2/pkg/nri/plugin"
_ "github.com/containerd/containerd/v2/plugins/cri"
_ "github.com/containerd/containerd/v2/plugins/cri/images"
_ "github.com/containerd/containerd/v2/plugins/cri/runtime"
_ "github.com/containerd/containerd/v2/plugins/diff/walking/plugin"
_ "github.com/containerd/containerd/v2/plugins/events"
_ "github.com/containerd/containerd/v2/plugins/gc"
_ "github.com/containerd/containerd/v2/plugins/imageverifier"
_ "github.com/containerd/containerd/v2/plugins/leases"
Expand Down
4 changes: 2 additions & 2 deletions contrib/fuzz/exchange_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

fuzz "github.com/AdaLogics/go-fuzz-headers"
eventstypes "github.com/containerd/containerd/v2/api/events"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/pkg/namespaces"
)

Expand Down
3 changes: 2 additions & 1 deletion contrib/v2-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ for GOFILE in $(find . -name "*.go" | grep -v "./vendor/" ); do
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/snapshots/$1$2"github.com\/containerd\/containerd\/v2\/core\/snapshots/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/archive/$1$2"github.com\/containerd\/containerd\/v2\/pkg\/archive/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/cio/$1$2"github.com\/containerd\/containerd\/v2\/pkg\/cio/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/events/$1$2"github.com\/containerd\/containerd\/v2\/pkg\/events/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/events\/plugin/$1$2"github.com\/containerd\/containerd\/v2\/plugins\/events/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/events/$1$2"github.com\/containerd\/containerd\/v2\/core\/events/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/errdefs/$1$2"github.com\/containerd\/containerd\/v2\/pkg\/errdefs/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/filters/$1$2"github.com\/containerd\/containerd\/v2\/pkg\/filters/g' $GOFILE
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/gc\/scheduler/$1$2"github.com\/containerd\/containerd\/v2\/plugins\/gc/g' $GOFILE
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
"time"

"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/pkg/filters"
"github.com/containerd/containerd/v2/pkg/identifiers"
"github.com/containerd/containerd/v2/pkg/namespaces"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"time"

eventstypes "github.com/containerd/containerd/v2/api/events"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/protobuf"
"github.com/containerd/errdefs"
Expand Down
2 changes: 1 addition & 1 deletion core/metadata/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (

eventstypes "github.com/containerd/containerd/v2/api/events"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/snapshots"
"github.com/containerd/containerd/v2/internal/cleanup"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/gc"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/log"
Expand Down
2 changes: 1 addition & 1 deletion core/metrics/cgroups/cgroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"context"

"github.com/containerd/cgroups/v3"
"github.com/containerd/containerd/v2/core/events"
v1 "github.com/containerd/containerd/v2/core/metrics/cgroups/v1"
v2 "github.com/containerd/containerd/v2/core/metrics/cgroups/v2"
"github.com/containerd/containerd/v2/core/runtime"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/version"
"github.com/containerd/platforms"
Expand Down
2 changes: 1 addition & 1 deletion core/metrics/cgroups/v1/cgroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

cgroups "github.com/containerd/cgroups/v3/cgroup1"
eventstypes "github.com/containerd/containerd/v2/api/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/runtime"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/errdefs"
"github.com/containerd/log"
Expand Down
2 changes: 1 addition & 1 deletion core/metrics/cgroups/v2/cgroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package v2
import (
"context"

"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/runtime"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/docker/go-metrics"
)

Expand Down
2 changes: 1 addition & 1 deletion core/runtime/v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import (

apitypes "github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/core/runtime"
shimbinary "github.com/containerd/containerd/v2/core/runtime/v2/shim"
"github.com/containerd/containerd/v2/core/sandbox"
"github.com/containerd/containerd/v2/internal/cleanup"
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/pkg/timeout"
"github.com/containerd/containerd/v2/plugins"
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/v2/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import (
eventstypes "github.com/containerd/containerd/v2/api/events"
task "github.com/containerd/containerd/v2/api/runtime/task/v3"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/core/runtime"
client "github.com/containerd/containerd/v2/core/runtime/v2/shim"
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/pkg/identifiers"
"github.com/containerd/containerd/v2/pkg/timeout"
"github.com/containerd/containerd/v2/protobuf"
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/v2/shim/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

v1 "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/pkg/ttrpcutil"
"github.com/containerd/containerd/v2/protobuf"
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/v2/shim/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

shimapi "github.com/containerd/containerd/v2/api/runtime/task/v3"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/pkg/shutdown"
"github.com/containerd/containerd/v2/plugins"
Expand Down
2 changes: 1 addition & 1 deletion integration/build_local_containerd_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ import (

_ "github.com/containerd/containerd/v2/core/runtime/v2"
_ "github.com/containerd/containerd/v2/core/runtime/v2/runc/options"
_ "github.com/containerd/containerd/v2/pkg/events/plugin"
_ "github.com/containerd/containerd/v2/plugins/cri/images"
_ "github.com/containerd/containerd/v2/plugins/cri/runtime"
_ "github.com/containerd/containerd/v2/plugins/diff/walking/plugin"
_ "github.com/containerd/containerd/v2/plugins/events"
_ "github.com/containerd/containerd/v2/plugins/gc"
_ "github.com/containerd/containerd/v2/plugins/leases"
_ "github.com/containerd/containerd/v2/plugins/metadata"
Expand Down
2 changes: 1 addition & 1 deletion internal/cri/server/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import (
eventtypes "github.com/containerd/containerd/v2/api/events"
apitasks "github.com/containerd/containerd/v2/api/services/tasks/v1"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/internal/cri/constants"
containerstore "github.com/containerd/containerd/v2/internal/cri/store/container"
sandboxstore "github.com/containerd/containerd/v2/internal/cri/store/sandbox"
ctrdutil "github.com/containerd/containerd/v2/internal/cri/util"
containerdio "github.com/containerd/containerd/v2/pkg/cio"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/protobuf"
"github.com/containerd/errdefs"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/events/plugin/plugin.go → plugins/events/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
limitations under the License.
*/

package plugin
package events

import (
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/plugin"
"github.com/containerd/plugin/registry"
Expand Down
2 changes: 1 addition & 1 deletion plugins/metadata/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"time"

"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/core/snapshots"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/timeout"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/errdefs"
Expand Down
4 changes: 2 additions & 2 deletions plugins/sandbox/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (

runtimeAPI "github.com/containerd/containerd/v2/api/runtime/sandbox/v1"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/containerd/v2/core/runtime"
v2 "github.com/containerd/containerd/v2/core/runtime/v2"
"github.com/containerd/containerd/v2/core/sandbox"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/errdefs"
"github.com/containerd/log"
Expand Down
2 changes: 1 addition & 1 deletion plugins/services/containers/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
eventstypes "github.com/containerd/containerd/v2/api/events"
api "github.com/containerd/containerd/v2/api/services/containers/v1"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/plugins/services"
ptypes "github.com/containerd/containerd/v2/protobuf/types"
Expand Down
2 changes: 1 addition & 1 deletion plugins/services/content/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (

eventstypes "github.com/containerd/containerd/v2/api/events"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/plugins/services"
"github.com/containerd/plugin"
Expand Down
4 changes: 2 additions & 2 deletions plugins/services/events/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
api "github.com/containerd/containerd/v2/api/services/events/v1"
apittrpc "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/protobuf"
ptypes "github.com/containerd/containerd/v2/protobuf/types"
Expand Down
4 changes: 2 additions & 2 deletions plugins/services/events/ttrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (

api "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1"
"github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/events/exchange"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/events/exchange"
"github.com/containerd/containerd/v2/protobuf"
ptypes "github.com/containerd/containerd/v2/protobuf/types"
"github.com/containerd/errdefs"
Expand Down
2 changes: 1 addition & 1 deletion plugins/services/namespaces/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

eventstypes "github.com/containerd/containerd/v2/api/events"
api "github.com/containerd/containerd/v2/api/services/namespaces/v1"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/plugins/services"
Expand Down
2 changes: 1 addition & 1 deletion plugins/services/sandbox/controller_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

eventtypes "github.com/containerd/containerd/v2/api/events"
api "github.com/containerd/containerd/v2/api/services/sandbox/v1"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/sandbox"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/protobuf"
"github.com/containerd/errdefs"
Expand Down
2 changes: 1 addition & 1 deletion plugins/services/tasks/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import (
"github.com/containerd/containerd/v2/api/types/task"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/events"
"github.com/containerd/containerd/v2/core/images"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/containerd/v2/core/runtime"
"github.com/containerd/containerd/v2/core/runtime/v2/runc/options"
"github.com/containerd/containerd/v2/pkg/archive"
"github.com/containerd/containerd/v2/pkg/blockio"
"github.com/containerd/containerd/v2/pkg/events"
"github.com/containerd/containerd/v2/pkg/filters"
"github.com/containerd/containerd/v2/pkg/rdt"
"github.com/containerd/containerd/v2/pkg/timeout"
Expand Down

0 comments on commit 6333db7

Please sign in to comment.