MCPcopy
hub / github.com/containerd/containerd / defaultSandboxer

Method defaultSandboxer

client/client.go:282–303  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

280}
281
282func (c *Client) defaultSandboxer(ctx context.Context) (string, error) {
283 c.defaults.mut.Lock()
284 defer c.defaults.mut.Unlock()
285
286 if c.defaults.sandboxer != "" {
287 return c.defaults.sandboxer, nil
288 }
289
290 if c.defaultns != "" {
291 label, err := c.GetLabel(ctx, defaults.DefaultSandboxerNSLabel)
292 if err != nil {
293 // Don't set the sandboxer value if there's an error
294 return defaults.DefaultSandboxer, fmt.Errorf("failed to get default sandboxer label: %w", err)
295 }
296 if label != "" {
297 c.defaults.sandboxer = label
298 return label, nil
299 }
300 }
301 c.defaults.sandboxer = defaults.DefaultSandboxer
302 return c.defaults.sandboxer, nil
303}
304
305// IsServing returns true if the client can successfully connect to the
306// containerd daemon and the healthcheck service returns the SERVING

Callers 1

NewSandboxMethod · 0.95

Calls 3

GetLabelMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected