mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 02:56:18 +00:00
Merge pull request #590 from devimc/topic/kataEnvSupportVSocks
cli: kata-env: show if vsocks are supported
This commit is contained in:
commit
f70d6d2acb
@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||||
|
vcUtils "github.com/kata-containers/runtime/virtcontainers/utils"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
opentracing "github.com/opentracing/opentracing-go"
|
opentracing "github.com/opentracing/opentracing-go"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@ -25,7 +26,7 @@ import (
|
|||||||
//
|
//
|
||||||
// XXX: Increment for every change to the output format
|
// XXX: Increment for every change to the output format
|
||||||
// (meaning any change to the EnvInfo type).
|
// (meaning any change to the EnvInfo type).
|
||||||
const formatVersion = "1.0.14"
|
const formatVersion = "1.0.15"
|
||||||
|
|
||||||
// MetaInfo stores information on the format of the output itself
|
// MetaInfo stores information on the format of the output itself
|
||||||
type MetaInfo struct {
|
type MetaInfo struct {
|
||||||
@ -120,6 +121,7 @@ type HostInfo struct {
|
|||||||
Distro DistroInfo
|
Distro DistroInfo
|
||||||
CPU CPUInfo
|
CPU CPUInfo
|
||||||
VMContainerCapable bool
|
VMContainerCapable bool
|
||||||
|
SupportVSocks bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnvInfo collects all information that will be displayed by the
|
// EnvInfo collects all information that will be displayed by the
|
||||||
@ -213,6 +215,7 @@ func getHostInfo() (HostInfo, error) {
|
|||||||
Distro: hostDistro,
|
Distro: hostDistro,
|
||||||
CPU: hostCPU,
|
CPU: hostCPU,
|
||||||
VMContainerCapable: hostVMContainerCapable,
|
VMContainerCapable: hostVMContainerCapable,
|
||||||
|
SupportVSocks: vcUtils.SupportsVsocks(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return host, nil
|
return host, nil
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
|
vcUtils "github.com/kata-containers/runtime/virtcontainers/utils"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
|
|
||||||
@ -179,6 +180,7 @@ func genericGetExpectedHostDetails(tmpdir string) (HostInfo, error) {
|
|||||||
Distro: expectedDistro,
|
Distro: expectedDistro,
|
||||||
CPU: expectedCPU,
|
CPU: expectedCPU,
|
||||||
VMContainerCapable: false,
|
VMContainerCapable: false,
|
||||||
|
SupportVSocks: vcUtils.SupportsVsocks(),
|
||||||
}
|
}
|
||||||
|
|
||||||
testProcCPUInfo := filepath.Join(tmpdir, "cpuinfo")
|
testProcCPUInfo := filepath.Join(tmpdir, "cpuinfo")
|
||||||
|
Loading…
Reference in New Issue
Block a user