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 { type Manager struct {
sync.Mutex
mgr libcontcgroups.Manager mgr libcontcgroups.Manager
sync.Mutex
} }
const ( const (

View File

@ -28,8 +28,8 @@ var ociLog = logrus.WithFields(logrus.Fields{
// about the type of the Capabilities field. // about the type of the Capabilities field.
// Refer to: https://github.com/opencontainers/runtime-spec/commit/37391fb // Refer to: https://github.com/opencontainers/runtime-spec/commit/37391fb
type compatOCIProcess struct { type compatOCIProcess struct {
specs.Process
Capabilities interface{} `json:"capabilities,omitempty" platform:"linux"` //nolint:govet Capabilities interface{} `json:"capabilities,omitempty" platform:"linux"` //nolint:govet
specs.Process
} }
// compatOCISpec is a structure inheriting from specs.Spec defined // 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) { func TestParse(t *testing.T) {
//nolint: govet
testCases := []struct { testCases := []struct {
cpusetString string cpusetString string
expected CPUSet expected CPUSet

View File

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

View File

@ -79,44 +79,43 @@ const KernelModulesSeparator = ";"
// FactoryConfig is a structure to set the VM factory configuration. // FactoryConfig is a structure to set the VM factory configuration.
type FactoryConfig struct { type FactoryConfig struct {
// Template enables VM templating support in VM factory.
Template bool
// TemplatePath specifies the path of template. // TemplatePath specifies the path of template.
TemplatePath string 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 specifies the the number of caches of VMCache.
VMCacheNumber uint VMCacheNumber uint
// VMCacheEndpoint specifies the endpoint of transport VM from the VM cache server to runtime. // Template enables VM templating support in VM factory.
VMCacheEndpoint string Template bool
} }
// RuntimeConfig aggregates all runtime specific settings // RuntimeConfig aggregates all runtime specific settings
// nolint: govet
type RuntimeConfig struct { 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. //Paths to be bindmounted RO into the guest.
SandboxBindMounts []string SandboxBindMounts []string
//Experimental features enabled //Experimental features enabled
Experimental []exp.Feature 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 Debug bool
Trace bool Trace bool

View File

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

View File

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