mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-11 21:02:34 +00:00
cli: Show available guest protection in env output
Show available guest protections in the `kata-runtime env` output. Also bump the formatVersion. Fixes: #1982 Signed-off-by: Yujia Qiao <rapiz3142@gmail.com>
This commit is contained in:
parent
2063b13805
commit
6cc8000cae
@ -130,13 +130,14 @@ type DistroInfo struct {
|
|||||||
|
|
||||||
// HostInfo stores host details
|
// HostInfo stores host details
|
||||||
type HostInfo struct {
|
type HostInfo struct {
|
||||||
Kernel string
|
AvailableGuestProtections []string
|
||||||
Architecture string
|
Kernel string
|
||||||
Distro DistroInfo
|
Architecture string
|
||||||
CPU CPUInfo
|
Distro DistroInfo
|
||||||
Memory MemoryInfo
|
CPU CPUInfo
|
||||||
VMContainerCapable bool
|
Memory MemoryInfo
|
||||||
SupportVSocks bool
|
VMContainerCapable bool
|
||||||
|
SupportVSocks bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NetmonInfo stores netmon details
|
// NetmonInfo stores netmon details
|
||||||
@ -241,14 +242,17 @@ func getHostInfo() (HostInfo, error) {
|
|||||||
|
|
||||||
memoryInfo := getMemoryInfo()
|
memoryInfo := getMemoryInfo()
|
||||||
|
|
||||||
|
availableGuestProtection := vc.AvailableGuestProtections()
|
||||||
|
|
||||||
host := HostInfo{
|
host := HostInfo{
|
||||||
Kernel: hostKernelVersion,
|
Kernel: hostKernelVersion,
|
||||||
Architecture: arch,
|
Architecture: arch,
|
||||||
Distro: hostDistro,
|
Distro: hostDistro,
|
||||||
CPU: hostCPU,
|
CPU: hostCPU,
|
||||||
Memory: memoryInfo,
|
Memory: memoryInfo,
|
||||||
VMContainerCapable: hostVMContainerCapable,
|
AvailableGuestProtections: availableGuestProtection,
|
||||||
SupportVSocks: supportVSocks,
|
VMContainerCapable: hostVMContainerCapable,
|
||||||
|
SupportVSocks: supportVSocks,
|
||||||
}
|
}
|
||||||
|
|
||||||
return host, nil
|
return host, nil
|
||||||
|
@ -179,10 +179,10 @@ const (
|
|||||||
|
|
||||||
var guestProtectionStr = [...]string{
|
var guestProtectionStr = [...]string{
|
||||||
noneProtection: "none",
|
noneProtection: "none",
|
||||||
tdxProtection: "tdx",
|
|
||||||
sevProtection: "sev",
|
|
||||||
pefProtection: "pef",
|
pefProtection: "pef",
|
||||||
seProtection: "se",
|
seProtection: "se",
|
||||||
|
sevProtection: "sev",
|
||||||
|
tdxProtection: "tdx",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gp guestProtection) String() string {
|
func (gp guestProtection) String() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user