Merge pull request #76924 from SataQiu/fix-golint-kubelet-20190423

Fix golint failures of pkg/kubelet/checkpointmanager/checksum
This commit is contained in:
Kubernetes Prow Robot
2019-04-24 21:44:44 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -163,7 +163,6 @@ pkg/kubelet/apis/config/v1beta1
pkg/kubelet/apis/deviceplugin/v1beta1
pkg/kubelet/cadvisor
pkg/kubelet/cadvisor/testing
pkg/kubelet/checkpointmanager/checksum
pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
pkg/kubelet/client
pkg/kubelet/cm

View File

@@ -23,10 +23,10 @@ import (
hashutil "k8s.io/kubernetes/pkg/util/hash"
)
// Data to be stored as checkpoint
// Checksum is the data to be stored as checkpoint
type Checksum uint64
// VerifyChecksum verifies that passed checksum is same as calculated checksum
// Verify verifies that passed checksum is same as calculated checksum
func (cs Checksum) Verify(data interface{}) error {
if cs != New(data) {
return errors.ErrCorruptCheckpoint
@@ -34,6 +34,7 @@ func (cs Checksum) Verify(data interface{}) error {
return nil
}
// New returns the Checksum of checkpoint data
func New(data interface{}) Checksum {
return Checksum(getChecksum(data))
}