From 7e6a0fcca828f0ffc5e0692104a74dbd9892e8f3 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 11 Sep 2023 21:16:16 -0700 Subject: [PATCH 1/3] Move to use github.com/containerd/log Signed-off-by: Derek McGowan --- archive/compression/compression.go | 2 +- archive/tar.go | 2 +- archive/tar_linux_test.go | 2 +- cio/io_windows.go | 2 +- cmd/containerd-stress/cri_worker.go | 2 +- cmd/containerd-stress/density.go | 2 +- cmd/containerd-stress/exec_worker.go | 2 +- cmd/containerd-stress/main.go | 2 +- cmd/containerd-stress/size.go | 2 +- cmd/containerd-stress/worker.go | 2 +- cmd/containerd/command/main.go | 2 +- cmd/containerd/command/main_unix.go | 2 +- cmd/containerd/command/main_windows.go | 2 +- cmd/containerd/command/notify_systemd.go | 2 +- cmd/ctr/app/main.go | 2 +- cmd/ctr/commands/client.go | 2 +- cmd/ctr/commands/containers/containers.go | 2 +- cmd/ctr/commands/containers/restore.go | 2 +- cmd/ctr/commands/content/content.go | 2 +- cmd/ctr/commands/content/fetch.go | 2 +- cmd/ctr/commands/content/prune.go | 2 +- cmd/ctr/commands/events/events.go | 2 +- cmd/ctr/commands/images/images.go | 2 +- cmd/ctr/commands/images/import.go | 2 +- cmd/ctr/commands/images/pull.go | 2 +- cmd/ctr/commands/images/push.go | 2 +- cmd/ctr/commands/namespaces/namespaces.go | 2 +- cmd/ctr/commands/resolver.go | 2 +- cmd/ctr/commands/run/run.go | 2 +- cmd/ctr/commands/run/run_unix.go | 2 +- cmd/ctr/commands/run/run_windows.go | 2 +- cmd/ctr/commands/sandboxes/sandboxes.go | 2 +- cmd/ctr/commands/shim/shim.go | 2 +- cmd/ctr/commands/signals.go | 2 +- cmd/ctr/commands/snapshots/snapshots.go | 2 +- cmd/ctr/commands/tasks/attach.go | 2 +- cmd/ctr/commands/tasks/delete.go | 2 +- cmd/ctr/commands/tasks/exec.go | 2 +- cmd/ctr/commands/tasks/kill.go | 2 +- cmd/ctr/commands/tasks/start.go | 2 +- cmd/ctr/commands/tasks/tasks_unix.go | 2 +- cmd/ctr/commands/tasks/tasks_windows.go | 2 +- content/helpers.go | 2 +- content/local/store.go | 2 +- content/local/writer.go | 2 +- content/testsuite/testsuite.go | 2 +- contrib/fuzz/archive_fuzzer.go | 2 +- diff/apply/apply.go | 2 +- diff/lcow/lcow.go | 2 +- diff/stream_windows.go | 2 +- diff/walking/differ.go | 2 +- diff/windows/windows.go | 2 +- events/exchange/exchange.go | 2 +- filters/filter.go | 2 +- gc/scheduler/scheduler.go | 2 +- images/archive/importer.go | 2 +- images/converter/default.go | 2 +- images/diffid.go | 2 +- images/image.go | 2 +- integration/build_local_containerd_helper_test.go | 2 +- integration/client/client.go | 2 +- integration/client/client_test.go | 2 +- integration/client/container_test.go | 2 +- integration/image_pull_timeout_test.go | 4 ++-- integration/images/image_list.go | 2 +- integration/main_test.go | 2 +- log/logtest/context.go | 2 +- metadata/containers_test.go | 2 +- metadata/content.go | 2 +- metadata/db.go | 2 +- metadata/db_test.go | 2 +- metadata/gc.go | 2 +- metadata/plugin/plugin.go | 2 +- metadata/snapshot.go | 2 +- metrics/cgroups/v1/cgroups.go | 2 +- metrics/cgroups/v1/metrics.go | 2 +- metrics/cgroups/v1/oom.go | 2 +- metrics/cgroups/v2/metrics.go | 2 +- mount/mount_windows.go | 2 +- mount/temp.go | 2 +- oci/spec_opts.go | 2 +- pkg/blockio/blockio_linux.go | 2 +- pkg/cri/config/config.go | 2 +- pkg/cri/cri.go | 2 +- pkg/cri/instrument/instrumented_service.go | 2 +- pkg/cri/io/container_io.go | 2 +- pkg/cri/io/exec_io.go | 2 +- pkg/cri/io/logger.go | 2 +- pkg/cri/nri/nri_api_linux.go | 2 +- pkg/cri/opts/container.go | 2 +- pkg/cri/opts/spec_linux.go | 2 +- pkg/cri/opts/spec_linux_opts.go | 2 +- pkg/cri/sbserver/blockio_linux.go | 2 +- pkg/cri/sbserver/cni_conf_syncer.go | 2 +- pkg/cri/sbserver/container_attach.go | 2 +- pkg/cri/sbserver/container_create.go | 2 +- pkg/cri/sbserver/container_execsync.go | 2 +- pkg/cri/sbserver/container_remove.go | 2 +- pkg/cri/sbserver/container_start.go | 2 +- pkg/cri/sbserver/container_stats_list.go | 2 +- pkg/cri/sbserver/container_stop.go | 2 +- pkg/cri/sbserver/container_update_resources.go | 2 +- pkg/cri/sbserver/events.go | 2 +- pkg/cri/sbserver/helpers.go | 2 +- pkg/cri/sbserver/helpers_linux.go | 2 +- pkg/cri/sbserver/images/image_pull.go | 2 +- pkg/cri/sbserver/images/image_status.go | 2 +- pkg/cri/sbserver/images/service.go | 2 +- pkg/cri/sbserver/images/snapshots.go | 2 +- pkg/cri/sbserver/podsandbox/controller.go | 2 +- pkg/cri/sbserver/podsandbox/helpers.go | 2 +- pkg/cri/sbserver/podsandbox/helpers_linux.go | 2 +- pkg/cri/sbserver/podsandbox/opts.go | 2 +- pkg/cri/sbserver/podsandbox/recover.go | 2 +- pkg/cri/sbserver/podsandbox/sandbox_delete.go | 2 +- pkg/cri/sbserver/podsandbox/sandbox_run.go | 2 +- pkg/cri/sbserver/podsandbox/sandbox_stop.go | 2 +- pkg/cri/sbserver/rdt.go | 2 +- pkg/cri/sbserver/restart.go | 2 +- pkg/cri/sbserver/runtime_config_linux.go | 2 +- pkg/cri/sbserver/sandbox_portforward_linux.go | 2 +- pkg/cri/sbserver/sandbox_remove.go | 2 +- pkg/cri/sbserver/sandbox_run.go | 2 +- pkg/cri/sbserver/sandbox_stats_linux.go | 2 +- pkg/cri/sbserver/sandbox_stats_list.go | 2 +- pkg/cri/sbserver/sandbox_stats_windows.go | 2 +- pkg/cri/sbserver/sandbox_stop.go | 2 +- pkg/cri/sbserver/service.go | 2 +- pkg/cri/sbserver/service_linux.go | 2 +- pkg/cri/sbserver/status.go | 2 +- pkg/cri/sbserver/update_runtime_config.go | 2 +- pkg/cri/server/blockio_linux.go | 2 +- pkg/cri/server/cni_conf_syncer.go | 2 +- pkg/cri/server/container_attach.go | 2 +- pkg/cri/server/container_create.go | 2 +- pkg/cri/server/container_execsync.go | 2 +- pkg/cri/server/container_remove.go | 2 +- pkg/cri/server/container_start.go | 2 +- pkg/cri/server/container_stop.go | 2 +- pkg/cri/server/container_update_resources.go | 2 +- pkg/cri/server/events.go | 2 +- pkg/cri/server/helpers.go | 2 +- pkg/cri/server/helpers_linux.go | 2 +- pkg/cri/server/image_pull.go | 2 +- pkg/cri/server/image_status.go | 2 +- pkg/cri/server/rdt_linux.go | 2 +- pkg/cri/server/restart.go | 2 +- pkg/cri/server/runtime_config_linux.go | 2 +- pkg/cri/server/sandbox_portforward_linux.go | 2 +- pkg/cri/server/sandbox_remove.go | 2 +- pkg/cri/server/sandbox_run.go | 2 +- pkg/cri/server/sandbox_stats_linux.go | 2 +- pkg/cri/server/sandbox_stats_list.go | 2 +- pkg/cri/server/sandbox_stats_windows.go | 2 +- pkg/cri/server/sandbox_stop.go | 2 +- pkg/cri/server/service.go | 2 +- pkg/cri/server/service_linux.go | 2 +- pkg/cri/server/snapshots.go | 2 +- pkg/cri/server/status.go | 2 +- pkg/cri/server/update_runtime_config.go | 2 +- pkg/epoch/epoch.go | 2 +- pkg/nri/domain.go | 2 +- pkg/nri/nri.go | 2 +- pkg/oom/v1/v1.go | 2 +- pkg/oom/v2/v2.go | 2 +- pkg/process/init.go | 2 +- pkg/process/init_state.go | 2 +- pkg/process/io.go | 2 +- pkg/rdt/rdt_linux.go | 2 +- pkg/snapshotters/annotations.go | 2 +- pkg/transfer/archive/exporter.go | 2 +- pkg/transfer/archive/importer.go | 2 +- pkg/transfer/local/import.go | 2 +- pkg/transfer/local/progress.go | 2 +- pkg/transfer/local/pull.go | 2 +- pkg/transfer/proxy/transfer.go | 2 +- pkg/transfer/registry/registry.go | 2 +- pkg/transfer/streaming/stream.go | 2 +- pkg/transfer/streaming/writer.go | 2 +- pkg/unpack/unpacker.go | 2 +- platforms/cpuinfo.go | 2 +- plugins/sandbox/controller.go | 2 +- plugins/transfer/plugin.go | 2 +- remotes/docker/auth/fetch.go | 2 +- remotes/docker/authorizer.go | 2 +- remotes/docker/config/hosts.go | 2 +- remotes/docker/config/hosts_test.go | 2 +- remotes/docker/converter.go | 2 +- remotes/docker/converter_fuzz.go | 2 +- remotes/docker/fetcher.go | 2 +- remotes/docker/handler.go | 2 +- remotes/docker/httpreadseeker.go | 2 +- remotes/docker/pusher.go | 2 +- remotes/docker/resolver.go | 2 +- remotes/docker/schema1/converter.go | 2 +- remotes/handlers.go | 2 +- rootfs/apply.go | 2 +- rootfs/init.go | 2 +- runtime/events.go | 2 +- runtime/restart/monitor/monitor.go | 2 +- runtime/restart/restart.go | 2 +- runtime/v2/binary.go | 2 +- runtime/v2/manager.go | 2 +- runtime/v2/runc/container.go | 2 +- runtime/v2/runc/manager/manager_linux.go | 2 +- runtime/v2/runc/pause/sandbox.go | 2 +- runtime/v2/runc/task/service.go | 2 +- runtime/v2/runc/util.go | 2 +- runtime/v2/shim.go | 2 +- runtime/v2/shim/publisher.go | 2 +- runtime/v2/shim/shim.go | 2 +- runtime/v2/shim/shim_unix.go | 2 +- runtime/v2/shim_load.go | 2 +- services/content/contentserver/contentserver.go | 2 +- services/images/local.go | 2 +- services/introspection/introspection.go | 2 +- services/sandbox/controller_service.go | 2 +- services/sandbox/store_service.go | 2 +- services/server/server.go | 2 +- services/server/server_linux.go | 2 +- services/snapshots/service.go | 2 +- services/streaming/service.go | 2 +- services/tasks/local.go | 2 +- services/transfer/service.go | 2 +- snapshots/benchsuite/benchmark_test.go | 2 +- snapshots/blockfile/blockfile.go | 2 +- snapshots/btrfs/btrfs.go | 2 +- snapshots/devmapper/pool_device.go | 2 +- snapshots/devmapper/pool_device_test.go | 2 +- snapshots/devmapper/snapshotter.go | 2 +- snapshots/devmapper/snapshotter_test.go | 2 +- snapshots/lcow/lcow.go | 2 +- snapshots/native/native.go | 2 +- snapshots/overlay/overlay.go | 2 +- snapshots/overlay/overlayutils/check.go | 2 +- snapshots/storage/metastore.go | 2 +- snapshots/testsuite/testsuite.go | 2 +- snapshots/windows/windows.go | 2 +- tracing/plugin/otlp.go | 2 +- 239 files changed, 240 insertions(+), 240 deletions(-) diff --git a/archive/compression/compression.go b/archive/compression/compression.go index 06bc94d032611..fda32e0e48538 100644 --- a/archive/compression/compression.go +++ b/archive/compression/compression.go @@ -28,7 +28,7 @@ import ( "strconv" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/klauspost/compress/zstd" exec "golang.org/x/sys/execabs" ) diff --git a/archive/tar.go b/archive/tar.go index a807f8205b40d..bf189f53c2f07 100644 --- a/archive/tar.go +++ b/archive/tar.go @@ -30,10 +30,10 @@ import ( "time" "github.com/containerd/containerd/archive/tarheader" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/epoch" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ) var bufPool = &sync.Pool{ diff --git a/archive/tar_linux_test.go b/archive/tar_linux_test.go index bfe056f0030c8..ffe83653903bd 100644 --- a/archive/tar_linux_test.go +++ b/archive/tar_linux_test.go @@ -25,12 +25,12 @@ import ( "strings" "testing" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/snapshots/overlay/overlayutils" "github.com/containerd/continuity/fs" "github.com/containerd/continuity/fs/fstest" + "github.com/containerd/log/logtest" ) func TestOverlayApply(t *testing.T) { diff --git a/cio/io_windows.go b/cio/io_windows.go index f3d736a6d42f1..59b14c42ffc53 100644 --- a/cio/io_windows.go +++ b/cio/io_windows.go @@ -22,7 +22,7 @@ import ( "io" winio "github.com/Microsoft/go-winio" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) const pipeRoot = `\\.\pipe` diff --git a/cmd/containerd-stress/cri_worker.go b/cmd/containerd-stress/cri_worker.go index 99c5fbeac2242..bf8cb73b70c6b 100644 --- a/cmd/containerd-stress/cri_worker.go +++ b/cmd/containerd-stress/cri_worker.go @@ -24,8 +24,8 @@ import ( "time" internalapi "github.com/containerd/containerd/integration/cri-api/pkg/apis" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/util" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/cmd/containerd-stress/density.go b/cmd/containerd-stress/density.go index 757b0247117cb..1dc877891e805 100644 --- a/cmd/containerd-stress/density.go +++ b/cmd/containerd-stress/density.go @@ -31,9 +31,9 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/oci" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/containerd-stress/exec_worker.go b/cmd/containerd-stress/exec_worker.go index 0980b14c017d6..4acda4dd593d8 100644 --- a/cmd/containerd-stress/exec_worker.go +++ b/cmd/containerd-stress/exec_worker.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" specs "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/cmd/containerd-stress/main.go b/cmd/containerd-stress/main.go index e8ae9c8db947a..731e5eaede342 100644 --- a/cmd/containerd-stress/main.go +++ b/cmd/containerd-stress/main.go @@ -30,9 +30,9 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/integration/remote" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/plugin" + "github.com/containerd/log" metrics "github.com/docker/go-metrics" "github.com/urfave/cli" ) diff --git a/cmd/containerd-stress/size.go b/cmd/containerd-stress/size.go index 02908a8640a18..113ba6aa4a77d 100644 --- a/cmd/containerd-stress/size.go +++ b/cmd/containerd-stress/size.go @@ -19,7 +19,7 @@ package main import ( "os" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) const defaultPath = "/usr/local/bin/" diff --git a/cmd/containerd-stress/worker.go b/cmd/containerd-stress/worker.go index d8bf742b9870a..d6c5613de8fde 100644 --- a/cmd/containerd-stress/worker.go +++ b/cmd/containerd-stress/worker.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" ) type ctrWorker struct { diff --git a/cmd/containerd/command/main.go b/cmd/containerd/command/main.go index 3b8e9739ee78c..93f3a9a9d3838 100644 --- a/cmd/containerd/command/main.go +++ b/cmd/containerd/command/main.go @@ -29,13 +29,13 @@ import ( "github.com/containerd/containerd/defaults" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" _ "github.com/containerd/containerd/metrics" // import containerd build info "github.com/containerd/containerd/mount" "github.com/containerd/containerd/services/server" srvconfig "github.com/containerd/containerd/services/server/config" "github.com/containerd/containerd/sys" "github.com/containerd/containerd/version" + "github.com/containerd/log" "github.com/urfave/cli" "google.golang.org/grpc/grpclog" ) diff --git a/cmd/containerd/command/main_unix.go b/cmd/containerd/command/main_unix.go index 927865a8d2191..ba52f837388b2 100644 --- a/cmd/containerd/command/main_unix.go +++ b/cmd/containerd/command/main_unix.go @@ -23,8 +23,8 @@ import ( "os" "path/filepath" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/services/server" + "github.com/containerd/log" "golang.org/x/sys/unix" ) diff --git a/cmd/containerd/command/main_windows.go b/cmd/containerd/command/main_windows.go index 182f4c0073104..94e33b5bcbd0c 100644 --- a/cmd/containerd/command/main_windows.go +++ b/cmd/containerd/command/main_windows.go @@ -26,8 +26,8 @@ import ( "github.com/Microsoft/go-winio/pkg/etw" "github.com/Microsoft/go-winio/pkg/etwlogrus" "github.com/Microsoft/go-winio/pkg/guid" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/services/server" + "github.com/containerd/log" "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/cmd/containerd/command/notify_systemd.go b/cmd/containerd/command/notify_systemd.go index 101db5f72fd81..6dc1ca3f96e61 100644 --- a/cmd/containerd/command/notify_systemd.go +++ b/cmd/containerd/command/notify_systemd.go @@ -23,7 +23,7 @@ import ( sd "github.com/coreos/go-systemd/v22/daemon" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // notifyReady notifies systemd that the daemon is ready to serve requests diff --git a/cmd/ctr/app/main.go b/cmd/ctr/app/main.go index e97a9f2966c5b..0a740dd1ba9c3 100644 --- a/cmd/ctr/app/main.go +++ b/cmd/ctr/app/main.go @@ -37,9 +37,9 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands/tasks" versionCmd "github.com/containerd/containerd/cmd/ctr/commands/version" "github.com/containerd/containerd/defaults" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/version" + "github.com/containerd/log" "github.com/urfave/cli" "google.golang.org/grpc/grpclog" ) diff --git a/cmd/ctr/commands/client.go b/cmd/ctr/commands/client.go index 24639483af9f9..4e944dc875d4d 100644 --- a/cmd/ctr/commands/client.go +++ b/cmd/ctr/commands/client.go @@ -20,9 +20,9 @@ import ( gocontext "context" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/epoch" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/containers/containers.go b/cmd/ctr/commands/containers/containers.go index 046c72a602e99..5ad88840dabe8 100644 --- a/cmd/ctr/commands/containers/containers.go +++ b/cmd/ctr/commands/containers/containers.go @@ -29,7 +29,7 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands/run" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/containers/restore.go b/cmd/ctr/commands/containers/restore.go index e3c011dd77fc6..a1943f5646c0e 100644 --- a/cmd/ctr/commands/containers/restore.go +++ b/cmd/ctr/commands/containers/restore.go @@ -25,7 +25,7 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands/tasks" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/content/content.go b/cmd/ctr/commands/content/content.go index 277eda3422a30..d6ce35b0ef0bd 100644 --- a/cmd/ctr/commands/content/content.go +++ b/cmd/ctr/commands/content/content.go @@ -29,8 +29,8 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" units "github.com/docker/go-units" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cmd/ctr/commands/content/fetch.go b/cmd/ctr/commands/content/fetch.go index d7ccb7ffa64b1..90246361ffc1f 100644 --- a/cmd/ctr/commands/content/fetch.go +++ b/cmd/ctr/commands/content/fetch.go @@ -31,10 +31,10 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/progress" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/content/prune.go b/cmd/ctr/commands/content/prune.go index 6c55a54e09f24..f585330bc42aa 100644 --- a/cmd/ctr/commands/content/prune.go +++ b/cmd/ctr/commands/content/prune.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/content" "github.com/containerd/containerd/leases" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/events/events.go b/cmd/ctr/commands/events/events.go index a4247e0555145..c2ca925f5aaf4 100644 --- a/cmd/ctr/commands/events/events.go +++ b/cmd/ctr/commands/events/events.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/images/images.go b/cmd/ctr/commands/images/images.go index 2856c78987a1d..3722bf470b8cf 100644 --- a/cmd/ctr/commands/images/images.go +++ b/cmd/ctr/commands/images/images.go @@ -27,9 +27,9 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/progress" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/images/import.go b/cmd/ctr/commands/images/import.go index 2e3f3a6c3aa51..1bfd3d9a840e3 100644 --- a/cmd/ctr/commands/images/import.go +++ b/cmd/ctr/commands/images/import.go @@ -28,11 +28,11 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/images/archive" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/transfer" tarchive "github.com/containerd/containerd/pkg/transfer/archive" "github.com/containerd/containerd/pkg/transfer/image" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" ) var importCommand = cli.Command{ diff --git a/cmd/ctr/commands/images/pull.go b/cmd/ctr/commands/images/pull.go index 09b35d702c453..c77549764cbc7 100644 --- a/cmd/ctr/commands/images/pull.go +++ b/cmd/ctr/commands/images/pull.go @@ -28,12 +28,12 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/progress" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer/image" "github.com/containerd/containerd/pkg/transfer/registry" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/images/push.go b/cmd/ctr/commands/images/push.go index 0d6030dafe979..464a33527b140 100644 --- a/cmd/ctr/commands/images/push.go +++ b/cmd/ctr/commands/images/push.go @@ -30,7 +30,6 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/progress" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer/image" @@ -38,6 +37,7 @@ import ( "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/namespaces/namespaces.go b/cmd/ctr/commands/namespaces/namespaces.go index 745249c214c0c..d2bb3b0a95653 100644 --- a/cmd/ctr/commands/namespaces/namespaces.go +++ b/cmd/ctr/commands/namespaces/namespaces.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/resolver.go b/cmd/ctr/commands/resolver.go index 2c12acff592f9..c2bae2d2e0f64 100644 --- a/cmd/ctr/commands/resolver.go +++ b/cmd/ctr/commands/resolver.go @@ -31,11 +31,11 @@ import ( "strings" "github.com/containerd/console" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/transfer/registry" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/config" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/run/run.go b/cmd/ctr/commands/run/run.go index 552ff5223a7a2..77c07bce414a0 100644 --- a/cmd/ctr/commands/run/run.go +++ b/cmd/ctr/commands/run/run.go @@ -35,8 +35,8 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" clabels "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" ) func withMounts(context *cli.Context) oci.SpecOpts { diff --git a/cmd/ctr/commands/run/run_unix.go b/cmd/ctr/commands/run/run_unix.go index 29f3c90432f02..87b56482dc2fd 100644 --- a/cmd/ctr/commands/run/run_unix.go +++ b/cmd/ctr/commands/run/run_unix.go @@ -36,12 +36,12 @@ import ( "github.com/containerd/containerd/contrib/apparmor" "github.com/containerd/containerd/contrib/nvidia" "github.com/containerd/containerd/contrib/seccomp" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" runtimeoptions "github.com/containerd/containerd/pkg/runtimeoptions/v1" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" "github.com/intel/goresctrl/pkg/blockio" "github.com/opencontainers/runtime-spec/specs-go" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/run/run_windows.go b/cmd/ctr/commands/run/run_windows.go index b6a8a96dc4ec9..fc3b939d6e476 100644 --- a/cmd/ctr/commands/run/run_windows.go +++ b/cmd/ctr/commands/run/run_windows.go @@ -25,10 +25,10 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/pkg/netns" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/sandboxes/sandboxes.go b/cmd/ctr/commands/sandboxes/sandboxes.go index ab9350d15ef41..5d710ecad4ae0 100644 --- a/cmd/ctr/commands/sandboxes/sandboxes.go +++ b/cmd/ctr/commands/sandboxes/sandboxes.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/defaults" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/shim/shim.go b/cmd/ctr/commands/shim/shim.go index a49007650dd39..56a6496ec2277 100644 --- a/cmd/ctr/commands/shim/shim.go +++ b/cmd/ctr/commands/shim/shim.go @@ -30,10 +30,10 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd/api/runtime/task/v2" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/log" "github.com/containerd/ttrpc" "github.com/containerd/typeurl/v2" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/cmd/ctr/commands/signals.go b/cmd/ctr/commands/signals.go index 4a8e165d2c529..28d976ff6435d 100644 --- a/cmd/ctr/commands/signals.go +++ b/cmd/ctr/commands/signals.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) type killer interface { diff --git a/cmd/ctr/commands/snapshots/snapshots.go b/cmd/ctr/commands/snapshots/snapshots.go index c8ace2d5b7975..58bddaeac9301 100644 --- a/cmd/ctr/commands/snapshots/snapshots.go +++ b/cmd/ctr/commands/snapshots/snapshots.go @@ -31,11 +31,11 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/progress" "github.com/containerd/containerd/rootfs" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/tasks/attach.go b/cmd/ctr/commands/tasks/attach.go index 634419ec22c00..20fdf05120822 100644 --- a/cmd/ctr/commands/tasks/attach.go +++ b/cmd/ctr/commands/tasks/attach.go @@ -20,7 +20,7 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/delete.go b/cmd/ctr/commands/tasks/delete.go index 027da1db043bc..5369f621758c1 100644 --- a/cmd/ctr/commands/tasks/delete.go +++ b/cmd/ctr/commands/tasks/delete.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/exec.go b/cmd/ctr/commands/tasks/exec.go index a7c1fb5ef89d3..5ed9c3c17a140 100644 --- a/cmd/ctr/commands/tasks/exec.go +++ b/cmd/ctr/commands/tasks/exec.go @@ -26,8 +26,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/kill.go b/cmd/ctr/commands/tasks/kill.go index 52211b65d89c7..e22b7ca646b37 100644 --- a/cmd/ctr/commands/tasks/kill.go +++ b/cmd/ctr/commands/tasks/kill.go @@ -23,8 +23,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/containerd/containerd/log" gocni "github.com/containerd/go-cni" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/moby/sys/signal" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/tasks/start.go b/cmd/ctr/commands/tasks/start.go index 54681c01ad8c8..bedeb473b5749 100644 --- a/cmd/ctr/commands/tasks/start.go +++ b/cmd/ctr/commands/tasks/start.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/cio" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/tasks_unix.go b/cmd/ctr/commands/tasks/tasks_unix.go index e58d23142411d..a46f878fd9a6f 100644 --- a/cmd/ctr/commands/tasks/tasks_unix.go +++ b/cmd/ctr/commands/tasks/tasks_unix.go @@ -28,7 +28,7 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" "golang.org/x/sys/unix" ) diff --git a/cmd/ctr/commands/tasks/tasks_windows.go b/cmd/ctr/commands/tasks/tasks_windows.go index a202b14f7918a..4a804d86929b9 100644 --- a/cmd/ctr/commands/tasks/tasks_windows.go +++ b/cmd/ctr/commands/tasks/tasks_windows.go @@ -25,7 +25,7 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/content/helpers.go b/content/helpers.go index 0161c8debf557..b5f25e1a7fa09 100644 --- a/content/helpers.go +++ b/content/helpers.go @@ -25,8 +25,8 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/randutil" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/content/local/store.go b/content/local/store.go index 5eb98e3650cad..62a3c7ec1b681 100644 --- a/content/local/store.go +++ b/content/local/store.go @@ -30,7 +30,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/content/local/writer.go b/content/local/writer.go index b187e524cb71a..f4ac2064b989f 100644 --- a/content/local/writer.go +++ b/content/local/writer.go @@ -28,7 +28,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ) diff --git a/content/testsuite/testsuite.go b/content/testsuite/testsuite.go index e5ca5779796de..4c4f6b2e5ea75 100644 --- a/content/testsuite/testsuite.go +++ b/content/testsuite/testsuite.go @@ -30,8 +30,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/pkg/testutil" + "github.com/containerd/log/logtest" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" diff --git a/contrib/fuzz/archive_fuzzer.go b/contrib/fuzz/archive_fuzzer.go index ba9ff008a2e29..5af3145848722 100644 --- a/contrib/fuzz/archive_fuzzer.go +++ b/contrib/fuzz/archive_fuzzer.go @@ -28,7 +28,7 @@ import ( "github.com/containerd/containerd/archive" "github.com/containerd/containerd/content/local" imageArchive "github.com/containerd/containerd/images/archive" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/diff/apply/apply.go b/diff/apply/apply.go index 8e7a8bdaac1a9..6f4754a31572e 100644 --- a/diff/apply/apply.go +++ b/diff/apply/apply.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/diff/lcow/lcow.go b/diff/lcow/lcow.go index 5ab63935854bf..afa5217d7e027 100644 --- a/diff/lcow/lcow.go +++ b/diff/lcow/lcow.go @@ -33,10 +33,10 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/plugin" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/diff/stream_windows.go b/diff/stream_windows.go index dc9a0caf16278..d43a9708dd849 100644 --- a/diff/stream_windows.go +++ b/diff/stream_windows.go @@ -29,9 +29,9 @@ import ( "github.com/Microsoft/go-winio" exec "golang.org/x/sys/execabs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf/proto" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/diff/walking/differ.go b/diff/walking/differ.go index 34a5797e74d5b..7dfb5d5713144 100644 --- a/diff/walking/differ.go +++ b/diff/walking/differ.go @@ -31,9 +31,9 @@ import ( "github.com/containerd/containerd/diff" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/epoch" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/diff/windows/windows.go b/diff/windows/windows.go index 2cfdfd71a1d29..2669c955bc4e9 100644 --- a/diff/windows/windows.go +++ b/diff/windows/windows.go @@ -34,12 +34,12 @@ import ( "github.com/containerd/containerd/diff" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/epoch" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/events/exchange/exchange.go b/events/exchange/exchange.go index e18377c11ae6d..e1a5a33fa914c 100644 --- a/events/exchange/exchange.go +++ b/events/exchange/exchange.go @@ -26,8 +26,8 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/identifiers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" goevents "github.com/docker/go-events" ) diff --git a/filters/filter.go b/filters/filter.go index e13f2625c7318..dcc569a4b7d2a 100644 --- a/filters/filter.go +++ b/filters/filter.go @@ -70,7 +70,7 @@ package filters import ( "regexp" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // Filter matches specific resources based the provided filter diff --git a/gc/scheduler/scheduler.go b/gc/scheduler/scheduler.go index 4a72906a49862..51656c09b3d31 100644 --- a/gc/scheduler/scheduler.go +++ b/gc/scheduler/scheduler.go @@ -24,8 +24,8 @@ import ( "time" "github.com/containerd/containerd/gc" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" + "github.com/containerd/log" ) // config configures the garbage collection policies. diff --git a/images/archive/importer.go b/images/archive/importer.go index 3ca88091cfdd6..22a621814ba2a 100644 --- a/images/archive/importer.go +++ b/images/archive/importer.go @@ -32,8 +32,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/images/converter/default.go b/images/converter/default.go index e44f856ba5d14..1b3a555839f29 100644 --- a/images/converter/default.go +++ b/images/converter/default.go @@ -26,8 +26,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/errgroup" diff --git a/images/diffid.go b/images/diffid.go index c031f8e363775..3f873e4933d1b 100644 --- a/images/diffid.go +++ b/images/diffid.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/content" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // GetDiffID gets the diff ID of the layer blob descriptor. diff --git a/images/image.go b/images/image.go index 6acb933086c0f..cba7bc13ea7bd 100644 --- a/images/image.go +++ b/images/image.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/integration/build_local_containerd_helper_test.go b/integration/build_local_containerd_helper_test.go index 490c2d64596bc..b8f257862ea71 100644 --- a/integration/build_local_containerd_helper_test.go +++ b/integration/build_local_containerd_helper_test.go @@ -23,12 +23,12 @@ import ( "testing" "github.com/containerd/containerd" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/pkg/cri/constants" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" ctrdsrv "github.com/containerd/containerd/services/server" srvconfig "github.com/containerd/containerd/services/server/config" + "github.com/containerd/log/logtest" _ "github.com/containerd/containerd/diff/walking/plugin" _ "github.com/containerd/containerd/events/plugin" diff --git a/integration/client/client.go b/integration/client/client.go index 4cb51534d7c04..c72294efcf218 100644 --- a/integration/client/client.go +++ b/integration/client/client.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/defaults" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" + "github.com/containerd/log/logtest" ) const ( diff --git a/integration/client/client_test.go b/integration/client/client_test.go index 9b6f7068c68b7..aec37b0ea7237 100644 --- a/integration/client/client_test.go +++ b/integration/client/client_test.go @@ -38,10 +38,10 @@ import ( "github.com/containerd/containerd/images" imagelist "github.com/containerd/containerd/integration/images" "github.com/containerd/containerd/leases" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" ) var ( diff --git a/integration/client/container_test.go b/integration/client/container_test.go index 22954ec5cdf3f..5b4d16b4dcd7b 100644 --- a/integration/client/container_test.go +++ b/integration/client/container_test.go @@ -36,7 +36,6 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/platforms" @@ -46,6 +45,7 @@ import ( "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/continuity/fs" "github.com/containerd/go-runc" + "github.com/containerd/log/logtest" "github.com/containerd/typeurl/v2" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/stretchr/testify/require" diff --git a/integration/image_pull_timeout_test.go b/integration/image_pull_timeout_test.go index 05ab6cc72928e..9f26d62d12892 100644 --- a/integration/image_pull_timeout_test.go +++ b/integration/image_pull_timeout_test.go @@ -36,11 +36,11 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/content" "github.com/containerd/containerd/leases" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" criconfig "github.com/containerd/containerd/pkg/cri/config" criserver "github.com/containerd/containerd/pkg/cri/server" + "github.com/containerd/log" + "github.com/containerd/log/logtest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/integration/images/image_list.go b/integration/images/image_list.go index 684d683e9c510..2de08944950f8 100644 --- a/integration/images/image_list.go +++ b/integration/images/image_list.go @@ -22,7 +22,7 @@ import ( "os" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/pelletier/go-toml" ) diff --git a/integration/main_test.go b/integration/main_test.go index 24f6ac93b033b..6c40278ad979a 100644 --- a/integration/main_test.go +++ b/integration/main_test.go @@ -39,11 +39,11 @@ import ( _ "github.com/containerd/containerd/integration/images" // Keep this around to parse `imageListFile` command line var "github.com/containerd/containerd/integration/remote" dialer "github.com/containerd/containerd/integration/remote/util" - "github.com/containerd/containerd/log" criconfig "github.com/containerd/containerd/pkg/cri/config" "github.com/containerd/containerd/pkg/cri/constants" "github.com/containerd/containerd/pkg/cri/server" "github.com/containerd/containerd/pkg/cri/util" + "github.com/containerd/log" "github.com/opencontainers/selinux/go-selinux" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/log/logtest/context.go b/log/logtest/context.go index 305bd80803566..cbf3882f1b6a0 100644 --- a/log/logtest/context.go +++ b/log/logtest/context.go @@ -24,7 +24,7 @@ import ( "runtime" "testing" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/sirupsen/logrus" ) diff --git a/metadata/containers_test.go b/metadata/containers_test.go index efcedae1ea34b..7067b4f20bacf 100644 --- a/metadata/containers_test.go +++ b/metadata/containers_test.go @@ -28,10 +28,10 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/log/logtest" "github.com/containerd/typeurl/v2" "github.com/google/go-cmp/cmp" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/metadata/content.go b/metadata/content.go index 8e21663943119..2126feaa6fe21 100644 --- a/metadata/content.go +++ b/metadata/content.go @@ -29,9 +29,9 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" diff --git a/metadata/db.go b/metadata/db.go index 8241930a96854..baff3a9f933f6 100644 --- a/metadata/db.go +++ b/metadata/db.go @@ -30,10 +30,10 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/events" "github.com/containerd/containerd/gc" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/cleanup" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/metadata/db_test.go b/metadata/db_test.go index fd0b12aad58d5..09c9764347588 100644 --- a/metadata/db_test.go +++ b/metadata/db_test.go @@ -36,11 +36,11 @@ import ( "github.com/containerd/containerd/gc" "github.com/containerd/containerd/images" "github.com/containerd/containerd/leases" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/native" + "github.com/containerd/log/logtest" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" diff --git a/metadata/gc.go b/metadata/gc.go index 0cfbd5b3348b0..2e1bc38a0a22b 100644 --- a/metadata/gc.go +++ b/metadata/gc.go @@ -26,7 +26,7 @@ import ( eventstypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/gc" - "github.com/containerd/containerd/log" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/metadata/plugin/plugin.go b/metadata/plugin/plugin.go index 0dee5cb842fd5..02c56806c2ed1 100644 --- a/metadata/plugin/plugin.go +++ b/metadata/plugin/plugin.go @@ -25,11 +25,11 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/metadata/snapshot.go b/metadata/snapshot.go index e7774d36ec8f2..3288040899eab 100644 --- a/metadata/snapshot.go +++ b/metadata/snapshot.go @@ -28,11 +28,11 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/metrics/cgroups/v1/cgroups.go b/metrics/cgroups/v1/cgroups.go index 0cc3e97870eeb..fa74e9a469bd9 100644 --- a/metrics/cgroups/v1/cgroups.go +++ b/metrics/cgroups/v1/cgroups.go @@ -25,9 +25,9 @@ import ( eventstypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/runtime" + "github.com/containerd/log" "github.com/docker/go-metrics" ) diff --git a/metrics/cgroups/v1/metrics.go b/metrics/cgroups/v1/metrics.go index 749dba1175c41..2da46f9db7d89 100644 --- a/metrics/cgroups/v1/metrics.go +++ b/metrics/cgroups/v1/metrics.go @@ -24,12 +24,12 @@ import ( "sync" cgroups "github.com/containerd/cgroups/v3/cgroup1" - "github.com/containerd/containerd/log" cmetrics "github.com/containerd/containerd/metrics" "github.com/containerd/containerd/metrics/cgroups/common" v1 "github.com/containerd/containerd/metrics/types/v1" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/timeout" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/docker/go-metrics" "github.com/prometheus/client_golang/prometheus" diff --git a/metrics/cgroups/v1/oom.go b/metrics/cgroups/v1/oom.go index 7d33502023deb..8660c61b5ff1a 100644 --- a/metrics/cgroups/v1/oom.go +++ b/metrics/cgroups/v1/oom.go @@ -25,7 +25,7 @@ import ( "golang.org/x/sys/unix" cgroups "github.com/containerd/cgroups/v3/cgroup1" - "github.com/containerd/containerd/log" + "github.com/containerd/log" metrics "github.com/docker/go-metrics" "github.com/prometheus/client_golang/prometheus" ) diff --git a/metrics/cgroups/v2/metrics.go b/metrics/cgroups/v2/metrics.go index 00f5f40bc7bd7..49a3c3b69d6a5 100644 --- a/metrics/cgroups/v2/metrics.go +++ b/metrics/cgroups/v2/metrics.go @@ -23,12 +23,12 @@ import ( "fmt" "sync" - "github.com/containerd/containerd/log" cmetrics "github.com/containerd/containerd/metrics" "github.com/containerd/containerd/metrics/cgroups/common" v2 "github.com/containerd/containerd/metrics/types/v2" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/timeout" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/docker/go-metrics" "github.com/prometheus/client_golang/prometheus" diff --git a/mount/mount_windows.go b/mount/mount_windows.go index 7c24fa600c831..91ac6968d2f7a 100644 --- a/mount/mount_windows.go +++ b/mount/mount_windows.go @@ -27,7 +27,7 @@ import ( "github.com/Microsoft/go-winio/pkg/bindfilter" "github.com/Microsoft/hcsshim" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "golang.org/x/sys/windows" ) diff --git a/mount/temp.go b/mount/temp.go index 83143521abbf8..7849d0609aac8 100644 --- a/mount/temp.go +++ b/mount/temp.go @@ -21,7 +21,7 @@ import ( "fmt" "os" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) var tempMountLocation = getTempDir() diff --git a/oci/spec_opts.go b/oci/spec_opts.go index 55ccaf09a08e4..8509891a6f8b4 100644 --- a/oci/spec_opts.go +++ b/oci/spec_opts.go @@ -32,11 +32,11 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/platforms" "github.com/containerd/continuity/fs" + "github.com/containerd/log" v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/runc/libcontainer/user" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/blockio/blockio_linux.go b/pkg/blockio/blockio_linux.go index c18e3bb1181d4..4fca593db3cf4 100644 --- a/pkg/blockio/blockio_linux.go +++ b/pkg/blockio/blockio_linux.go @@ -25,7 +25,7 @@ import ( "github.com/intel/goresctrl/pkg/blockio" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) var ( diff --git a/pkg/cri/config/config.go b/pkg/cri/config/config.go index 719812242fdef..84b02afbd9771 100644 --- a/pkg/cri/config/config.go +++ b/pkg/cri/config/config.go @@ -23,7 +23,7 @@ import ( "net/url" "time" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) type SandboxControllerMode string diff --git a/pkg/cri/cri.go b/pkg/cri/cri.go index 2eaa28d0edbf8..4597b37a8776d 100644 --- a/pkg/cri/cri.go +++ b/pkg/cri/cri.go @@ -23,12 +23,12 @@ import ( "path/filepath" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/nri" "github.com/containerd/containerd/pkg/cri/sbserver" nriservice "github.com/containerd/containerd/pkg/nri" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" + "github.com/containerd/log" imagespec "github.com/opencontainers/image-spec/specs-go/v1" "k8s.io/klog/v2" diff --git a/pkg/cri/instrument/instrumented_service.go b/pkg/cri/instrument/instrumented_service.go index f8a77d420964e..98bcab97afe3d 100644 --- a/pkg/cri/instrument/instrumented_service.go +++ b/pkg/cri/instrument/instrumented_service.go @@ -21,8 +21,8 @@ import ( "errors" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ctrdutil "github.com/containerd/containerd/pkg/cri/util" diff --git a/pkg/cri/io/container_io.go b/pkg/cri/io/container_io.go index ea7a358913538..f6fc3b0b9eeb9 100644 --- a/pkg/cri/io/container_io.go +++ b/pkg/cri/io/container_io.go @@ -23,7 +23,7 @@ import ( "sync" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containerd/containerd/pkg/cri/util" cioutil "github.com/containerd/containerd/pkg/ioutil" diff --git a/pkg/cri/io/exec_io.go b/pkg/cri/io/exec_io.go index 70fb9812014cb..f5baf1f4fdd7d 100644 --- a/pkg/cri/io/exec_io.go +++ b/pkg/cri/io/exec_io.go @@ -21,8 +21,8 @@ import ( "sync" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/log" cioutil "github.com/containerd/containerd/pkg/ioutil" + "github.com/containerd/log" ) // ExecIO holds the exec io. diff --git a/pkg/cri/io/logger.go b/pkg/cri/io/logger.go index 69b55da4b5230..75bac2beaa1f4 100644 --- a/pkg/cri/io/logger.go +++ b/pkg/cri/io/logger.go @@ -25,8 +25,8 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - "github.com/containerd/containerd/log" cioutil "github.com/containerd/containerd/pkg/ioutil" + "github.com/containerd/log" ) const ( diff --git a/pkg/cri/nri/nri_api_linux.go b/pkg/cri/nri/nri_api_linux.go index d17c72a8bd7a3..511e64d24df23 100644 --- a/pkg/cri/nri/nri_api_linux.go +++ b/pkg/cri/nri/nri_api_linux.go @@ -24,13 +24,13 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/blockio" "github.com/containerd/containerd/pkg/cri/annotations" "github.com/containerd/containerd/pkg/cri/constants" cstore "github.com/containerd/containerd/pkg/cri/store/container" sstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/pkg/cri/util" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/cri/opts/container.go b/pkg/cri/opts/container.go index 1840d6cc5c729..4f67ac33a2b33 100644 --- a/pkg/cri/opts/container.go +++ b/pkg/cri/opts/container.go @@ -29,9 +29,9 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" ) // WithNewSnapshot wraps `containerd.WithNewSnapshot` so that if creating the diff --git a/pkg/cri/opts/spec_linux.go b/pkg/cri/opts/spec_linux.go index f145360a041af..bf1591c5cf13a 100644 --- a/pkg/cri/opts/spec_linux.go +++ b/pkg/cri/opts/spec_linux.go @@ -32,8 +32,8 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" ) // Linux dependent OCI spec opts. diff --git a/pkg/cri/opts/spec_linux_opts.go b/pkg/cri/opts/spec_linux_opts.go index 8af03daf7fce6..b851edfa1b150 100644 --- a/pkg/cri/opts/spec_linux_opts.go +++ b/pkg/cri/opts/spec_linux_opts.go @@ -32,10 +32,10 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/oci" osinterface "github.com/containerd/containerd/pkg/os" + "github.com/containerd/log" ) // WithMounts sorts and adds runtime and CRI mounts to the spec diff --git a/pkg/cri/sbserver/blockio_linux.go b/pkg/cri/sbserver/blockio_linux.go index bbc58d18f0bde..1ccf10189bfee 100644 --- a/pkg/cri/sbserver/blockio_linux.go +++ b/pkg/cri/sbserver/blockio_linux.go @@ -21,8 +21,8 @@ package sbserver import ( "fmt" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/blockio" + "github.com/containerd/log" ) // blockIOClassFromAnnotations examines container and pod annotations of a diff --git a/pkg/cri/sbserver/cni_conf_syncer.go b/pkg/cri/sbserver/cni_conf_syncer.go index dc0b917a1ea03..c94bde502c44d 100644 --- a/pkg/cri/sbserver/cni_conf_syncer.go +++ b/pkg/cri/sbserver/cni_conf_syncer.go @@ -22,8 +22,8 @@ import ( "path/filepath" "sync" - "github.com/containerd/containerd/log" "github.com/containerd/go-cni" + "github.com/containerd/log" "github.com/fsnotify/fsnotify" ) diff --git a/pkg/cri/sbserver/container_attach.go b/pkg/cri/sbserver/container_attach.go index 56f69c6a56d30..852707114e821 100644 --- a/pkg/cri/sbserver/container_attach.go +++ b/pkg/cri/sbserver/container_attach.go @@ -22,7 +22,7 @@ import ( "io" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/container_create.go b/pkg/cri/sbserver/container_create.go index f3a2413694d8e..adb1231cd5beb 100644 --- a/pkg/cri/sbserver/container_create.go +++ b/pkg/cri/sbserver/container_create.go @@ -35,7 +35,6 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/pkg/blockio" "github.com/containerd/containerd/pkg/cri/annotations" @@ -45,6 +44,7 @@ import ( containerstore "github.com/containerd/containerd/pkg/cri/store/container" "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" ) func init() { diff --git a/pkg/cri/sbserver/container_execsync.go b/pkg/cri/sbserver/container_execsync.go index 3e4090f3eb915..8d62888e75dbe 100644 --- a/pkg/cri/sbserver/container_execsync.go +++ b/pkg/cri/sbserver/container_execsync.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd" containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/container_remove.go b/pkg/cri/sbserver/container_remove.go index 9cc568f4bed4a..83cde61a3d748 100644 --- a/pkg/cri/sbserver/container_remove.go +++ b/pkg/cri/sbserver/container_remove.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/sbserver/container_start.go b/pkg/cri/sbserver/container_start.go index 15252a29efd67..ddc6b11227401 100644 --- a/pkg/cri/sbserver/container_start.go +++ b/pkg/cri/sbserver/container_start.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd" containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" cio "github.com/containerd/containerd/pkg/cri/io" diff --git a/pkg/cri/sbserver/container_stats_list.go b/pkg/cri/sbserver/container_stats_list.go index d08d29ecb982a..72f4414414d93 100644 --- a/pkg/cri/sbserver/container_stats_list.go +++ b/pkg/cri/sbserver/container_stats_list.go @@ -29,9 +29,9 @@ import ( "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/store/stats" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/container_stop.go b/pkg/cri/sbserver/container_stop.go index 925f202ee1ab5..8a83f48ba32f9 100644 --- a/pkg/cri/sbserver/container_stop.go +++ b/pkg/cri/sbserver/container_stop.go @@ -25,10 +25,10 @@ import ( eventtypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/moby/sys/signal" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/container_update_resources.go b/pkg/cri/sbserver/container_update_resources.go index ab19232261051..8e80bc29d2b3c 100644 --- a/pkg/cri/sbserver/container_update_resources.go +++ b/pkg/cri/sbserver/container_update_resources.go @@ -30,7 +30,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" ctrdutil "github.com/containerd/containerd/pkg/cri/util" diff --git a/pkg/cri/sbserver/events.go b/pkg/cri/sbserver/events.go index 5d8006e705f0a..47b64292beb9e 100644 --- a/pkg/cri/sbserver/events.go +++ b/pkg/cri/sbserver/events.go @@ -29,12 +29,12 @@ import ( containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/constants" containerstore "github.com/containerd/containerd/pkg/cri/store/container" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "k8s.io/utils/clock" diff --git a/pkg/cri/sbserver/helpers.go b/pkg/cri/sbserver/helpers.go index 68abc1e4d7945..c2f29d0f04224 100644 --- a/pkg/cri/sbserver/helpers.go +++ b/pkg/cri/sbserver/helpers.go @@ -37,13 +37,13 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" clabels "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" criconfig "github.com/containerd/containerd/pkg/cri/config" containerstore "github.com/containerd/containerd/pkg/cri/store/container" imagestore "github.com/containerd/containerd/pkg/cri/store/image" runtimeoptions "github.com/containerd/containerd/pkg/runtimeoptions/v1" "github.com/containerd/containerd/plugin" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/log" ) // TODO: Move common helpers for sbserver and podsandbox to a dedicated package once basic services are functinal. diff --git a/pkg/cri/sbserver/helpers_linux.go b/pkg/cri/sbserver/helpers_linux.go index bd142ecc0a833..995558923b3bd 100644 --- a/pkg/cri/sbserver/helpers_linux.go +++ b/pkg/cri/sbserver/helpers_linux.go @@ -33,12 +33,12 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/apparmor" "github.com/containerd/containerd/pkg/seccomp" "github.com/containerd/containerd/pkg/seutil" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" ) // apparmorEnabled returns true if apparmor is enabled, supported by the host, diff --git a/pkg/cri/sbserver/images/image_pull.go b/pkg/cri/sbserver/images/image_pull.go index 40b17d80fd543..99c43732c891e 100644 --- a/pkg/cri/sbserver/images/image_pull.go +++ b/pkg/cri/sbserver/images/image_pull.go @@ -42,7 +42,6 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" containerdimages "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/annotations" criconfig "github.com/containerd/containerd/pkg/cri/config" crilabels "github.com/containerd/containerd/pkg/cri/labels" @@ -50,6 +49,7 @@ import ( "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/config" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" distribution "github.com/distribution/reference" ) diff --git a/pkg/cri/sbserver/images/image_status.go b/pkg/cri/sbserver/images/image_status.go index c0d5216c22571..9ca05df5e3d80 100644 --- a/pkg/cri/sbserver/images/image_status.go +++ b/pkg/cri/sbserver/images/image_status.go @@ -24,9 +24,9 @@ import ( "strings" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" imagestore "github.com/containerd/containerd/pkg/cri/store/image" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" docker "github.com/distribution/reference" imagespec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/pkg/cri/sbserver/images/service.go b/pkg/cri/sbserver/images/service.go index 54321ad9f4415..9d56aaec3cbaf 100644 --- a/pkg/cri/sbserver/images/service.go +++ b/pkg/cri/sbserver/images/service.go @@ -22,11 +22,11 @@ import ( "time" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" criconfig "github.com/containerd/containerd/pkg/cri/config" imagestore "github.com/containerd/containerd/pkg/cri/store/image" snapshotstore "github.com/containerd/containerd/pkg/cri/store/snapshot" "github.com/containerd/containerd/pkg/kmutex" + "github.com/containerd/log" docker "github.com/distribution/reference" imagedigest "github.com/opencontainers/go-digest" ) diff --git a/pkg/cri/sbserver/images/snapshots.go b/pkg/cri/sbserver/images/snapshots.go index 6bb06da457498..87a58eb1d65e7 100644 --- a/pkg/cri/sbserver/images/snapshots.go +++ b/pkg/cri/sbserver/images/snapshots.go @@ -22,10 +22,10 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" snapshotstore "github.com/containerd/containerd/pkg/cri/store/snapshot" ctrdutil "github.com/containerd/containerd/pkg/cri/util" snapshot "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" ) // snapshotsSyncer syncs snapshot stats periodically. imagefs info and container stats diff --git a/pkg/cri/sbserver/podsandbox/controller.go b/pkg/cri/sbserver/podsandbox/controller.go index 68ac860292b87..78944616c61f2 100644 --- a/pkg/cri/sbserver/podsandbox/controller.go +++ b/pkg/cri/sbserver/podsandbox/controller.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd" diff --git a/pkg/cri/sbserver/podsandbox/helpers.go b/pkg/cri/sbserver/podsandbox/helpers.go index 1c6e8a6c0440a..5e27c97dbe1b8 100644 --- a/pkg/cri/sbserver/podsandbox/helpers.go +++ b/pkg/cri/sbserver/podsandbox/helpers.go @@ -26,11 +26,11 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" clabels "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" criconfig "github.com/containerd/containerd/pkg/cri/config" imagestore "github.com/containerd/containerd/pkg/cri/store/image" ctrdutil "github.com/containerd/containerd/pkg/cri/util" + "github.com/containerd/log" docker "github.com/distribution/reference" runtimespec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/cri/sbserver/podsandbox/helpers_linux.go b/pkg/cri/sbserver/podsandbox/helpers_linux.go index f51e9907ed21e..00505f8783152 100644 --- a/pkg/cri/sbserver/podsandbox/helpers_linux.go +++ b/pkg/cri/sbserver/podsandbox/helpers_linux.go @@ -29,11 +29,11 @@ import ( "time" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/seccomp" "github.com/containerd/containerd/pkg/seutil" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" "github.com/moby/sys/mountinfo" runtimespec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/cri/sbserver/podsandbox/opts.go b/pkg/cri/sbserver/podsandbox/opts.go index 539a2b3d5e413..57c8948a041b4 100644 --- a/pkg/cri/sbserver/podsandbox/opts.go +++ b/pkg/cri/sbserver/podsandbox/opts.go @@ -20,7 +20,7 @@ import ( "context" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containerd/nri" v1 "github.com/containerd/nri/types/v1" ) diff --git a/pkg/cri/sbserver/podsandbox/recover.go b/pkg/cri/sbserver/podsandbox/recover.go index eb12cf665cb52..13a47ac822849 100644 --- a/pkg/cri/sbserver/podsandbox/recover.go +++ b/pkg/cri/sbserver/podsandbox/recover.go @@ -28,9 +28,9 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/pkg/cri/util" + "github.com/containerd/log" ) // loadContainerTimeout is the default timeout for loading a container/sandbox. diff --git a/pkg/cri/sbserver/podsandbox/sandbox_delete.go b/pkg/cri/sbserver/podsandbox/sandbox_delete.go index 9b899f9441026..8ed43801185ec 100644 --- a/pkg/cri/sbserver/podsandbox/sandbox_delete.go +++ b/pkg/cri/sbserver/podsandbox/sandbox_delete.go @@ -23,7 +23,7 @@ import ( "github.com/containerd/containerd" apitasks "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) func (c *Controller) Shutdown(ctx context.Context, sandboxID string) error { diff --git a/pkg/cri/sbserver/podsandbox/sandbox_run.go b/pkg/cri/sbserver/podsandbox/sandbox_run.go index 6ef941ccbef8b..fc5cbd2c35616 100644 --- a/pkg/cri/sbserver/podsandbox/sandbox_run.go +++ b/pkg/cri/sbserver/podsandbox/sandbox_run.go @@ -32,7 +32,6 @@ import ( "github.com/containerd/containerd" containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/annotations" criconfig "github.com/containerd/containerd/pkg/cri/config" customopts "github.com/containerd/containerd/pkg/cri/opts" @@ -40,6 +39,7 @@ import ( ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/sandbox" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" ) func init() { diff --git a/pkg/cri/sbserver/podsandbox/sandbox_stop.go b/pkg/cri/sbserver/podsandbox/sandbox_stop.go index 983399898f38e..2e68d809a00f4 100644 --- a/pkg/cri/sbserver/podsandbox/sandbox_stop.go +++ b/pkg/cri/sbserver/podsandbox/sandbox_stop.go @@ -24,11 +24,11 @@ import ( eventtypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/sandbox" + "github.com/containerd/log" ) func (c *Controller) Stop(ctx context.Context, sandboxID string, _ ...sandbox.StopOpt) error { diff --git a/pkg/cri/sbserver/rdt.go b/pkg/cri/sbserver/rdt.go index f0360ef5c25c6..c03bce55ed6bb 100644 --- a/pkg/cri/sbserver/rdt.go +++ b/pkg/cri/sbserver/rdt.go @@ -21,8 +21,8 @@ package sbserver import ( "fmt" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/rdt" + "github.com/containerd/log" ) // rdtClassFromAnnotations examines container and pod annotations of a diff --git a/pkg/cri/sbserver/restart.go b/pkg/cri/sbserver/restart.go index f7596e9ef9f21..8ed2618429494 100644 --- a/pkg/cri/sbserver/restart.go +++ b/pkg/cri/sbserver/restart.go @@ -28,11 +28,11 @@ import ( containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" containerdimages "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" criconfig "github.com/containerd/containerd/pkg/cri/config" "github.com/containerd/containerd/pkg/cri/sbserver/podsandbox" "github.com/containerd/containerd/pkg/netns" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "golang.org/x/sync/errgroup" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/runtime_config_linux.go b/pkg/cri/sbserver/runtime_config_linux.go index 502dfe90c840a..e5046d8539470 100644 --- a/pkg/cri/sbserver/runtime_config_linux.go +++ b/pkg/cri/sbserver/runtime_config_linux.go @@ -20,9 +20,9 @@ import ( "context" "sort" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/systemd" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/sbserver/sandbox_portforward_linux.go b/pkg/cri/sbserver/sandbox_portforward_linux.go index c6dd3cf557911..1ff318a5ff948 100644 --- a/pkg/cri/sbserver/sandbox_portforward_linux.go +++ b/pkg/cri/sbserver/sandbox_portforward_linux.go @@ -23,7 +23,7 @@ import ( "net" "time" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containernetworking/plugins/pkg/ns" ) diff --git a/pkg/cri/sbserver/sandbox_remove.go b/pkg/cri/sbserver/sandbox_remove.go index 41382ad0a5f3a..678ee6e0148cc 100644 --- a/pkg/cri/sbserver/sandbox_remove.go +++ b/pkg/cri/sbserver/sandbox_remove.go @@ -22,7 +22,7 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/sbserver/sandbox_run.go b/pkg/cri/sbserver/sandbox_run.go index e86b867c563a5..0997aa5fde5a4 100644 --- a/pkg/cri/sbserver/sandbox_run.go +++ b/pkg/cri/sbserver/sandbox_run.go @@ -31,7 +31,6 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/annotations" criconfig "github.com/containerd/containerd/pkg/cri/config" "github.com/containerd/containerd/pkg/cri/sbserver/podsandbox" @@ -40,6 +39,7 @@ import ( "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/pkg/netns" sb "github.com/containerd/containerd/sandbox" + "github.com/containerd/log" ) func init() { diff --git a/pkg/cri/sbserver/sandbox_stats_linux.go b/pkg/cri/sbserver/sandbox_stats_linux.go index e6ff930553ba8..93a4b94a8e926 100644 --- a/pkg/cri/sbserver/sandbox_stats_linux.go +++ b/pkg/cri/sbserver/sandbox_stats_linux.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/cgroups/v3/cgroup1" cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" + "github.com/containerd/log" "github.com/containernetworking/plugins/pkg/ns" "github.com/vishvananda/netlink" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/sandbox_stats_list.go b/pkg/cri/sbserver/sandbox_stats_list.go index 3e5ff13997d11..ea03c9bc7c17a 100644 --- a/pkg/cri/sbserver/sandbox_stats_list.go +++ b/pkg/cri/sbserver/sandbox_stats_list.go @@ -22,8 +22,8 @@ import ( "fmt" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/sbserver/sandbox_stats_windows.go b/pkg/cri/sbserver/sandbox_stats_windows.go index b04691315a108..3c9d2deadecb2 100644 --- a/pkg/cri/sbserver/sandbox_stats_windows.go +++ b/pkg/cri/sbserver/sandbox_stats_windows.go @@ -27,11 +27,11 @@ import ( "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" "github.com/containerd/containerd/pkg/cri/store/stats" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/sbserver/sandbox_stop.go b/pkg/cri/sbserver/sandbox_stop.go index dbd2b7ac8c1ab..3346364cf0d8f 100644 --- a/pkg/cri/sbserver/sandbox_stop.go +++ b/pkg/cri/sbserver/sandbox_stop.go @@ -22,7 +22,7 @@ import ( "fmt" "time" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/sbserver/service.go b/pkg/cri/sbserver/service.go index 5231a28a7e489..29dbe4e36c744 100644 --- a/pkg/cri/sbserver/service.go +++ b/pkg/cri/sbserver/service.go @@ -28,7 +28,6 @@ import ( "sync/atomic" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/pkg/cri/instrument" "github.com/containerd/containerd/pkg/cri/nri" @@ -40,6 +39,7 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/sandbox" "github.com/containerd/go-cni" + "github.com/containerd/log" "google.golang.org/grpc" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/sbserver/service_linux.go b/pkg/cri/sbserver/service_linux.go index 67a4865b94210..fc113c4937bed 100644 --- a/pkg/cri/sbserver/service_linux.go +++ b/pkg/cri/sbserver/service_linux.go @@ -22,10 +22,10 @@ import ( "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi" "github.com/opencontainers/selinux/go-selinux" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cap" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/go-cni" + "github.com/containerd/log" ) // networkAttachCount is the minimum number of networks the PodSandbox diff --git a/pkg/cri/sbserver/status.go b/pkg/cri/sbserver/status.go index f8a857b8ee4f1..e2547fdba6da8 100644 --- a/pkg/cri/sbserver/status.go +++ b/pkg/cri/sbserver/status.go @@ -22,7 +22,7 @@ import ( "fmt" goruntime "runtime" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/sbserver/update_runtime_config.go b/pkg/cri/sbserver/update_runtime_config.go index fcab382d96cf5..b609ec493d9a5 100644 --- a/pkg/cri/sbserver/update_runtime_config.go +++ b/pkg/cri/sbserver/update_runtime_config.go @@ -28,8 +28,8 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/atomicfile" + "github.com/containerd/log" ) // cniConfigTemplate contains the values containerd will overwrite diff --git a/pkg/cri/server/blockio_linux.go b/pkg/cri/server/blockio_linux.go index c1746d8e79052..7d1e522eaaed6 100644 --- a/pkg/cri/server/blockio_linux.go +++ b/pkg/cri/server/blockio_linux.go @@ -21,8 +21,8 @@ package server import ( "fmt" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/blockio" + "github.com/containerd/log" ) // blockIOClassFromAnnotations examines container and pod annotations of a diff --git a/pkg/cri/server/cni_conf_syncer.go b/pkg/cri/server/cni_conf_syncer.go index 8b5e4bc44d033..1efb8e2ea8090 100644 --- a/pkg/cri/server/cni_conf_syncer.go +++ b/pkg/cri/server/cni_conf_syncer.go @@ -22,8 +22,8 @@ import ( "path/filepath" "sync" - "github.com/containerd/containerd/log" cni "github.com/containerd/go-cni" + "github.com/containerd/log" "github.com/fsnotify/fsnotify" ) diff --git a/pkg/cri/server/container_attach.go b/pkg/cri/server/container_attach.go index cd79f3bfaf4c6..d7d0096d6e0fe 100644 --- a/pkg/cri/server/container_attach.go +++ b/pkg/cri/server/container_attach.go @@ -22,7 +22,7 @@ import ( "io" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_create.go b/pkg/cri/server/container_create.go index 4cc8defae3df9..1e8d31488f521 100644 --- a/pkg/cri/server/container_create.go +++ b/pkg/cri/server/container_create.go @@ -33,13 +33,13 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" criconfig "github.com/containerd/containerd/pkg/cri/config" cio "github.com/containerd/containerd/pkg/cri/io" customopts "github.com/containerd/containerd/pkg/cri/opts" containerstore "github.com/containerd/containerd/pkg/cri/store/container" "github.com/containerd/containerd/pkg/cri/util" + "github.com/containerd/log" ) func init() { diff --git a/pkg/cri/server/container_execsync.go b/pkg/cri/server/container_execsync.go index b22281545197f..fa0d3fe0e7eac 100644 --- a/pkg/cri/server/container_execsync.go +++ b/pkg/cri/server/container_execsync.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd" containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_remove.go b/pkg/cri/server/container_remove.go index e8655315ca5ac..51b570fba6dcd 100644 --- a/pkg/cri/server/container_remove.go +++ b/pkg/cri/server/container_remove.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_start.go b/pkg/cri/server/container_start.go index 6132d573fb136..394bcd5a6f90e 100644 --- a/pkg/cri/server/container_start.go +++ b/pkg/cri/server/container_start.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd" containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" cio "github.com/containerd/containerd/pkg/cri/io" diff --git a/pkg/cri/server/container_stop.go b/pkg/cri/server/container_stop.go index 555a29a800860..56fd3b2634c3f 100644 --- a/pkg/cri/server/container_stop.go +++ b/pkg/cri/server/container_stop.go @@ -25,10 +25,10 @@ import ( eventtypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/moby/sys/signal" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_update_resources.go b/pkg/cri/server/container_update_resources.go index 573510d075808..55e83e9b4923c 100644 --- a/pkg/cri/server/container_update_resources.go +++ b/pkg/cri/server/container_update_resources.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/events.go b/pkg/cri/server/events.go index 163c1cf08b85b..243ac6ac399f8 100644 --- a/pkg/cri/server/events.go +++ b/pkg/cri/server/events.go @@ -29,12 +29,12 @@ import ( containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/constants" containerstore "github.com/containerd/containerd/pkg/cri/store/container" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "k8s.io/utils/clock" diff --git a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go index 32018aab79374..2765d728da069 100644 --- a/pkg/cri/server/helpers.go +++ b/pkg/cri/server/helpers.go @@ -30,7 +30,6 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" clabels "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" criconfig "github.com/containerd/containerd/pkg/cri/config" containerstore "github.com/containerd/containerd/pkg/cri/store/container" imagestore "github.com/containerd/containerd/pkg/cri/store/image" @@ -38,6 +37,7 @@ import ( runtimeoptions "github.com/containerd/containerd/pkg/runtimeoptions/v1" "github.com/containerd/containerd/plugin" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" docker "github.com/distribution/reference" runtimespec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/cri/server/helpers_linux.go b/pkg/cri/server/helpers_linux.go index d490ce881e0b6..5bcdb70391592 100644 --- a/pkg/cri/server/helpers_linux.go +++ b/pkg/cri/server/helpers_linux.go @@ -29,12 +29,12 @@ import ( "time" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/apparmor" "github.com/containerd/containerd/pkg/seccomp" "github.com/containerd/containerd/pkg/seutil" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" "github.com/moby/sys/mountinfo" "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" diff --git a/pkg/cri/server/image_pull.go b/pkg/cri/server/image_pull.go index 3c7955577cd2d..cef181aa55868 100644 --- a/pkg/cri/server/image_pull.go +++ b/pkg/cri/server/image_pull.go @@ -40,7 +40,6 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" containerdimages "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/annotations" criconfig "github.com/containerd/containerd/pkg/cri/config" crilabels "github.com/containerd/containerd/pkg/cri/labels" @@ -48,6 +47,7 @@ import ( "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/config" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" distribution "github.com/distribution/reference" ) diff --git a/pkg/cri/server/image_status.go b/pkg/cri/server/image_status.go index ccd6642536764..6464142213e1b 100644 --- a/pkg/cri/server/image_status.go +++ b/pkg/cri/server/image_status.go @@ -22,9 +22,9 @@ import ( "fmt" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" imagestore "github.com/containerd/containerd/pkg/cri/store/image" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/rdt_linux.go b/pkg/cri/server/rdt_linux.go index 5e83061a78f86..b45d245724550 100644 --- a/pkg/cri/server/rdt_linux.go +++ b/pkg/cri/server/rdt_linux.go @@ -21,8 +21,8 @@ package server import ( "fmt" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/rdt" + "github.com/containerd/log" ) // rdtClassFromAnnotations examines container and pod annotations of a diff --git a/pkg/cri/server/restart.go b/pkg/cri/server/restart.go index f146fa16d2f3e..fa98e54d3da6d 100644 --- a/pkg/cri/server/restart.go +++ b/pkg/cri/server/restart.go @@ -28,8 +28,8 @@ import ( containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" containerdimages "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "golang.org/x/sync/errgroup" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/runtime_config_linux.go b/pkg/cri/server/runtime_config_linux.go index e58ef5f58c62f..719db31ebf33e 100644 --- a/pkg/cri/server/runtime_config_linux.go +++ b/pkg/cri/server/runtime_config_linux.go @@ -20,9 +20,9 @@ import ( "context" "sort" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/systemd" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_portforward_linux.go b/pkg/cri/server/sandbox_portforward_linux.go index c616f77b86fc5..15256421d3166 100644 --- a/pkg/cri/server/sandbox_portforward_linux.go +++ b/pkg/cri/server/sandbox_portforward_linux.go @@ -23,7 +23,7 @@ import ( "net" "time" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containernetworking/plugins/pkg/ns" ) diff --git a/pkg/cri/server/sandbox_remove.go b/pkg/cri/server/sandbox_remove.go index 1541a0a67256e..c440eb5be49a0 100644 --- a/pkg/cri/server/sandbox_remove.go +++ b/pkg/cri/server/sandbox_remove.go @@ -23,7 +23,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_run.go b/pkg/cri/server/sandbox_run.go index 55e14e5a87b2d..6268de82860c6 100644 --- a/pkg/cri/server/sandbox_run.go +++ b/pkg/cri/server/sandbox_run.go @@ -36,7 +36,6 @@ import ( "github.com/containerd/containerd" containerdio "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cri/annotations" criconfig "github.com/containerd/containerd/pkg/cri/config" customopts "github.com/containerd/containerd/pkg/cri/opts" @@ -45,6 +44,7 @@ import ( "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/containerd/pkg/netns" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" ) func init() { diff --git a/pkg/cri/server/sandbox_stats_linux.go b/pkg/cri/server/sandbox_stats_linux.go index 6b0c50eafb6b9..028bf4e52a6cb 100644 --- a/pkg/cri/server/sandbox_stats_linux.go +++ b/pkg/cri/server/sandbox_stats_linux.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/cgroups/v3/cgroup1" cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" + "github.com/containerd/log" "github.com/containernetworking/plugins/pkg/ns" "github.com/vishvananda/netlink" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/sandbox_stats_list.go b/pkg/cri/server/sandbox_stats_list.go index d237b18d49071..233202c013739 100644 --- a/pkg/cri/server/sandbox_stats_list.go +++ b/pkg/cri/server/sandbox_stats_list.go @@ -22,8 +22,8 @@ import ( "fmt" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_stats_windows.go b/pkg/cri/server/sandbox_stats_windows.go index c6288565c8693..729238137bfe9 100644 --- a/pkg/cri/server/sandbox_stats_windows.go +++ b/pkg/cri/server/sandbox_stats_windows.go @@ -27,11 +27,11 @@ import ( "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" "github.com/containerd/containerd/pkg/cri/store/stats" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_stop.go b/pkg/cri/server/sandbox_stop.go index c863911aedcf6..5adca0a56d813 100644 --- a/pkg/cri/server/sandbox_stop.go +++ b/pkg/cri/server/sandbox_stop.go @@ -25,8 +25,8 @@ import ( eventtypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/server/service.go b/pkg/cri/server/service.go index 259b6cfce9f91..82b81926e9b33 100644 --- a/pkg/cri/server/service.go +++ b/pkg/cri/server/service.go @@ -28,7 +28,6 @@ import ( "time" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/pkg/cri/instrument" "github.com/containerd/containerd/pkg/cri/nri" @@ -36,6 +35,7 @@ import ( "github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/plugin" cni "github.com/containerd/go-cni" + "github.com/containerd/log" "google.golang.org/grpc" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/service_linux.go b/pkg/cri/server/service_linux.go index 178b4540c18cd..598a5e38bc9e7 100644 --- a/pkg/cri/server/service_linux.go +++ b/pkg/cri/server/service_linux.go @@ -20,10 +20,10 @@ import ( "fmt" "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/cap" "github.com/containerd/containerd/pkg/userns" cni "github.com/containerd/go-cni" + "github.com/containerd/log" "github.com/opencontainers/selinux/go-selinux" ) diff --git a/pkg/cri/server/snapshots.go b/pkg/cri/server/snapshots.go index d86db5cdf1a45..3f3bbd1026a04 100644 --- a/pkg/cri/server/snapshots.go +++ b/pkg/cri/server/snapshots.go @@ -22,10 +22,10 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" snapshotstore "github.com/containerd/containerd/pkg/cri/store/snapshot" ctrdutil "github.com/containerd/containerd/pkg/cri/util" snapshot "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" ) // snapshotsSyncer syncs snapshot stats periodically. imagefs info and container stats diff --git a/pkg/cri/server/status.go b/pkg/cri/server/status.go index 7a702c57caaac..619ee78014355 100644 --- a/pkg/cri/server/status.go +++ b/pkg/cri/server/status.go @@ -22,7 +22,7 @@ import ( "fmt" goruntime "runtime" - "github.com/containerd/containerd/log" + "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/update_runtime_config.go b/pkg/cri/server/update_runtime_config.go index 770e5980d3956..cf2e2abeeae23 100644 --- a/pkg/cri/server/update_runtime_config.go +++ b/pkg/cri/server/update_runtime_config.go @@ -28,8 +28,8 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/atomicfile" + "github.com/containerd/log" ) // cniConfigTemplate contains the values containerd will overwrite diff --git a/pkg/epoch/epoch.go b/pkg/epoch/epoch.go index 924067db96f9b..6dd4b9e9a65a5 100644 --- a/pkg/epoch/epoch.go +++ b/pkg/epoch/epoch.go @@ -23,7 +23,7 @@ import ( "strconv" "time" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // SourceDateEpochEnv is the SOURCE_DATE_EPOCH env var. diff --git a/pkg/nri/domain.go b/pkg/nri/domain.go index db2dc28cab323..d761ed2b0b12a 100644 --- a/pkg/nri/domain.go +++ b/pkg/nri/domain.go @@ -22,8 +22,8 @@ import ( "sync" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" + "github.com/containerd/log" nri "github.com/containerd/nri/pkg/adaptation" ) diff --git a/pkg/nri/nri.go b/pkg/nri/nri.go index 592b22e3e02e2..0cf61a82d784b 100644 --- a/pkg/nri/nri.go +++ b/pkg/nri/nri.go @@ -22,7 +22,7 @@ import ( "path" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/containerd/containerd/version" nri "github.com/containerd/nri/pkg/adaptation" diff --git a/pkg/oom/v1/v1.go b/pkg/oom/v1/v1.go index 224e3020dc5dd..1686230ec248b 100644 --- a/pkg/oom/v1/v1.go +++ b/pkg/oom/v1/v1.go @@ -25,10 +25,10 @@ import ( "github.com/containerd/cgroups/v3/cgroup1" eventstypes "github.com/containerd/containerd/api/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/oom" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/log" "golang.org/x/sys/unix" ) diff --git a/pkg/oom/v2/v2.go b/pkg/oom/v2/v2.go index e4cb5c19bf6dc..63710e234b7c2 100644 --- a/pkg/oom/v2/v2.go +++ b/pkg/oom/v2/v2.go @@ -24,10 +24,10 @@ import ( cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2" eventstypes "github.com/containerd/containerd/api/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/oom" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/log" ) // New returns an implementation that listens to OOM events diff --git a/pkg/process/init.go b/pkg/process/init.go index 00343f8542d63..7125e766ff772 100644 --- a/pkg/process/init.go +++ b/pkg/process/init.go @@ -31,12 +31,12 @@ import ( "time" "github.com/containerd/console" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/stdio" google_protobuf "github.com/containerd/containerd/protobuf/types" "github.com/containerd/fifo" runc "github.com/containerd/go-runc" + "github.com/containerd/log" specs "github.com/opencontainers/runtime-spec/specs-go" "golang.org/x/sys/unix" ) diff --git a/pkg/process/init_state.go b/pkg/process/init_state.go index 3c74a08702178..df528e4dbd960 100644 --- a/pkg/process/init_state.go +++ b/pkg/process/init_state.go @@ -23,9 +23,9 @@ import ( "errors" "fmt" - "github.com/containerd/containerd/log" google_protobuf "github.com/containerd/containerd/protobuf/types" runc "github.com/containerd/go-runc" + "github.com/containerd/log" ) type initState interface { diff --git a/pkg/process/io.go b/pkg/process/io.go index a13b27c9250f0..006645a8128c9 100644 --- a/pkg/process/io.go +++ b/pkg/process/io.go @@ -31,11 +31,11 @@ import ( "syscall" "time" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/stdio" "github.com/containerd/fifo" runc "github.com/containerd/go-runc" + "github.com/containerd/log" exec "golang.org/x/sys/execabs" ) diff --git a/pkg/rdt/rdt_linux.go b/pkg/rdt/rdt_linux.go index 99b7e5988158d..520ca35093f09 100644 --- a/pkg/rdt/rdt_linux.go +++ b/pkg/rdt/rdt_linux.go @@ -22,7 +22,7 @@ import ( "fmt" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/intel/goresctrl/pkg/rdt" ) diff --git a/pkg/snapshotters/annotations.go b/pkg/snapshotters/annotations.go index c7ad97c155ab5..63476376c1b7e 100644 --- a/pkg/snapshotters/annotations.go +++ b/pkg/snapshotters/annotations.go @@ -21,7 +21,7 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/pkg/transfer/archive/exporter.go b/pkg/transfer/archive/exporter.go index d71f75c4a495e..fd0572360533f 100644 --- a/pkg/transfer/archive/exporter.go +++ b/pkg/transfer/archive/exporter.go @@ -28,11 +28,11 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" "github.com/containerd/containerd/images/archive" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/transfer/plugins" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" ) func init() { diff --git a/pkg/transfer/archive/importer.go b/pkg/transfer/archive/importer.go index 7c8f528ccb183..d9a3df8760f50 100644 --- a/pkg/transfer/archive/importer.go +++ b/pkg/transfer/archive/importer.go @@ -26,9 +26,9 @@ import ( transferapi "github.com/containerd/containerd/api/types/transfer" "github.com/containerd/containerd/content" "github.com/containerd/containerd/images/archive" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" + "github.com/containerd/log" ) type ImportOpt func(*ImageImportStream) diff --git a/pkg/transfer/local/import.go b/pkg/transfer/local/import.go index 6ccc4f1f91beb..ae741bd65e347 100644 --- a/pkg/transfer/local/import.go +++ b/pkg/transfer/local/import.go @@ -26,9 +26,9 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/unpack" + "github.com/containerd/log" ) func (ts *localTransferService) importStream(ctx context.Context, i transfer.ImageImporter, is transfer.ImageStorer, tops *transfer.Config) error { diff --git a/pkg/transfer/local/progress.go b/pkg/transfer/local/progress.go index 7656510375340..dcaedc37131ce 100644 --- a/pkg/transfer/local/progress.go +++ b/pkg/transfer/local/progress.go @@ -23,9 +23,9 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/pkg/transfer/local/pull.go b/pkg/transfer/local/pull.go index 204d3343408d1..95e08cb855df7 100644 --- a/pkg/transfer/local/pull.go +++ b/pkg/transfer/local/pull.go @@ -24,11 +24,11 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/unpack" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/pkg/transfer/proxy/transfer.go b/pkg/transfer/proxy/transfer.go index 50dba0b37c788..2ad7a944962bb 100644 --- a/pkg/transfer/proxy/transfer.go +++ b/pkg/transfer/proxy/transfer.go @@ -25,10 +25,10 @@ import ( transferapi "github.com/containerd/containerd/api/services/transfer/v1" transfertypes "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/transfer" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/pkg/transfer/registry/registry.go b/pkg/transfer/registry/registry.go index 441b29f64b21f..fa60d88f8d098 100644 --- a/pkg/transfer/registry/registry.go +++ b/pkg/transfer/registry/registry.go @@ -26,13 +26,13 @@ import ( "sync" transfertypes "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer/plugins" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/pkg/transfer/streaming/stream.go b/pkg/transfer/streaming/stream.go index 061fd172d36af..c26764b940761 100644 --- a/pkg/transfer/streaming/stream.go +++ b/pkg/transfer/streaming/stream.go @@ -27,8 +27,8 @@ import ( "time" transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/pkg/transfer/streaming/writer.go b/pkg/transfer/streaming/writer.go index ab43785ce5ad8..96e9837f3df38 100644 --- a/pkg/transfer/streaming/writer.go +++ b/pkg/transfer/streaming/writer.go @@ -23,8 +23,8 @@ import ( "sync/atomic" transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/pkg/unpack/unpacker.go b/pkg/unpack/unpacker.go index 43c963f909696..f16b96888d44b 100644 --- a/pkg/unpack/unpacker.go +++ b/pkg/unpack/unpacker.go @@ -33,13 +33,13 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/cleanup" "github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/platforms/cpuinfo.go b/platforms/cpuinfo.go index 8c600fc96b1c7..91f50e8c88aff 100644 --- a/platforms/cpuinfo.go +++ b/platforms/cpuinfo.go @@ -20,7 +20,7 @@ import ( "runtime" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // Present the ARM instruction set architecture, eg: v7, v8 diff --git a/plugins/sandbox/controller.go b/plugins/sandbox/controller.go index d295706b7aea0..5214b6efd7064 100644 --- a/plugins/sandbox/controller.go +++ b/plugins/sandbox/controller.go @@ -26,13 +26,13 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" "github.com/containerd/containerd/events/exchange" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/runtime" v2 "github.com/containerd/containerd/runtime/v2" "github.com/containerd/containerd/sandbox" + "github.com/containerd/log" "google.golang.org/protobuf/types/known/anypb" ) diff --git a/plugins/transfer/plugin.go b/plugins/transfer/plugin.go index 9ba0abd2435e7..dc12d3edb7891 100644 --- a/plugins/transfer/plugin.go +++ b/plugins/transfer/plugin.go @@ -23,12 +23,12 @@ import ( "github.com/containerd/containerd/diff" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/leases" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/pkg/transfer/local" "github.com/containerd/containerd/pkg/unpack" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" + "github.com/containerd/log" // Load packages with type registrations _ "github.com/containerd/containerd/pkg/transfer/archive" diff --git a/remotes/docker/auth/fetch.go b/remotes/docker/auth/fetch.go index 64c6a38f91a92..244e03509a7d4 100644 --- a/remotes/docker/auth/fetch.go +++ b/remotes/docker/auth/fetch.go @@ -26,9 +26,9 @@ import ( "strings" "time" - "github.com/containerd/containerd/log" remoteserrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/version" + "github.com/containerd/log" ) var ( diff --git a/remotes/docker/authorizer.go b/remotes/docker/authorizer.go index 8fc823144ebf2..132305a9c9990 100644 --- a/remotes/docker/authorizer.go +++ b/remotes/docker/authorizer.go @@ -26,9 +26,9 @@ import ( "sync" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes/docker/auth" remoteerrors "github.com/containerd/containerd/remotes/errors" + "github.com/containerd/log" ) type dockerAuthorizer struct { diff --git a/remotes/docker/config/hosts.go b/remotes/docker/config/hosts.go index dead8aa804cba..ed92c9470d559 100644 --- a/remotes/docker/config/hosts.go +++ b/remotes/docker/config/hosts.go @@ -33,8 +33,8 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/log" "github.com/pelletier/go-toml" ) diff --git a/remotes/docker/config/hosts_test.go b/remotes/docker/config/hosts_test.go index a3941f026a3f6..710a18d853ca4 100644 --- a/remotes/docker/config/hosts_test.go +++ b/remotes/docker/config/hosts_test.go @@ -25,8 +25,8 @@ import ( "path/filepath" "testing" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/log/logtest" ) const allCaps = docker.HostCapabilityPull | docker.HostCapabilityResolve | docker.HostCapabilityPush diff --git a/remotes/docker/converter.go b/remotes/docker/converter.go index d7dca0d364302..95a68d70e6773 100644 --- a/remotes/docker/converter.go +++ b/remotes/docker/converter.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/docker/converter_fuzz.go b/remotes/docker/converter_fuzz.go index caea6421a09c3..fc6043751d397 100644 --- a/remotes/docker/converter_fuzz.go +++ b/remotes/docker/converter_fuzz.go @@ -24,7 +24,7 @@ import ( fuzz "github.com/AdaLogics/go-fuzz-headers" "github.com/containerd/containerd/content/local" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/docker/fetcher.go b/remotes/docker/fetcher.go index 0c50a086f1a70..af538962eb212 100644 --- a/remotes/docker/fetcher.go +++ b/remotes/docker/fetcher.go @@ -28,8 +28,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/docker/handler.go b/remotes/docker/handler.go index 569dfa3de87d8..045a50fb02147 100644 --- a/remotes/docker/handler.go +++ b/remotes/docker/handler.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/reference" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/docker/httpreadseeker.go b/remotes/docker/httpreadseeker.go index 9a827ef04c254..7e7790d2b3767 100644 --- a/remotes/docker/httpreadseeker.go +++ b/remotes/docker/httpreadseeker.go @@ -22,7 +22,7 @@ import ( "io" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) const maxRetry = 3 diff --git a/remotes/docker/pusher.go b/remotes/docker/pusher.go index 7fbbbb7cd5b15..c704bfd5ac256 100644 --- a/remotes/docker/pusher.go +++ b/remotes/docker/pusher.go @@ -30,9 +30,9 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" remoteserrors "github.com/containerd/containerd/remotes/errors" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/docker/resolver.go b/remotes/docker/resolver.go index 3d6c0182f1b11..9e3d93b26ced0 100644 --- a/remotes/docker/resolver.go +++ b/remotes/docker/resolver.go @@ -29,13 +29,13 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/reference" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. remoteerrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/tracing" "github.com/containerd/containerd/version" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/docker/schema1/converter.go b/remotes/docker/schema1/converter.go index 8c9e520cd27e5..6b179ba3fdf23 100644 --- a/remotes/docker/schema1/converter.go +++ b/remotes/docker/schema1/converter.go @@ -37,8 +37,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/remotes/handlers.go b/remotes/handlers.go index 874c8341578af..e17ef3defb4e4 100644 --- a/remotes/handlers.go +++ b/remotes/handlers.go @@ -29,8 +29,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/semaphore" ) diff --git a/rootfs/apply.go b/rootfs/apply.go index 35eae6d63de15..cc9a92ed99560 100644 --- a/rootfs/apply.go +++ b/rootfs/apply.go @@ -25,9 +25,9 @@ import ( "github.com/containerd/containerd/diff" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/rootfs/init.go b/rootfs/init.go index 02d13bfc3675d..e6866ace2b49b 100644 --- a/rootfs/init.go +++ b/rootfs/init.go @@ -22,9 +22,9 @@ import ( "fmt" "os" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ) diff --git a/runtime/events.go b/runtime/events.go index 7610230160862..29fc741a48371 100644 --- a/runtime/events.go +++ b/runtime/events.go @@ -18,7 +18,7 @@ package runtime import ( "github.com/containerd/containerd/api/events" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) const ( diff --git a/runtime/restart/monitor/monitor.go b/runtime/restart/monitor/monitor.go index dbf2eae204450..f6e312968f25e 100644 --- a/runtime/restart/monitor/monitor.go +++ b/runtime/restart/monitor/monitor.go @@ -24,10 +24,10 @@ import ( "time" "github.com/containerd/containerd" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/runtime/restart" + "github.com/containerd/log" ) type duration struct { diff --git a/runtime/restart/restart.go b/runtime/restart/restart.go index 53a110b752d32..e71e9ec4d4c11 100644 --- a/runtime/restart/restart.go +++ b/runtime/restart/restart.go @@ -39,7 +39,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) const ( diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go index 42855143352c9..2c71c843cdca2 100644 --- a/runtime/v2/binary.go +++ b/runtime/v2/binary.go @@ -26,13 +26,13 @@ import ( gruntime "runtime" "github.com/containerd/containerd/api/runtime/task/v2" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" client "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/log" ) type shimBinaryConfig struct { diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index a90bbd8f85fcb..e45de8c1f7c57 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -28,7 +28,6 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events/exchange" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/cleanup" @@ -39,6 +38,7 @@ import ( "github.com/containerd/containerd/runtime" shimbinary "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/sandbox" + "github.com/containerd/log" ) // Config for the v2 runtime diff --git a/runtime/v2/runc/container.go b/runtime/v2/runc/container.go index 448338561517e..a401c945067e6 100644 --- a/runtime/v2/runc/container.go +++ b/runtime/v2/runc/container.go @@ -32,12 +32,12 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd/api/runtime/task/v2" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/process" "github.com/containerd/containerd/pkg/stdio" "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/runtime/v2/runc/manager/manager_linux.go b/runtime/v2/runc/manager/manager_linux.go index 8d20d89e15749..67d20c08abc26 100644 --- a/runtime/v2/runc/manager/manager_linux.go +++ b/runtime/v2/runc/manager/manager_linux.go @@ -29,7 +29,6 @@ import ( "github.com/containerd/cgroups/v3" "github.com/containerd/cgroups/v3/cgroup1" cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/oci" @@ -39,6 +38,7 @@ import ( "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/shim" runcC "github.com/containerd/go-runc" + "github.com/containerd/log" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) diff --git a/runtime/v2/runc/pause/sandbox.go b/runtime/v2/runc/pause/sandbox.go index aa0a31833ecbd..1156c81daaefa 100644 --- a/runtime/v2/runc/pause/sandbox.go +++ b/runtime/v2/runc/pause/sandbox.go @@ -23,9 +23,9 @@ import ( "runtime" "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/shutdown" "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/log" "github.com/containerd/ttrpc" api "github.com/containerd/containerd/api/runtime/sandbox/v1" diff --git a/runtime/v2/runc/task/service.go b/runtime/v2/runc/task/service.go index 93632184032c7..ff09c045a2a98 100644 --- a/runtime/v2/runc/task/service.go +++ b/runtime/v2/runc/task/service.go @@ -31,7 +31,6 @@ import ( taskAPI "github.com/containerd/containerd/api/runtime/task/v2" "github.com/containerd/containerd/api/types/task" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/oom" oomv1 "github.com/containerd/containerd/pkg/oom/v1" @@ -48,6 +47,7 @@ import ( "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/sys/reaper" runcC "github.com/containerd/go-runc" + "github.com/containerd/log" "github.com/containerd/ttrpc" "github.com/containerd/typeurl/v2" ) diff --git a/runtime/v2/runc/util.go b/runtime/v2/runc/util.go index 611d93155999e..5a95c663dd430 100644 --- a/runtime/v2/runc/util.go +++ b/runtime/v2/runc/util.go @@ -22,8 +22,8 @@ import ( "context" "path/filepath" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" + "github.com/containerd/log" "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index 0a47b90db6884..46452b55b3ebb 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -38,13 +38,13 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events/exchange" "github.com/containerd/containerd/identifiers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/dialer" "github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" client "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/log" ) const ( diff --git a/runtime/v2/shim/publisher.go b/runtime/v2/shim/publisher.go index b33d6a16b97e8..009f50ba2f30b 100644 --- a/runtime/v2/shim/publisher.go +++ b/runtime/v2/shim/publisher.go @@ -23,10 +23,10 @@ import ( v1 "github.com/containerd/containerd/api/services/ttrpc/events/v1" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/ttrpcutil" "github.com/containerd/containerd/protobuf" + "github.com/containerd/log" "github.com/containerd/ttrpc" ) diff --git a/runtime/v2/shim/shim.go b/runtime/v2/shim/shim.go index 7455c55b3a1f4..9f945a0e6da41 100644 --- a/runtime/v2/shim/shim.go +++ b/runtime/v2/shim/shim.go @@ -31,13 +31,13 @@ import ( shimapi "github.com/containerd/containerd/api/runtime/task/v2" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/shutdown" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/version" + "github.com/containerd/log" "github.com/containerd/ttrpc" "github.com/sirupsen/logrus" ) diff --git a/runtime/v2/shim/shim_unix.go b/runtime/v2/shim/shim_unix.go index 62e46551e9ca7..a9504b698da07 100644 --- a/runtime/v2/shim/shim_unix.go +++ b/runtime/v2/shim/shim_unix.go @@ -27,9 +27,9 @@ import ( "os/signal" "syscall" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/sys/reaper" "github.com/containerd/fifo" + "github.com/containerd/log" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/runtime/v2/shim_load.go b/runtime/v2/shim_load.go index 70313b3661a5e..7b0b4c8b736f6 100644 --- a/runtime/v2/shim_load.go +++ b/runtime/v2/shim_load.go @@ -23,10 +23,10 @@ import ( "path/filepath" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/cleanup" + "github.com/containerd/log" ) func (m *ShimManager) loadExistingTasks(ctx context.Context) error { diff --git a/services/content/contentserver/contentserver.go b/services/content/contentserver/contentserver.go index 683f883b04ad9..769250c0f35cc 100644 --- a/services/content/contentserver/contentserver.go +++ b/services/content/contentserver/contentserver.go @@ -25,9 +25,9 @@ import ( api "github.com/containerd/containerd/api/services/content/v1" "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/grpc" diff --git a/services/images/local.go b/services/images/local.go index 0c934bf6671c3..5166c9a206f19 100644 --- a/services/images/local.go +++ b/services/images/local.go @@ -25,12 +25,12 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/gc" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/pkg/epoch" "github.com/containerd/containerd/plugin" ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" + "github.com/containerd/log" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/services/introspection/introspection.go b/services/introspection/introspection.go index 7f88af4f9feb3..82954d5f4f1d4 100644 --- a/services/introspection/introspection.go +++ b/services/introspection/introspection.go @@ -21,8 +21,8 @@ import ( api "github.com/containerd/containerd/api/services/introspection/v1" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/log" ) // Service defines the introspection service interface diff --git a/services/sandbox/controller_service.go b/services/sandbox/controller_service.go index 64c7159cd6962..61682dc46fb57 100644 --- a/services/sandbox/controller_service.go +++ b/services/sandbox/controller_service.go @@ -26,10 +26,10 @@ import ( api "github.com/containerd/containerd/api/services/sandbox/v1" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/sandbox" + "github.com/containerd/log" ) func init() { diff --git a/services/sandbox/store_service.go b/services/sandbox/store_service.go index a5a8a9c3f3d6a..5110a291c3bfa 100644 --- a/services/sandbox/store_service.go +++ b/services/sandbox/store_service.go @@ -24,9 +24,9 @@ import ( api "github.com/containerd/containerd/api/services/sandbox/v1" "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/sandbox" + "github.com/containerd/log" ) func init() { diff --git a/services/server/server.go b/services/server/server.go index a758a7fc9322a..96e6ee4bfba1e 100644 --- a/services/server/server.go +++ b/services/server/server.go @@ -41,7 +41,6 @@ import ( "github.com/containerd/containerd/defaults" "github.com/containerd/containerd/diff" diffproxy "github.com/containerd/containerd/diff/proxy" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/dialer" "github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/platforms" @@ -49,6 +48,7 @@ import ( srvconfig "github.com/containerd/containerd/services/server/config" ssproxy "github.com/containerd/containerd/snapshots/proxy" "github.com/containerd/containerd/sys" + "github.com/containerd/log" "github.com/containerd/ttrpc" "github.com/docker/go-metrics" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" diff --git a/services/server/server_linux.go b/services/server/server_linux.go index 63cf36a31fb1a..d1c219d2bc6cc 100644 --- a/services/server/server_linux.go +++ b/services/server/server_linux.go @@ -23,9 +23,9 @@ import ( "github.com/containerd/cgroups/v3" cgroup1 "github.com/containerd/cgroups/v3/cgroup1" cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2" - "github.com/containerd/containerd/log" srvconfig "github.com/containerd/containerd/services/server/config" "github.com/containerd/containerd/sys" + "github.com/containerd/log" "github.com/containerd/ttrpc" specs "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/services/snapshots/service.go b/services/snapshots/service.go index 8a760f40c1e0f..5c1334338b80f 100644 --- a/services/snapshots/service.go +++ b/services/snapshots/service.go @@ -22,12 +22,12 @@ import ( snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/plugin" ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" "google.golang.org/grpc" ) diff --git a/services/streaming/service.go b/services/streaming/service.go index f7a8bee94f1ca..0e445f1a50051 100644 --- a/services/streaming/service.go +++ b/services/streaming/service.go @@ -22,11 +22,11 @@ import ( api "github.com/containerd/containerd/api/services/streaming/v1" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "google.golang.org/grpc" ) diff --git a/services/tasks/local.go b/services/tasks/local.go index a7892a824a63d..f17dd4bc4ca5e 100644 --- a/services/tasks/local.go +++ b/services/tasks/local.go @@ -35,7 +35,6 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/blockio" @@ -48,6 +47,7 @@ import ( "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/services" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/services/transfer/service.go b/services/transfer/service.go index 4b48b159e55be..7f98c3ef0f2b4 100644 --- a/services/transfer/service.go +++ b/services/transfer/service.go @@ -22,12 +22,12 @@ import ( transferapi "github.com/containerd/containerd/api/services/transfer/v1" transferTypes "github.com/containerd/containerd/api/types/transfer" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer/plugins" "github.com/containerd/containerd/plugin" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/snapshots/benchsuite/benchmark_test.go b/snapshots/benchsuite/benchmark_test.go index 9aca157eb425e..f056309cf71de 100644 --- a/snapshots/benchsuite/benchmark_test.go +++ b/snapshots/benchsuite/benchmark_test.go @@ -32,12 +32,12 @@ import ( "github.com/containerd/continuity/fs/fstest" "github.com/stretchr/testify/assert" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/devmapper" "github.com/containerd/containerd/snapshots/native" "github.com/containerd/containerd/snapshots/overlay" + "github.com/containerd/log" ) var ( diff --git a/snapshots/blockfile/blockfile.go b/snapshots/blockfile/blockfile.go index 7763b8990eff8..11fefa9303b12 100644 --- a/snapshots/blockfile/blockfile.go +++ b/snapshots/blockfile/blockfile.go @@ -24,12 +24,12 @@ import ( "path/filepath" "runtime" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ) // viewHookHelper is only used in test for recover the filesystem. diff --git a/snapshots/btrfs/btrfs.go b/snapshots/btrfs/btrfs.go index b91f0cb63eea9..ce558c5f476a9 100644 --- a/snapshots/btrfs/btrfs.go +++ b/snapshots/btrfs/btrfs.go @@ -28,11 +28,11 @@ import ( "github.com/containerd/btrfs/v2" "github.com/containerd/continuity/fs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" + "github.com/containerd/log" ) type snapshotter struct { diff --git a/snapshots/devmapper/pool_device.go b/snapshots/devmapper/pool_device.go index b69489faa8602..d921fb884c7b4 100644 --- a/snapshots/devmapper/pool_device.go +++ b/snapshots/devmapper/pool_device.go @@ -28,9 +28,9 @@ import ( "golang.org/x/sys/unix" - "github.com/containerd/containerd/log" blkdiscard "github.com/containerd/containerd/snapshots/devmapper/blkdiscard" "github.com/containerd/containerd/snapshots/devmapper/dmsetup" + "github.com/containerd/log" ) // PoolDevice ties together data and metadata volumes, represents thin-pool and manages volumes, snapshots and device ids. diff --git a/snapshots/devmapper/pool_device_test.go b/snapshots/devmapper/pool_device_test.go index da8abac1c38bf..dc6b89ae287b7 100644 --- a/snapshots/devmapper/pool_device_test.go +++ b/snapshots/devmapper/pool_device_test.go @@ -26,10 +26,10 @@ import ( "testing" "time" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/snapshots/devmapper/dmsetup" + "github.com/containerd/log" "github.com/docker/go-units" "github.com/stretchr/testify/assert" exec "golang.org/x/sys/execabs" diff --git a/snapshots/devmapper/snapshotter.go b/snapshots/devmapper/snapshotter.go index a96da4c4569b6..1bc137d229610 100644 --- a/snapshots/devmapper/snapshotter.go +++ b/snapshots/devmapper/snapshotter.go @@ -28,11 +28,11 @@ import ( "sync" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/devmapper/dmsetup" "github.com/containerd/containerd/snapshots/storage" + "github.com/containerd/log" exec "golang.org/x/sys/execabs" ) diff --git a/snapshots/devmapper/snapshotter_test.go b/snapshots/devmapper/snapshotter_test.go index 72bcc2c3a68b5..f0964eab3f52a 100644 --- a/snapshots/devmapper/snapshotter_test.go +++ b/snapshots/devmapper/snapshotter_test.go @@ -29,13 +29,13 @@ import ( "github.com/containerd/continuity/fs/fstest" "github.com/stretchr/testify/assert" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/devmapper/dmsetup" "github.com/containerd/containerd/snapshots/testsuite" + "github.com/containerd/log" ) func TestSnapshotterSuite(t *testing.T) { diff --git a/snapshots/lcow/lcow.go b/snapshots/lcow/lcow.go index a0868e72d0e68..bbcda4423c4e6 100644 --- a/snapshots/lcow/lcow.go +++ b/snapshots/lcow/lcow.go @@ -35,12 +35,12 @@ import ( winfs "github.com/Microsoft/go-winio/pkg/fs" "github.com/Microsoft/hcsshim/pkg/go-runhcs" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/snapshots/native/native.go b/snapshots/native/native.go index dba94b93fc7b1..5277b8179cd0b 100644 --- a/snapshots/native/native.go +++ b/snapshots/native/native.go @@ -22,10 +22,10 @@ import ( "os" "path/filepath" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" + "github.com/containerd/log" "github.com/containerd/continuity/fs" ) diff --git a/snapshots/overlay/overlay.go b/snapshots/overlay/overlay.go index e566aa5c6a641..edd2957786021 100644 --- a/snapshots/overlay/overlay.go +++ b/snapshots/overlay/overlay.go @@ -26,12 +26,12 @@ import ( "strings" "syscall" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/overlay/overlayutils" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ) // upperdirKey is a key of an optional label to each snapshot. diff --git a/snapshots/overlay/overlayutils/check.go b/snapshots/overlay/overlayutils/check.go index 75cf2ed8c5655..e94c95a88b682 100644 --- a/snapshots/overlay/overlayutils/check.go +++ b/snapshots/overlay/overlayutils/check.go @@ -27,10 +27,10 @@ import ( "golang.org/x/sys/unix" kernel "github.com/containerd/containerd/contrib/seccomp/kernelversion" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ) const ( diff --git a/snapshots/storage/metastore.go b/snapshots/storage/metastore.go index c0261731c6e19..2f7beac1be1c4 100644 --- a/snapshots/storage/metastore.go +++ b/snapshots/storage/metastore.go @@ -27,8 +27,8 @@ import ( "fmt" "sync" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/snapshots/testsuite/testsuite.go b/snapshots/testsuite/testsuite.go index 36982adab84c3..2184cbf40ba55 100644 --- a/snapshots/testsuite/testsuite.go +++ b/snapshots/testsuite/testsuite.go @@ -29,13 +29,13 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/randutil" "github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/snapshots" "github.com/containerd/continuity/fs/fstest" + "github.com/containerd/log/logtest" "github.com/stretchr/testify/assert" ) diff --git a/snapshots/windows/windows.go b/snapshots/windows/windows.go index b96041b1eaeda..c651f1d971145 100644 --- a/snapshots/windows/windows.go +++ b/snapshots/windows/windows.go @@ -35,13 +35,13 @@ import ( "github.com/Microsoft/hcsshim" "github.com/Microsoft/hcsshim/pkg/ociwclayer" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/tracing/plugin/otlp.go b/tracing/plugin/otlp.go index 15a829143dc75..0a390cc2d1d91 100644 --- a/tracing/plugin/otlp.go +++ b/tracing/plugin/otlp.go @@ -24,9 +24,9 @@ import ( "time" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/tracing" + "github.com/containerd/log" "github.com/sirupsen/logrus" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/otlp/otlptrace" From 195c29a4bc1ecd23168a292d12be254fecd802aa Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 11 Sep 2023 21:28:02 -0700 Subject: [PATCH 2/3] Add github.com/containerd/log to go.mod Signed-off-by: Derek McGowan --- go.mod | 1 + go.sum | 2 + integration/client/go.mod | 1 + integration/client/go.sum | 2 + .../github.com/containerd/log/.golangci.yml | 30 +++ vendor/github.com/containerd/log/LICENSE | 191 ++++++++++++++++++ vendor/github.com/containerd/log/README.md | 17 ++ vendor/github.com/containerd/log/context.go | 182 +++++++++++++++++ .../containerd/log/logtest/context.go | 56 +++++ .../containerd/log/logtest/log_hook.go | 50 +++++ vendor/modules.txt | 4 + 11 files changed, 536 insertions(+) create mode 100644 vendor/github.com/containerd/log/.golangci.yml create mode 100644 vendor/github.com/containerd/log/LICENSE create mode 100644 vendor/github.com/containerd/log/README.md create mode 100644 vendor/github.com/containerd/log/context.go create mode 100644 vendor/github.com/containerd/log/logtest/context.go create mode 100644 vendor/github.com/containerd/log/logtest/log_hook.go diff --git a/go.mod b/go.mod index cc820f967b8ea..3c522806759c2 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/containerd/go-cni v1.1.9 github.com/containerd/go-runc v1.1.0 github.com/containerd/imgcrypt v1.1.7 + github.com/containerd/log v0.1.0 github.com/containerd/nri v0.3.0 github.com/containerd/ttrpc v1.2.2 github.com/containerd/typeurl/v2 v2.1.1 diff --git a/go.sum b/go.sum index 6212eb141f8c4..6af7586da4acc 100644 --- a/go.sum +++ b/go.sum @@ -267,6 +267,8 @@ github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= github.com/containerd/imgcrypt v1.1.7 h1:WSf9o9EQ0KGHiUx2ESFZ+PKf4nxK9BcvV/nJDX8RkB4= github.com/containerd/imgcrypt v1.1.7/go.mod h1:FD8gqIcX5aTotCtOmjeCsi3A1dHmTZpnMISGKSczt4k= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= diff --git a/integration/client/go.mod b/integration/client/go.mod index 6d9fa8ba19056..e298cb24e76fa 100644 --- a/integration/client/go.mod +++ b/integration/client/go.mod @@ -10,6 +10,7 @@ require ( github.com/containerd/containerd v1.7.0 // see replace; the actual version of containerd is replaced with the code at the root of this repository github.com/containerd/continuity v0.4.2 github.com/containerd/go-runc v1.1.0 + github.com/containerd/log v0.1.0 github.com/containerd/ttrpc v1.2.2 github.com/containerd/typeurl/v2 v2.1.1 github.com/opencontainers/go-digest v1.0.0 diff --git a/integration/client/go.sum b/integration/client/go.sum index 86e2486cc61ca..809cd7de273c5 100644 --- a/integration/client/go.sum +++ b/integration/client/go.sum @@ -898,6 +898,8 @@ github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDX github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gGleA= github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U= github.com/containerd/imgcrypt v1.1.7/go.mod h1:FD8gqIcX5aTotCtOmjeCsi3A1dHmTZpnMISGKSczt4k= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/nri v0.3.0/go.mod h1:Zw9q2lP16sdg0zYybemZ9yTDy8g7fPCIB3KXOGlggXI= github.com/containerd/protobuild v0.3.0/go.mod h1:5mNMFKKAwCIAkFBPiOdtRx2KiQlyEJeMXnL5R1DsWu8= github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= diff --git a/vendor/github.com/containerd/log/.golangci.yml b/vendor/github.com/containerd/log/.golangci.yml new file mode 100644 index 0000000000000..a695775df49d9 --- /dev/null +++ b/vendor/github.com/containerd/log/.golangci.yml @@ -0,0 +1,30 @@ +linters: + enable: + - exportloopref # Checks for pointers to enclosing loop variables + - gofmt + - goimports + - gosec + - ineffassign + - misspell + - nolintlint + - revive + - staticcheck + - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17 + - unconvert + - unused + - vet + - dupword # Checks for duplicate words in the source code + disable: + - errcheck + +run: + timeout: 5m + skip-dirs: + - api + - cluster + - design + - docs + - docs/man + - releases + - reports + - test # e2e scripts diff --git a/vendor/github.com/containerd/log/LICENSE b/vendor/github.com/containerd/log/LICENSE new file mode 100644 index 0000000000000..584149b6ee28c --- /dev/null +++ b/vendor/github.com/containerd/log/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright The containerd Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/containerd/log/README.md b/vendor/github.com/containerd/log/README.md new file mode 100644 index 0000000000000..00e084988018c --- /dev/null +++ b/vendor/github.com/containerd/log/README.md @@ -0,0 +1,17 @@ +# log + +A Go package providing a common logging interface across containerd repositories and a way for clients to use and configure logging in containerd packages. + +This package is not intended to be used as a standalone logging package outside of the containerd ecosystem and is intended as an interface wrapper around a logging implementation. +In the future this package may be replaced with a common go logging interface. + +## Project details + +**log** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). +As a containerd sub-project, you will find the: + * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), + * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), + * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) + +information in our [`containerd/project`](https://github.com/containerd/project) repository. + diff --git a/vendor/github.com/containerd/log/context.go b/vendor/github.com/containerd/log/context.go new file mode 100644 index 0000000000000..20153066f3a7b --- /dev/null +++ b/vendor/github.com/containerd/log/context.go @@ -0,0 +1,182 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package log provides types and functions related to logging, passing +// loggers through a context, and attaching context to the logger. +// +// # Transitional types +// +// This package contains various types that are aliases for types in [logrus]. +// These aliases are intended for transitioning away from hard-coding logrus +// as logging implementation. Consumers of this package are encouraged to use +// the type-aliases from this package instead of directly using their logrus +// equivalent. +// +// The intent is to replace these aliases with locally defined types and +// interfaces once all consumers are no longer directly importing logrus +// types. +// +// IMPORTANT: due to the transitional purpose of this package, it is not +// guaranteed for the full logrus API to be provided in the future. As +// outlined, these aliases are provided as a step to transition away from +// a specific implementation which, as a result, exposes the full logrus API. +// While no decisions have been made on the ultimate design and interface +// provided by this package, we do not expect carrying "less common" features. +package log + +import ( + "context" + "fmt" + + "github.com/sirupsen/logrus" +) + +// G is a shorthand for [GetLogger]. +// +// We may want to define this locally to a package to get package tagged log +// messages. +var G = GetLogger + +// L is an alias for the standard logger. +var L = &Entry{ + Logger: logrus.StandardLogger(), + // Default is three fields plus a little extra room. + Data: make(Fields, 6), +} + +type loggerKey struct{} + +// Fields type to pass to "WithFields". +type Fields = map[string]any + +// Entry is a logging entry. It contains all the fields passed with +// [Entry.WithFields]. It's finally logged when Trace, Debug, Info, Warn, +// Error, Fatal or Panic is called on it. These objects can be reused and +// passed around as much as you wish to avoid field duplication. +// +// Entry is a transitional type, and currently an alias for [logrus.Entry]. +type Entry = logrus.Entry + +// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using +// zeros to ensure the formatted time is always the same number of +// characters. +const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" + +// Level is a logging level. +type Level = logrus.Level + +// Supported log levels. +const ( + // TraceLevel level. Designates finer-grained informational events + // than [DebugLevel]. + TraceLevel Level = logrus.TraceLevel + + // DebugLevel level. Usually only enabled when debugging. Very verbose + // logging. + DebugLevel Level = logrus.DebugLevel + + // InfoLevel level. General operational entries about what's going on + // inside the application. + InfoLevel Level = logrus.InfoLevel + + // WarnLevel level. Non-critical entries that deserve eyes. + WarnLevel Level = logrus.WarnLevel + + // ErrorLevel level. Logs errors that should definitely be noted. + // Commonly used for hooks to send errors to an error tracking service. + ErrorLevel Level = logrus.ErrorLevel + + // FatalLevel level. Logs and then calls "logger.Exit(1)". It exits + // even if the logging level is set to Panic. + FatalLevel Level = logrus.FatalLevel + + // PanicLevel level. This is the highest level of severity. Logs and + // then calls panic with the message passed to Debug, Info, ... + PanicLevel Level = logrus.PanicLevel +) + +// SetLevel sets log level globally. It returns an error if the given +// level is not supported. +// +// level can be one of: +// +// - "trace" ([TraceLevel]) +// - "debug" ([DebugLevel]) +// - "info" ([InfoLevel]) +// - "warn" ([WarnLevel]) +// - "error" ([ErrorLevel]) +// - "fatal" ([FatalLevel]) +// - "panic" ([PanicLevel]) +func SetLevel(level string) error { + lvl, err := logrus.ParseLevel(level) + if err != nil { + return err + } + + L.Logger.SetLevel(lvl) + return nil +} + +// GetLevel returns the current log level. +func GetLevel() Level { + return L.Logger.GetLevel() +} + +// OutputFormat specifies a log output format. +type OutputFormat string + +// Supported log output formats. +const ( + // TextFormat represents the text logging format. + TextFormat OutputFormat = "text" + + // JSONFormat represents the JSON logging format. + JSONFormat OutputFormat = "json" +) + +// SetFormat sets the log output format ([TextFormat] or [JSONFormat]). +func SetFormat(format OutputFormat) error { + switch format { + case TextFormat: + L.Logger.SetFormatter(&logrus.TextFormatter{ + TimestampFormat: RFC3339NanoFixed, + FullTimestamp: true, + }) + return nil + case JSONFormat: + L.Logger.SetFormatter(&logrus.JSONFormatter{ + TimestampFormat: RFC3339NanoFixed, + }) + return nil + default: + return fmt.Errorf("unknown log format: %s", format) + } +} + +// WithLogger returns a new context with the provided logger. Use in +// combination with logger.WithField(s) for great effect. +func WithLogger(ctx context.Context, logger *Entry) context.Context { + return context.WithValue(ctx, loggerKey{}, logger.WithContext(ctx)) +} + +// GetLogger retrieves the current logger from the context. If no logger is +// available, the default logger is returned. +func GetLogger(ctx context.Context) *Entry { + if logger := ctx.Value(loggerKey{}); logger != nil { + return logger.(*Entry) + } + return L.WithContext(ctx) +} diff --git a/vendor/github.com/containerd/log/logtest/context.go b/vendor/github.com/containerd/log/logtest/context.go new file mode 100644 index 0000000000000..cbf3882f1b6a0 --- /dev/null +++ b/vendor/github.com/containerd/log/logtest/context.go @@ -0,0 +1,56 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package logtest + +import ( + "context" + "fmt" + "io" + "path/filepath" + "runtime" + "testing" + + "github.com/containerd/log" + "github.com/sirupsen/logrus" +) + +// WithT adds a logging hook for the given test +// Changes debug level to debug, clears output, and +// outputs all log messages as test logs. +func WithT(ctx context.Context, t testing.TB) context.Context { + // Create a new logger to avoid adding hooks from multiple tests + l := logrus.New() + + // Increase debug level for tests + l.SetLevel(logrus.DebugLevel) + l.SetOutput(io.Discard) + l.SetReportCaller(true) + + // Add testing hook + l.AddHook(&testHook{ + t: t, + fmt: &logrus.TextFormatter{ + DisableColors: true, + TimestampFormat: log.RFC3339NanoFixed, + CallerPrettyfier: func(frame *runtime.Frame) (string, string) { + return filepath.Base(frame.Function), fmt.Sprintf("%s:%d", frame.File, frame.Line) + }, + }, + }) + + return log.WithLogger(ctx, logrus.NewEntry(l).WithField("testcase", t.Name())) +} diff --git a/vendor/github.com/containerd/log/logtest/log_hook.go b/vendor/github.com/containerd/log/logtest/log_hook.go new file mode 100644 index 0000000000000..f865e39e4751a --- /dev/null +++ b/vendor/github.com/containerd/log/logtest/log_hook.go @@ -0,0 +1,50 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package logtest + +import ( + "bytes" + "sync" + "testing" + + "github.com/sirupsen/logrus" +) + +type testHook struct { + t testing.TB + fmt logrus.Formatter + mu sync.Mutex +} + +func (*testHook) Levels() []logrus.Level { + return logrus.AllLevels +} + +func (h *testHook) Fire(e *logrus.Entry) error { + s, err := h.fmt.Format(e) + if err != nil { + return err + } + + // Because the logger could be called from multiple goroutines, + // but t.Log() is not designed for. + h.mu.Lock() + defer h.mu.Unlock() + h.t.Log(string(bytes.TrimRight(s, "\n"))) + + return nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 1338e83d3c214..eec0c7b1e2fe7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -127,6 +127,10 @@ github.com/containerd/go-runc ## explicit; go 1.16 github.com/containerd/imgcrypt github.com/containerd/imgcrypt/images/encryption +# github.com/containerd/log v0.1.0 +## explicit; go 1.20 +github.com/containerd/log +github.com/containerd/log/logtest # github.com/containerd/nri v0.3.0 ## explicit; go 1.19 github.com/containerd/nri From 98aa213af33e1a624efc39879e4a64fa95c9033c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 12 Sep 2023 15:46:33 +0200 Subject: [PATCH 3/3] migrate log package to github.com/containerd/log v0.1.0 Signed-off-by: Sebastiaan van Stijn --- log/context.go | 182 ------------------ log/context_deprecated.go | 149 ++++++++++++++ log/context_test.go | 63 ------ log/logtest/context.go | 56 ------ .../{log_hook.go => context_deprecated.go} | 35 +--- 5 files changed, 158 insertions(+), 327 deletions(-) delete mode 100644 log/context.go create mode 100644 log/context_deprecated.go delete mode 100644 log/context_test.go delete mode 100644 log/logtest/context.go rename log/logtest/{log_hook.go => context_deprecated.go} (56%) diff --git a/log/context.go b/log/context.go deleted file mode 100644 index 20153066f3a7b..0000000000000 --- a/log/context.go +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package log provides types and functions related to logging, passing -// loggers through a context, and attaching context to the logger. -// -// # Transitional types -// -// This package contains various types that are aliases for types in [logrus]. -// These aliases are intended for transitioning away from hard-coding logrus -// as logging implementation. Consumers of this package are encouraged to use -// the type-aliases from this package instead of directly using their logrus -// equivalent. -// -// The intent is to replace these aliases with locally defined types and -// interfaces once all consumers are no longer directly importing logrus -// types. -// -// IMPORTANT: due to the transitional purpose of this package, it is not -// guaranteed for the full logrus API to be provided in the future. As -// outlined, these aliases are provided as a step to transition away from -// a specific implementation which, as a result, exposes the full logrus API. -// While no decisions have been made on the ultimate design and interface -// provided by this package, we do not expect carrying "less common" features. -package log - -import ( - "context" - "fmt" - - "github.com/sirupsen/logrus" -) - -// G is a shorthand for [GetLogger]. -// -// We may want to define this locally to a package to get package tagged log -// messages. -var G = GetLogger - -// L is an alias for the standard logger. -var L = &Entry{ - Logger: logrus.StandardLogger(), - // Default is three fields plus a little extra room. - Data: make(Fields, 6), -} - -type loggerKey struct{} - -// Fields type to pass to "WithFields". -type Fields = map[string]any - -// Entry is a logging entry. It contains all the fields passed with -// [Entry.WithFields]. It's finally logged when Trace, Debug, Info, Warn, -// Error, Fatal or Panic is called on it. These objects can be reused and -// passed around as much as you wish to avoid field duplication. -// -// Entry is a transitional type, and currently an alias for [logrus.Entry]. -type Entry = logrus.Entry - -// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using -// zeros to ensure the formatted time is always the same number of -// characters. -const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" - -// Level is a logging level. -type Level = logrus.Level - -// Supported log levels. -const ( - // TraceLevel level. Designates finer-grained informational events - // than [DebugLevel]. - TraceLevel Level = logrus.TraceLevel - - // DebugLevel level. Usually only enabled when debugging. Very verbose - // logging. - DebugLevel Level = logrus.DebugLevel - - // InfoLevel level. General operational entries about what's going on - // inside the application. - InfoLevel Level = logrus.InfoLevel - - // WarnLevel level. Non-critical entries that deserve eyes. - WarnLevel Level = logrus.WarnLevel - - // ErrorLevel level. Logs errors that should definitely be noted. - // Commonly used for hooks to send errors to an error tracking service. - ErrorLevel Level = logrus.ErrorLevel - - // FatalLevel level. Logs and then calls "logger.Exit(1)". It exits - // even if the logging level is set to Panic. - FatalLevel Level = logrus.FatalLevel - - // PanicLevel level. This is the highest level of severity. Logs and - // then calls panic with the message passed to Debug, Info, ... - PanicLevel Level = logrus.PanicLevel -) - -// SetLevel sets log level globally. It returns an error if the given -// level is not supported. -// -// level can be one of: -// -// - "trace" ([TraceLevel]) -// - "debug" ([DebugLevel]) -// - "info" ([InfoLevel]) -// - "warn" ([WarnLevel]) -// - "error" ([ErrorLevel]) -// - "fatal" ([FatalLevel]) -// - "panic" ([PanicLevel]) -func SetLevel(level string) error { - lvl, err := logrus.ParseLevel(level) - if err != nil { - return err - } - - L.Logger.SetLevel(lvl) - return nil -} - -// GetLevel returns the current log level. -func GetLevel() Level { - return L.Logger.GetLevel() -} - -// OutputFormat specifies a log output format. -type OutputFormat string - -// Supported log output formats. -const ( - // TextFormat represents the text logging format. - TextFormat OutputFormat = "text" - - // JSONFormat represents the JSON logging format. - JSONFormat OutputFormat = "json" -) - -// SetFormat sets the log output format ([TextFormat] or [JSONFormat]). -func SetFormat(format OutputFormat) error { - switch format { - case TextFormat: - L.Logger.SetFormatter(&logrus.TextFormatter{ - TimestampFormat: RFC3339NanoFixed, - FullTimestamp: true, - }) - return nil - case JSONFormat: - L.Logger.SetFormatter(&logrus.JSONFormatter{ - TimestampFormat: RFC3339NanoFixed, - }) - return nil - default: - return fmt.Errorf("unknown log format: %s", format) - } -} - -// WithLogger returns a new context with the provided logger. Use in -// combination with logger.WithField(s) for great effect. -func WithLogger(ctx context.Context, logger *Entry) context.Context { - return context.WithValue(ctx, loggerKey{}, logger.WithContext(ctx)) -} - -// GetLogger retrieves the current logger from the context. If no logger is -// available, the default logger is returned. -func GetLogger(ctx context.Context) *Entry { - if logger := ctx.Value(loggerKey{}); logger != nil { - return logger.(*Entry) - } - return L.WithContext(ctx) -} diff --git a/log/context_deprecated.go b/log/context_deprecated.go new file mode 100644 index 0000000000000..9e9e8b49135ba --- /dev/null +++ b/log/context_deprecated.go @@ -0,0 +1,149 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package log + +import ( + "context" + + "github.com/containerd/log" +) + +// G is a shorthand for [GetLogger]. +// +// Deprecated: use [log.G]. +var G = log.G + +// L is an alias for the standard logger. +// +// Deprecated: use [log.L]. +var L = log.L + +// Fields type to pass to "WithFields". +// +// Deprecated: use [log.Fields]. +type Fields = log.Fields + +// Entry is a logging entry. +// +// Deprecated: use [log.Entry]. +type Entry = log.Entry + +// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using +// zeros to ensure the formatted time is always the same number of +// characters. +// +// Deprecated: use [log.RFC3339NanoFixed]. +const RFC3339NanoFixed = log.RFC3339NanoFixed + +// Level is a logging level. +// +// Deprecated: use [log.Level]. +type Level = log.Level + +// Supported log levels. +const ( + // TraceLevel level. + // + // Deprecated: use [log.TraceLevel]. + TraceLevel Level = log.TraceLevel + + // DebugLevel level. + // + // Deprecated: use [log.DebugLevel]. + DebugLevel Level = log.DebugLevel + + // InfoLevel level. + // + // Deprecated: use [log.InfoLevel]. + InfoLevel Level = log.InfoLevel + + // WarnLevel level. + // + // Deprecated: use [log.WarnLevel]. + WarnLevel Level = log.WarnLevel + + // ErrorLevel level + // + // Deprecated: use [log.ErrorLevel]. + ErrorLevel Level = log.ErrorLevel + + // FatalLevel level. + // + // Deprecated: use [log.FatalLevel]. + FatalLevel Level = log.FatalLevel + + // PanicLevel level. + // + // Deprecated: use [log.PanicLevel]. + PanicLevel Level = log.PanicLevel +) + +// SetLevel sets log level globally. It returns an error if the given +// level is not supported. +// +// Deprecated: use [log.SetLevel]. +func SetLevel(level string) error { + return log.SetLevel(level) +} + +// GetLevel returns the current log level. +// +// Deprecated: use [log.GetLevel]. +func GetLevel() log.Level { + return log.GetLevel() +} + +// OutputFormat specifies a log output format. +// +// Deprecated: use [log.OutputFormat]. +type OutputFormat = log.OutputFormat + +// Supported log output formats. +const ( + // TextFormat represents the text logging format. + // + // Deprecated: use [log.TextFormat]. + TextFormat log.OutputFormat = "text" + + // JSONFormat represents the JSON logging format. + // + // Deprecated: use [log.JSONFormat]. + JSONFormat log.OutputFormat = "json" +) + +// SetFormat sets the log output format. +// +// Deprecated: use [log.SetFormat]. +func SetFormat(format OutputFormat) error { + return log.SetFormat(format) +} + +// WithLogger returns a new context with the provided logger. Use in +// combination with logger.WithField(s) for great effect. +// +// Deprecated: use [log.WithLogger]. +func WithLogger(ctx context.Context, logger *log.Entry) context.Context { + return log.WithLogger(ctx, logger) +} + +// GetLogger retrieves the current logger from the context. If no logger is +// available, the default logger is returned. +// +// Deprecated: use [log.GetLogger]. +func GetLogger(ctx context.Context) *log.Entry { + return log.GetLogger(ctx) +} diff --git a/log/context_test.go b/log/context_test.go deleted file mode 100644 index 1b6d4a6cf7abc..0000000000000 --- a/log/context_test.go +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package log - -import ( - "context" - "reflect" - "testing" - - "github.com/sirupsen/logrus" -) - -func TestLoggerContext(t *testing.T) { - const expected = "one" - ctx := context.Background() - ctx = WithLogger(ctx, G(ctx).WithField("test", expected)) - if actual := GetLogger(ctx).Data["test"]; actual != expected { - t.Errorf("expected: %v, got: %v", expected, actual) - } - a := G(ctx) - b := GetLogger(ctx) - if !reflect.DeepEqual(a, b) || a != b { - t.Errorf("should be the same: %+v, %+v", a, b) - } -} - -func TestCompat(t *testing.T) { - expected := Fields{ - "hello1": "world1", - "hello2": "world2", - "hello3": "world3", - } - - l := G(context.TODO()) - l = l.WithFields(logrus.Fields{"hello1": "world1"}) - l = l.WithFields(Fields{"hello2": "world2"}) - l = l.WithFields(map[string]any{"hello3": "world3"}) - if !reflect.DeepEqual(Fields(l.Data), expected) { - t.Errorf("expected: (%[1]T) %+[1]v, got: (%[2]T) %+[2]v", expected, l.Data) - } - - l2 := L - l2 = l2.WithFields(logrus.Fields{"hello1": "world1"}) - l2 = l2.WithFields(Fields{"hello2": "world2"}) - l2 = l2.WithFields(map[string]any{"hello3": "world3"}) - if !reflect.DeepEqual(Fields(l2.Data), expected) { - t.Errorf("expected: (%[1]T) %+[1]v, got: (%[2]T) %+[2]v", expected, l2.Data) - } -} diff --git a/log/logtest/context.go b/log/logtest/context.go deleted file mode 100644 index cbf3882f1b6a0..0000000000000 --- a/log/logtest/context.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package logtest - -import ( - "context" - "fmt" - "io" - "path/filepath" - "runtime" - "testing" - - "github.com/containerd/log" - "github.com/sirupsen/logrus" -) - -// WithT adds a logging hook for the given test -// Changes debug level to debug, clears output, and -// outputs all log messages as test logs. -func WithT(ctx context.Context, t testing.TB) context.Context { - // Create a new logger to avoid adding hooks from multiple tests - l := logrus.New() - - // Increase debug level for tests - l.SetLevel(logrus.DebugLevel) - l.SetOutput(io.Discard) - l.SetReportCaller(true) - - // Add testing hook - l.AddHook(&testHook{ - t: t, - fmt: &logrus.TextFormatter{ - DisableColors: true, - TimestampFormat: log.RFC3339NanoFixed, - CallerPrettyfier: func(frame *runtime.Frame) (string, string) { - return filepath.Base(frame.Function), fmt.Sprintf("%s:%d", frame.File, frame.Line) - }, - }, - }) - - return log.WithLogger(ctx, logrus.NewEntry(l).WithField("testcase", t.Name())) -} diff --git a/log/logtest/log_hook.go b/log/logtest/context_deprecated.go similarity index 56% rename from log/logtest/log_hook.go rename to log/logtest/context_deprecated.go index f865e39e4751a..10bbea611eb39 100644 --- a/log/logtest/log_hook.go +++ b/log/logtest/context_deprecated.go @@ -17,34 +17,17 @@ package logtest import ( - "bytes" - "sync" + "context" "testing" - "github.com/sirupsen/logrus" + "github.com/containerd/log/logtest" ) -type testHook struct { - t testing.TB - fmt logrus.Formatter - mu sync.Mutex -} - -func (*testHook) Levels() []logrus.Level { - return logrus.AllLevels -} - -func (h *testHook) Fire(e *logrus.Entry) error { - s, err := h.fmt.Format(e) - if err != nil { - return err - } - - // Because the logger could be called from multiple goroutines, - // but t.Log() is not designed for. - h.mu.Lock() - defer h.mu.Unlock() - h.t.Log(string(bytes.TrimRight(s, "\n"))) - - return nil +// WithT adds a logging hook for the given test +// Changes debug level to debug, clears output, and +// outputs all log messages as test logs. +// +// Deprecated: use [logtest.WithT]. +func WithT(ctx context.Context, t testing.TB) context.Context { + return logtest.WithT(ctx, t) }