Skip to content

Commit

Permalink
revert "Switch to using new errdefs repo"
Browse files Browse the repository at this point in the history
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
  • Loading branch information
yankay committed Sep 23, 2024
1 parent 0b833cc commit 1edb1bc
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ issues:
- staticcheck
text: "^SA1019: .*nodenetsvc[/]?v0"

# the `github.com/containerd/containerd/errdefs` is compatibility with containerd v1.7
- linters:
- staticcheck
text: "^SA1019: .*github.com/containerd/containerd/errdefs"

- path: internal\\vhdx\\info
linters:
- stylecheck
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"context"

task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/exec_hcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
eventstypes "github.com/containerd/containerd/api/events"
task "github.com/containerd/containerd/api/runtime/task/v2"
containerd_v1_types "github.com/containerd/containerd/api/types/task"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime"
"github.com/containerd/errdefs"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
eventstypes "github.com/containerd/containerd/api/events"
task "github.com/containerd/containerd/api/runtime/task/v2"
containerd_v1_types "github.com/containerd/containerd/api/types/task"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime"
"github.com/containerd/errdefs"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

task "github.com/containerd/containerd/api/runtime/task/v2"
containerd_v1_types "github.com/containerd/containerd/api/types/task"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
)

func verifyWcowPodSandboxExecStatus(t *testing.T, wasStarted bool, es containerd_v1_types.Status, status *task.StateResponse) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/Microsoft/hcsshim/pkg/annotations"
eventstypes "github.com/containerd/containerd/api/events"
task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime"
"github.com/containerd/errdefs"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"golang.org/x/sync/errgroup"
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"

task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
specs "github.com/opencontainers/runtime-spec/specs-go"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"

task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
"go.opencensus.io/trace"
"google.golang.org/protobuf/types/known/emptypb"

Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/service_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

task "github.com/containerd/containerd/api/runtime/task/v2"
containerd_v1_types "github.com/containerd/containerd/api/types/task"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/protobuf"
"github.com/containerd/errdefs"
typeurl "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
"github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats"
task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/protobuf"
"github.com/containerd/errdefs"
typeurl "github.com/containerd/typeurl/v2"
specs "github.com/opencontainers/runtime-spec/specs-go"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/Microsoft/hcsshim/internal/hcsoci"
"github.com/Microsoft/hcsshim/pkg/ctrdtaskapi"
task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/protobuf"
"github.com/containerd/errdefs"
typeurl "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/Microsoft/hcsshim/internal/shimdiag"
"github.com/Microsoft/hcsshim/pkg/ctrdtaskapi"
task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
"github.com/opencontainers/runtime-spec/specs-go"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/task_hcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
eventstypes "github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime"
"github.com/containerd/errdefs"
"github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/task_hcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
)

func setupTestHcsTask(t *testing.T) (*hcsTask, *testShimExec, *testShimExec) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/Microsoft/hcsshim/pkg/ctrdtaskapi"
v1 "github.com/containerd/cgroups/v3/cgroup1/stats"
task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
typeurl "github.com/containerd/typeurl/v2"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/Microsoft/hcsshim/internal/uvm"
eventstypes "github.com/containerd/containerd/api/events"
task "github.com/containerd/containerd/api/runtime/task/v2"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime"
"github.com/containerd/errdefs"
typeurl "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/containerd/console v1.0.4
github.com/containerd/containerd v1.7.21
github.com/containerd/containerd/api v1.7.19
github.com/containerd/errdefs v0.1.0
github.com/containerd/go-runc v1.0.0
github.com/containerd/protobuild v0.3.0
github.com/containerd/ttrpc v1.2.5
Expand Down Expand Up @@ -50,6 +49,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/continuity v0.4.2 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
Expand Down
2 changes: 1 addition & 1 deletion internal/layers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/Microsoft/hcsshim/internal/wclayer"
"github.com/containerd/containerd/api/types"
"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
)

// validateRootfsAndLayers checks to ensure we have appropriate information
Expand Down
4 changes: 2 additions & 2 deletions internal/oc/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net"
"os"

"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand All @@ -16,7 +16,7 @@ import (

func toStatusCode(err error) codes.Code {
// checks if err implements GRPCStatus() *"google.golang.org/grpc/status".Status,
// wraps an error defined in "github.com/containerd/errdefs", or is a
// wraps an error defined in "github.com/containerd/containerd/errdefs", or is a
// context timeout or cancelled error
if s, ok := status.FromError(errdefs.ToGRPC(err)); ok {
return s.Code()
Expand Down
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/containerd/cgroups/v3 v3.0.3
github.com/containerd/containerd v1.7.21
github.com/containerd/containerd/api v1.7.19
github.com/containerd/errdefs v0.1.0
github.com/containerd/go-runc v1.1.0
github.com/containerd/platforms v0.2.1
github.com/containerd/ttrpc v1.2.5
Expand Down Expand Up @@ -43,6 +42,7 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/containerd/continuity v0.4.3 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion test/internal/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"testing"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
kubeutil "github.com/containerd/containerd/integration/remote/util"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/remotes/docker/config"
"github.com/containerd/containerd/snapshots"
"github.com/containerd/errdefs"
"github.com/containerd/platforms"
"github.com/opencontainers/image-spec/identity"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion test/pkg/images/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package images
import (
"fmt"

"github.com/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/platforms"
)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ github.com/containerd/console
## explicit; go 1.21
github.com/containerd/containerd/contrib/seccomp/kernelversion
github.com/containerd/containerd/defaults
github.com/containerd/containerd/errdefs
github.com/containerd/containerd/events
github.com/containerd/containerd/events/exchange
github.com/containerd/containerd/filters
Expand Down

0 comments on commit 1edb1bc

Please # to comment.