mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 17:22:33 +00:00
lint: Fix virtcontainers maligned
errors
Correct `maligned` linter issues. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
cc09b01ab2
commit
9b98c26a80
@ -145,6 +145,12 @@ type Param struct {
|
|||||||
|
|
||||||
// HypervisorConfig is the hypervisor configuration.
|
// HypervisorConfig is the hypervisor configuration.
|
||||||
type HypervisorConfig struct {
|
type HypervisorConfig struct {
|
||||||
|
// KernelParams are additional guest kernel parameters.
|
||||||
|
KernelParams []Param
|
||||||
|
|
||||||
|
// HypervisorParams are additional hypervisor parameters.
|
||||||
|
HypervisorParams []Param
|
||||||
|
|
||||||
// KernelPath is the guest kernel host path.
|
// KernelPath is the guest kernel host path.
|
||||||
KernelPath string
|
KernelPath string
|
||||||
|
|
||||||
@ -160,26 +166,19 @@ type HypervisorConfig struct {
|
|||||||
// HypervisorPath is the hypervisor executable host path.
|
// HypervisorPath is the hypervisor executable host path.
|
||||||
HypervisorPath string
|
HypervisorPath string
|
||||||
|
|
||||||
// DisableBlockDeviceUse disallows a block device from being used.
|
|
||||||
DisableBlockDeviceUse bool
|
|
||||||
|
|
||||||
// BlockDeviceDriver specifies the driver to be used for block device
|
// BlockDeviceDriver specifies the driver to be used for block device
|
||||||
// either VirtioSCSI or VirtioBlock with the default driver being defaultBlockDriver
|
// either VirtioSCSI or VirtioBlock with the default driver being defaultBlockDriver
|
||||||
BlockDeviceDriver string
|
BlockDeviceDriver string
|
||||||
|
|
||||||
// KernelParams are additional guest kernel parameters.
|
|
||||||
KernelParams []Param
|
|
||||||
|
|
||||||
// HypervisorParams are additional hypervisor parameters.
|
|
||||||
HypervisorParams []Param
|
|
||||||
|
|
||||||
// HypervisorMachineType specifies the type of machine being
|
// HypervisorMachineType specifies the type of machine being
|
||||||
// emulated.
|
// emulated.
|
||||||
HypervisorMachineType string
|
HypervisorMachineType string
|
||||||
|
|
||||||
// Debug changes the default hypervisor and kernel parameters to
|
// customAssets is a map of assets.
|
||||||
// enable debug output where available.
|
// Each value in that map takes precedence over the configured assets.
|
||||||
Debug bool
|
// For example, if there is a value for the "kernel" key in this map,
|
||||||
|
// it will be used for the pod's kernel path instead of KernelPath.
|
||||||
|
customAssets map[assetType]*asset
|
||||||
|
|
||||||
// DefaultVCPUs specifies default number of vCPUs for the VM.
|
// DefaultVCPUs specifies default number of vCPUs for the VM.
|
||||||
DefaultVCPUs uint32
|
DefaultVCPUs uint32
|
||||||
@ -195,6 +194,13 @@ type HypervisorConfig struct {
|
|||||||
// Bridges can be used to hot plug devices
|
// Bridges can be used to hot plug devices
|
||||||
DefaultBridges uint32
|
DefaultBridges uint32
|
||||||
|
|
||||||
|
// DisableBlockDeviceUse disallows a block device from being used.
|
||||||
|
DisableBlockDeviceUse bool
|
||||||
|
|
||||||
|
// Debug changes the default hypervisor and kernel parameters to
|
||||||
|
// enable debug output where available.
|
||||||
|
Debug bool
|
||||||
|
|
||||||
// MemPrealloc specifies if the memory should be pre-allocated
|
// MemPrealloc specifies if the memory should be pre-allocated
|
||||||
MemPrealloc bool
|
MemPrealloc bool
|
||||||
|
|
||||||
@ -212,12 +218,6 @@ type HypervisorConfig struct {
|
|||||||
// DisableNestingChecks is used to override customizations performed
|
// DisableNestingChecks is used to override customizations performed
|
||||||
// when running on top of another VMM.
|
// when running on top of another VMM.
|
||||||
DisableNestingChecks bool
|
DisableNestingChecks bool
|
||||||
|
|
||||||
// customAssets is a map of assets.
|
|
||||||
// Each value in that map takes precedence over the configured assets.
|
|
||||||
// For example, if there is a value for the "kernel" key in this map,
|
|
||||||
// it will be used for the pod's kernel path instead of KernelPath.
|
|
||||||
customAssets map[assetType]*asset
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (conf *HypervisorConfig) valid() (bool, error) {
|
func (conf *HypervisorConfig) valid() (bool, error) {
|
||||||
|
@ -168,28 +168,34 @@ type Capabilities struct {
|
|||||||
|
|
||||||
// Process describes a process running on a container inside a pod.
|
// Process describes a process running on a container inside a pod.
|
||||||
type Process struct {
|
type Process struct {
|
||||||
User string `json:"user,omitempty"`
|
// Args specifies the binary and arguments for the application to execute.
|
||||||
Group string `json:"group,omitempty"`
|
Args []string `json:"args"`
|
||||||
|
|
||||||
|
// Rlimits specifies rlimit options to apply to the process.
|
||||||
|
Rlimits []Rlimit `json:"rlimits,omitempty"`
|
||||||
|
|
||||||
|
// Envs populates the process environment for the process.
|
||||||
|
Envs []EnvironmentVar `json:"envs,omitempty"`
|
||||||
|
|
||||||
AdditionalGroups []string `json:"additionalGroups,omitempty"`
|
AdditionalGroups []string `json:"additionalGroups,omitempty"`
|
||||||
// Terminal creates an interactive terminal for the process.
|
|
||||||
Terminal bool `json:"terminal"`
|
// Workdir is the current working directory for the process and must be
|
||||||
|
// relative to the container's root.
|
||||||
|
Workdir string `json:"workdir"`
|
||||||
|
|
||||||
|
User string `json:"user,omitempty"`
|
||||||
|
Group string `json:"group,omitempty"`
|
||||||
// Sequeue number for stdin and stdout
|
// Sequeue number for stdin and stdout
|
||||||
Stdio uint64 `json:"stdio,omitempty"`
|
Stdio uint64 `json:"stdio,omitempty"`
|
||||||
// Sequeue number for stderr if it is not shared with stdout
|
// Sequeue number for stderr if it is not shared with stdout
|
||||||
Stderr uint64 `json:"stderr,omitempty"`
|
Stderr uint64 `json:"stderr,omitempty"`
|
||||||
// Args specifies the binary and arguments for the application to execute.
|
|
||||||
Args []string `json:"args"`
|
|
||||||
// Envs populates the process environment for the process.
|
|
||||||
Envs []EnvironmentVar `json:"envs,omitempty"`
|
|
||||||
// Workdir is the current working directory for the process and must be
|
|
||||||
// relative to the container's root.
|
|
||||||
Workdir string `json:"workdir"`
|
|
||||||
// Rlimits specifies rlimit options to apply to the process.
|
|
||||||
Rlimits []Rlimit `json:"rlimits,omitempty"`
|
|
||||||
// NoNewPrivileges indicates that the process should not gain any additional privileges
|
// NoNewPrivileges indicates that the process should not gain any additional privileges
|
||||||
|
Capabilities Capabilities `json:"capabilities"`
|
||||||
|
|
||||||
NoNewPrivileges bool `json:"noNewPrivileges"`
|
NoNewPrivileges bool `json:"noNewPrivileges"`
|
||||||
// Capabilities specifies the sets of capabilities for the process(es) inside the container.
|
// Capabilities specifies the sets of capabilities for the process(es) inside the container.
|
||||||
Capabilities Capabilities `json:"capabilities"`
|
// Terminal creates an interactive terminal for the process.
|
||||||
|
Terminal bool `json:"terminal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SystemMountsInfo describes additional information for system mounts that the agent
|
// SystemMountsInfo describes additional information for system mounts that the agent
|
||||||
|
@ -274,9 +274,9 @@ type LinuxCapabilities struct {
|
|||||||
|
|
||||||
// Cmd represents a command to execute in a running container.
|
// Cmd represents a command to execute in a running container.
|
||||||
type Cmd struct {
|
type Cmd struct {
|
||||||
Args []string
|
Args []string
|
||||||
Envs []EnvVar
|
Envs []EnvVar
|
||||||
WorkDir string
|
SupplementaryGroups []string
|
||||||
|
|
||||||
// Note that these fields *MUST* remain as strings.
|
// Note that these fields *MUST* remain as strings.
|
||||||
//
|
//
|
||||||
@ -300,15 +300,15 @@ type Cmd struct {
|
|||||||
// all the user and group mapping is handled by the container manager
|
// all the user and group mapping is handled by the container manager
|
||||||
// and specified to the runtime in terms of UID/GID's in the
|
// and specified to the runtime in terms of UID/GID's in the
|
||||||
// configuration file generated by the container manager.
|
// configuration file generated by the container manager.
|
||||||
User string
|
User string
|
||||||
PrimaryGroup string
|
PrimaryGroup string
|
||||||
SupplementaryGroups []string
|
WorkDir string
|
||||||
|
Console string
|
||||||
|
Capabilities LinuxCapabilities
|
||||||
|
|
||||||
Interactive bool
|
Interactive bool
|
||||||
Console string
|
|
||||||
Detach bool
|
Detach bool
|
||||||
NoNewPrivileges bool
|
NoNewPrivileges bool
|
||||||
Capabilities LinuxCapabilities
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resources describes VM resources configuration.
|
// Resources describes VM resources configuration.
|
||||||
|
Loading…
Reference in New Issue
Block a user