mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
Merge pull request #4294 from yibozhuang/direct-volume-stats
runtime: fix incorrect Action function for direct-volume stats
This commit is contained in:
commit
b9315af092
@ -7,10 +7,11 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
containerdshim "github.com/kata-containers/kata-containers/src/runtime/pkg/containerd-shim-v2"
|
containerdshim "github.com/kata-containers/kata-containers/src/runtime/pkg/containerd-shim-v2"
|
||||||
"github.com/kata-containers/kata-containers/src/runtime/pkg/direct-volume"
|
volume "github.com/kata-containers/kata-containers/src/runtime/pkg/direct-volume"
|
||||||
"github.com/kata-containers/kata-containers/src/runtime/pkg/utils/shimclient"
|
"github.com/kata-containers/kata-containers/src/runtime/pkg/utils/shimclient"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@ -89,12 +90,14 @@ var statsCommand = cli.Command{
|
|||||||
Destination: &volumePath,
|
Destination: &volumePath,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) (string, error) {
|
Action: func(c *cli.Context) error {
|
||||||
stats, err := Stats(volumePath)
|
stats, err := Stats(volumePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", cli.NewExitError(err.Error(), 1)
|
return cli.NewExitError(err.Error(), 1)
|
||||||
}
|
}
|
||||||
return string(stats), nil
|
|
||||||
|
fmt.Println(string(stats))
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user