MCPcopy Create free account
hub / github.com/containerd/containerd / init

Function init

client/client.go:83–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81)
82
83func init() {
84 const prefix = "types.containerd.io"
85 // register TypeUrls for commonly marshaled external types
86 major := strconv.Itoa(specs.VersionMajor)
87 typeurl.Register(&specs.Spec{}, prefix, "opencontainers/runtime-spec", major, "Spec")
88 typeurl.Register(&specs.Process{}, prefix, "opencontainers/runtime-spec", major, "Process")
89 typeurl.Register(&specs.LinuxResources{}, prefix, "opencontainers/runtime-spec", major, "LinuxResources")
90 typeurl.Register(&specs.WindowsResources{}, prefix, "opencontainers/runtime-spec", major, "WindowsResources")
91 typeurl.Register(&features.Features{}, prefix, "opencontainers/runtime-spec", major, "features", "Features")
92
93 if runtime.GOOS == "windows" {
94 // After bumping GRPC to 1.64, Windows tests started failing with: "name resolver error: produced zero addresses".
95 // This is happening because grpc.NewClient uses DNS resolver by default, which apparently not what we want
96 // when using socket paths on Windows.
97 // Using a workaround from https://github.com/grpc/grpc-go/issues/1786#issuecomment-2119088770
98 resolver.SetDefaultScheme("passthrough")
99 }
100}
101
102// New returns a new containerd client that is connected to the containerd
103// instance provided by address

Callers

nothing calls this directly

Calls 1

RegisterMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…