diff --git a/info/v1/machine.go b/info/v1/machine.go index 9dd989d4f0..96f1af6f51 100644 --- a/info/v1/machine.go +++ b/info/v1/machine.go @@ -217,41 +217,7 @@ type MachineInfo struct { } func (m *MachineInfo) Clone() *MachineInfo { - memoryByType := m.MemoryByType - if len(m.MemoryByType) > 0 { - memoryByType = make(map[string]*MemoryInfo) - for memoryType, memoryInfo := range m.MemoryByType { - memoryByType[memoryType] = memoryInfo - } - } - diskMap := m.DiskMap - if len(m.DiskMap) > 0 { - diskMap = make(map[string]DiskInfo) - for k, info := range m.DiskMap { - diskMap[k] = info - } - } - copy := MachineInfo{ - Timestamp: m.Timestamp, - NumCores: m.NumCores, - NumPhysicalCores: m.NumPhysicalCores, - NumSockets: m.NumSockets, - CpuFrequency: m.CpuFrequency, - MemoryCapacity: m.MemoryCapacity, - MemoryByType: memoryByType, - NVMInfo: m.NVMInfo, - HugePages: m.HugePages, - MachineID: m.MachineID, - SystemUUID: m.SystemUUID, - BootID: m.BootID, - Filesystems: m.Filesystems, - DiskMap: diskMap, - NetworkDevices: m.NetworkDevices, - Topology: m.Topology, - CloudProvider: m.CloudProvider, - InstanceType: m.InstanceType, - InstanceID: m.InstanceID, - } + copy := *m return © } diff --git a/manager/container.go b/manager/container.go index 013441d899..4830ffd93c 100644 --- a/manager/container.go +++ b/manager/container.go @@ -174,14 +174,7 @@ func (cd *containerData) GetInfo(shouldUpdateSubcontainers bool) (*containerInfo } cd.lock.Lock() defer cd.lock.Unlock() - cInfo := containerInfo{ - Subcontainers: cd.info.Subcontainers, - Spec: cd.info.Spec, - } - cInfo.Id = cd.info.Id - cInfo.Name = cd.info.Name - cInfo.Aliases = cd.info.Aliases - cInfo.Namespace = cd.info.Namespace + cInfo := cd.info return &cInfo, nil }