Skip to content

Commit

Permalink
Add basic crictl info config with sandboxImage
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 13, 2023
1 parent 9a87d6a commit 38b3d91
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion core/docker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package core

import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -395,7 +396,24 @@ func (ds *dockerService) Status(
networkReady.Message = fmt.Sprintf("docker: network plugin is not ready: %v", err)
}
status := &runtimeapi.RuntimeStatus{Conditions: conditions}
return &runtimeapi.StatusResponse{Status: status}, nil
resp := &runtimeapi.StatusResponse{Status: status}
if r.Verbose {
image := defaultSandboxImage
podSandboxImage := ds.podSandboxImage
if len(podSandboxImage) != 0 {
image = podSandboxImage
}
config := map[string]interface{}{
"sandboxImage": image,
}
configByt, err := json.Marshal(config)
if err != nil {
return nil, err
}
resp.Info = make(map[string]string)
resp.Info["config"] = string(configByt)
}
return resp, nil
}

func (ds *dockerService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 38b3d91

Please sign in to comment.