(ctx context.Context)
| 280 | } |
| 281 | |
| 282 | func (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 |
no test coverage detected