runtime: virtcontainers/pkg: fix govet fieldalignment

Fix structures alignment

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2021-07-20 10:29:12 -05:00
parent 80ab91ac2f
commit bb9495c0b7
7 changed files with 31 additions and 25 deletions

View File

@ -45,8 +45,8 @@ type Config struct {
}
type Manager struct {
sync.Mutex
mgr libcontcgroups.Manager
sync.Mutex
}
const (

View File

@ -28,8 +28,8 @@ var ociLog = logrus.WithFields(logrus.Fields{
// about the type of the Capabilities field.
// Refer to: https://github.com/opencontainers/runtime-spec/commit/37391fb
type compatOCIProcess struct {
specs.Process
Capabilities interface{} `json:"capabilities,omitempty" platform:"linux"` //nolint:govet
specs.Process
}
// compatOCISpec is a structure inheriting from specs.Spec defined

View File

@ -325,6 +325,7 @@ func TestCPUSetString(t *testing.T) {
}
func TestParse(t *testing.T) {
//nolint: govet
testCases := []struct {
cpusetString string
expected CPUSet

View File

@ -26,6 +26,6 @@ const (
type Namespace struct {
Path string
PID int
Type NSType
PID int
}

View File

@ -79,44 +79,43 @@ const KernelModulesSeparator = ";"
// FactoryConfig is a structure to set the VM factory configuration.
type FactoryConfig struct {
// Template enables VM templating support in VM factory.
Template bool
// TemplatePath specifies the path of template.
TemplatePath string
// VMCacheEndpoint specifies the endpoint of transport VM from the VM cache server to runtime.
VMCacheEndpoint string
// VMCacheNumber specifies the the number of caches of VMCache.
VMCacheNumber uint
// VMCacheEndpoint specifies the endpoint of transport VM from the VM cache server to runtime.
VMCacheEndpoint string
// Template enables VM templating support in VM factory.
Template bool
}
// RuntimeConfig aggregates all runtime specific settings
// nolint: govet
type RuntimeConfig struct {
HypervisorType vc.HypervisorType
HypervisorConfig vc.HypervisorConfig
NetmonConfig vc.NetmonConfig
AgentConfig vc.KataAgentConfig
//Determines how the VM should be connected to the
//the container network interface
InterNetworkModel vc.NetInterworkingModel
FactoryConfig FactoryConfig
Console string
JaegerEndpoint string
JaegerUser string
JaegerPassword string
//Paths to be bindmounted RO into the guest.
SandboxBindMounts []string
//Experimental features enabled
Experimental []exp.Feature
Console string
JaegerEndpoint string
JaegerUser string
JaegerPassword string
HypervisorType vc.HypervisorType
FactoryConfig FactoryConfig
HypervisorConfig vc.HypervisorConfig
NetmonConfig vc.NetmonConfig
AgentConfig vc.KataAgentConfig
//Determines how the VM should be connected to the
//the container network interface
InterNetworkModel vc.NetInterworkingModel
Debug bool
Trace bool

View File

@ -860,6 +860,7 @@ func TestAddRuntimeAnnotations(t *testing.T) {
func TestRegexpContains(t *testing.T) {
assert := assert.New(t)
//nolint: govet
type testData struct {
regexps []string
toMatch string
@ -888,6 +889,7 @@ func TestRegexpContains(t *testing.T) {
func TestCheckPathIsInGlobs(t *testing.T) {
assert := assert.New(t)
//nolint: govet
type testData struct {
globs []string
toMatch string
@ -960,6 +962,7 @@ func TestParseAnnotationUintConfiguration(t *testing.T) {
return nil
}
// nolint: govet
testCases := []struct {
annotations map[string]string
expected uint64
@ -1043,6 +1046,7 @@ func TestParseAnnotationBoolConfiguration(t *testing.T) {
boolKey = "bool_key"
)
// nolint: govet
testCases := []struct {
annotationKey string
annotationValueList []string

View File

@ -20,6 +20,7 @@ import (
)
// Sandbox is a fake Sandbox type used for testing
// nolint: govet
type Sandbox struct {
MockID string
MockURL string
@ -70,6 +71,7 @@ type Sandbox struct {
}
// Container is a fake Container type used for testing
// nolint: govet
type Container struct {
MockID string
MockURL string