MCPcopy
hub / github.com/containerd/containerd / CRIConfig

Function CRIConfig

integration/main_test.go:804–819  ·  view source on GitHub ↗

CRIConfig gets current cri config from containerd.

()

Source from the content-addressed store, hash-verified

802
803// CRIConfig gets current cri config from containerd.
804func CRIConfig() (*criconfig.Config, error) {
805 client, conn, err := RawRuntimeClient()
806 if err != nil {
807 return nil, fmt.Errorf("failed to get raw runtime client: %w", err)
808 }
809 defer conn.Close()
810 resp, err := client.Status(context.Background(), &runtime.StatusRequest{Verbose: true})
811 if err != nil {
812 return nil, fmt.Errorf("failed to get status: %w", err)
813 }
814 config := &criconfig.Config{}
815 if err := json.Unmarshal([]byte(resp.Info["config"]), config); err != nil {
816 return nil, fmt.Errorf("failed to unmarshal config: %w", err)
817 }
818 return config, nil
819}
820
821// SandboxInfo gets sandbox info.
822func SandboxInfo(id string) (*runtime.PodSandboxStatus, *podsandboxtypes.SandboxInfo, error) {

Calls 4

StatusStruct · 0.92
RawRuntimeClientFunction · 0.85
UnmarshalMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…