Skip to content

Commit dd38a18

Browse files
committed
emit crio runtime config as part of CRI API's StatusResponse
Signed-off-by: Tariq Ibrahim <[email protected]>
1 parent 2f2b3ab commit dd38a18

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

server/runtime_status.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func (s *Server) Status(ctx context.Context, req *types.StatusRequest) (*types.S
7878
func (s *Server) createRuntimeInfo() (map[string]string, error) {
7979
config := map[string]any{
8080
"sandboxImage": s.config.PauseImage,
81+
"crio": s.config.RuntimeConfig,
8182
}
8283

8384
bytes, err := json.Marshal(config)

test/runtimeconfig.bats

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bats
2+
3+
load helpers
4+
5+
function setup() {
6+
setup_test
7+
}
8+
9+
function teardown() {
10+
cleanup_test
11+
}
12+
13+
@test "crictl info prints out the crio runtime config" {
14+
start_crio
15+
info_json=$(crictl info -o json)
16+
17+
jq -e '.config.crio' <<< "$info_json"
18+
19+
default_runtime=$(jq -r ".config.crio.DefaultRuntime" <<< "$info_json")
20+
jq -e ".config.crio.Runtimes.[\"$default_runtime\"]" <<< "$info_json"
21+
22+
crio_runtime_bin_path=$(jq -r ".config.crio.Runtimes.[\"$default_runtime\"].RuntimePath" <<< "$info_json")
23+
[[ "${crio_runtime_bin_path}" == "$RUNTIME_BINARY_PATH" ]]
24+
}

0 commit comments

Comments
 (0)