configure the crictl yaml file to avoid the warning

pull/10221/head
Jiefeng He 2021-01-22 11:35:38 -08:00
parent 7de5bf7b19
commit f520c9d9e9
2 changed files with 8 additions and 6 deletions

View File

@ -84,7 +84,10 @@ func (r *Docker) Version() (string, error) {
// SocketPath returns the path to the socket file for Docker
func (r *Docker) SocketPath() string {
return r.Socket
if r.Socket != "" {
return r.Socket
}
return "/var/run/dockershim.sock"
}
// Available returns an error if it is not possible to use this runtime on a host
@ -108,6 +111,10 @@ func (r *Docker) Enable(disOthers, forceSystemd bool) error {
}
}
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
return err
}
if forceSystemd {
if err := r.forceSystemd(); err != nil {
return err

View File

@ -286,12 +286,7 @@ func testPulledImages(ctx context.Context, t *testing.T, profile string, version
Tags []string `json:"repoTags"`
}{}
// crictl includes warnings in STDOUT before printing JSON output
// this step trims the warnings before JSON output begins
// See #10175 for details on fixing these warnings
stdout := rr.Stdout.String()
index := strings.Index(stdout, "{")
stdout = stdout[index:]
err = json.Unmarshal([]byte(stdout), &jv)
if err != nil {