MCPcopy
hub / github.com/google/cadvisor / StorageDriver

Method StorageDriver

integration/framework/framework.go:371–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369}
370
371func (a dockerActions) StorageDriver() string {
372 dockerCommand := []string{"docker", "info"}
373 output, _ := a.fm.Shell().Run("sudo", dockerCommand...)
374 if len(output) < 1 {
375 a.fm.T().Fatalf("failed to find docker storage driver - %v", output)
376 }
377 for _, line := range strings.Split(output, "\n") {
378 line = strings.TrimSpace(line)
379 if strings.HasPrefix(line, "Storage Driver: ") {
380 idx := strings.LastIndex(line, ": ") + 2
381 driver := line[idx:]
382 switch driver {
383 case Aufs, Overlay, Overlay2, DeviceMapper:
384 return driver
385 default:
386 return Unknown
387 }
388 }
389 }
390 a.fm.T().Fatalf("failed to find docker storage driver from info - %v", output)
391 return Unknown
392}
393
394func (a dockerActions) RunStress(args DockerRunArgs, cmd ...string) string {
395 dockerCommand := append(append(append(append([]string{"docker", "run", "-m=4M", "-d", "-t", "-i"}, args.Args...), args.Image), args.InnerArgs...), cmd...)

Callers

nothing calls this directly

Calls 3

RunMethod · 0.65
ShellMethod · 0.65
TMethod · 0.65

Tested by

no test coverage detected