Skip to content

Commit 8cdf21a

Browse files
authored
Merge pull request kubernetes#86409 from sshukun/fix-golint
Fix go-lint issues in package pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
2 parents 0d8b4b5 + 12a5bde commit 8cdf21a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ pkg/kubeapiserver
100100
pkg/kubeapiserver/options
101101
pkg/kubectl/cmd/convert
102102
pkg/kubelet/apis/config/v1beta1
103-
pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
104103
pkg/kubelet/cm
105104
pkg/kubelet/container
106105
pkg/kubelet/container/testing

pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1/types.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
type protocol string
2626

27-
// portMapping is the port mapping configurations of a sandbox.
27+
// PortMapping is the port mapping configurations of a sandbox.
2828
type PortMapping struct {
2929
// protocol of the port mapping.
3030
Protocol *protocol
@@ -34,7 +34,7 @@ type PortMapping struct {
3434
HostPort *int32
3535
}
3636

37-
// CheckpointData contains all types of data that can be stored in the checkpoint.
37+
// Data contains all types of data that can be stored in the checkpoint.
3838
type Data struct {
3939
PortMappings []*PortMapping `json:"port_mappings,omitempty"`
4040
HostNetwork bool `json:"host_network,omitempty"`
@@ -48,15 +48,18 @@ type CheckpointData struct {
4848
Checksum checksum.Checksum
4949
}
5050

51+
// MarshalCheckpoint tries to marshal the CheckpointData into JSON data.
5152
func (cp *CheckpointData) MarshalCheckpoint() ([]byte, error) {
5253
cp.Checksum = checksum.New(*cp.Data)
5354
return json.Marshal(*cp)
5455
}
5556

57+
// UnmarshalCheckpoint tries to unmarshal the passed JSON data into CheckpointData.
5658
func (cp *CheckpointData) UnmarshalCheckpoint(blob []byte) error {
5759
return json.Unmarshal(blob, cp)
5860
}
5961

62+
// VerifyChecksum verifies that CheckpointData's checksum is same as the checksum calculated by its data.
6063
func (cp *CheckpointData) VerifyChecksum() error {
6164
return cp.Checksum.Verify(*cp.Data)
6265
}

0 commit comments

Comments
 (0)