mirror of https://github.com/k3s-io/k3s
fix golint failures of pkg/kubelet/checkpointmanager/checksum
parent
20b76a2b4a
commit
bf37c8a217
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue