From 21343d7d714d6dfdc1828c2c078e1c9a1ae87b27 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Fri, 23 Mar 2018 09:21:20 +0800 Subject: [PATCH] cli: add initrd info to kata-env Show the configured hypervisor initrd setting. Signed-off-by: Peng Tao --- cli/kata-env.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cli/kata-env.go b/cli/kata-env.go index a02d991475..73495f847e 100644 --- a/cli/kata-env.go +++ b/cli/kata-env.go @@ -30,7 +30,7 @@ import ( // // XXX: Increment for every change to the output format // (meaning any change to the EnvInfo type). -const formatVersion = "1.0.9" +const formatVersion = "1.0.10" // MetaInfo stores information on the format of the output itself type MetaInfo struct { @@ -44,6 +44,11 @@ type KernelInfo struct { Parameters string } +// InitrdInfo stores initrd image details +type InitrdInfo struct { + Path string +} + // ImageInfo stores root filesystem image details type ImageInfo struct { Path string @@ -130,6 +135,7 @@ type EnvInfo struct { Hypervisor HypervisorInfo Image ImageInfo Kernel KernelInfo + Initrd InitrdInfo Proxy ProxyInfo Shim ShimInfo Agent AgentInfo @@ -307,12 +313,17 @@ func getEnvInfo(configFile string, config oci.RuntimeConfig) (env EnvInfo, err e Parameters: strings.Join(vc.SerializeParams(config.HypervisorConfig.KernelParams, "="), " "), } + initrd := InitrdInfo{ + Path: config.HypervisorConfig.InitrdPath, + } + env = EnvInfo{ Meta: meta, Runtime: runtime, Hypervisor: hypervisor, Image: image, Kernel: kernel, + Initrd: initrd, Proxy: proxy, Shim: shim, Agent: agent,