Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
cli: kata-env: add runtime path to output
Browse files Browse the repository at this point in the history
`kata-env` did not include the path to the runtime exe itself.
Add that into the Runtime section.

Fixes: #577

Signed-off-by: Graham Whaley <[email protected]>
  • Loading branch information
Graham Whaley authored and Eric Ernst committed Aug 21, 2018
1 parent 9155da8 commit 4784ac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/kata-env.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
//
// XXX: Increment for every change to the output format
// (meaning any change to the EnvInfo type).
const formatVersion = "1.0.13"
const formatVersion = "1.0.14"

// MetaInfo stores information on the format of the output itself
type MetaInfo struct {
Expand Down Expand Up @@ -64,6 +64,7 @@ type RuntimeInfo struct {
Version RuntimeVersionInfo
Config RuntimeConfigInfo
Debug bool
Path string
}

// RuntimeVersionInfo stores details of the runtime version
Expand Down Expand Up @@ -154,9 +155,12 @@ func getRuntimeInfo(configFile string, config oci.RuntimeConfig) RuntimeInfo {
Path: configFile,
}

runtimePath, _ := os.Executable()

return RuntimeInfo{
Version: runtimeVersion,
Config: runtimeConfig,
Path: runtimePath,
}
}

Expand Down
3 changes: 3 additions & 0 deletions cli/kata-env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ func getExpectedKernel(config oci.RuntimeConfig) KernelInfo {
}

func getExpectedRuntimeDetails(configFile string) RuntimeInfo {
runtimePath, _ := os.Executable()

return RuntimeInfo{
Version: RuntimeVersionInfo{
Semver: version,
Expand All @@ -264,6 +266,7 @@ func getExpectedRuntimeDetails(configFile string) RuntimeInfo {
Config: RuntimeConfigInfo{
Path: configFile,
},
Path: runtimePath,
}
}

Expand Down

0 comments on commit 4784ac7

Please sign in to comment.