Fix golint error and make it enable again in travis

This commit is contained in:
Tomofumi Hayashi
2019-06-24 16:57:03 +09:00
committed by Tomofumi Hayashi
parent 33f077ce1b
commit 2fe42c11c7
8 changed files with 65 additions and 27 deletions

View File

@@ -28,6 +28,7 @@ const (
checkPointfile = "/var/lib/kubelet/device-plugins/kubelet_internal_checkpoint"
)
// PodDevicesEntry maps PodUID, resource name and allocated device id
type PodDevicesEntry struct {
PodUID string
ContainerName string
@@ -41,7 +42,7 @@ type checkpointData struct {
RegisteredDevices map[string][]string
}
type Data struct {
type checkpointFileData struct {
Data checkpointData
Checksum uint64
}
@@ -70,7 +71,7 @@ func getCheckpoint(filePath string) (types.ResourceClient, error) {
// getPodEntries gets all Pod device allocation entries from checkpoint file
func (cp *checkpoint) getPodEntries() error {
cpd := &Data{}
cpd := &checkpointFileData{}
rawBytes, err := ioutil.ReadFile(cp.fileName)
if err != nil {
return logging.Errorf("getPodEntries(): error reading file %s\n%v\n", checkPointfile, err)