Skip to content

Commit 55c83e3

Browse files
author
Ruben
committed
Fix golint issues in pkg/kubelet/events/event.go
Change the single const statement in favor of multiple const event lists. This way we don't need to put the name of the constant in the comment and it's clearer that the comment refers to the whole list.
1 parent 81af5ba commit 55c83e3

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ pkg/kubelet/dockershim/network/hostport
118118
pkg/kubelet/dockershim/network/hostport/testing
119119
pkg/kubelet/dockershim/network/kubenet
120120
pkg/kubelet/dockershim/network/testing
121-
pkg/kubelet/events
122121
pkg/kubelet/lifecycle
123122
pkg/kubelet/pluginmanager/pluginwatcher
124123
pkg/kubelet/pod/testing

pkg/kubelet/events/event.go

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ limitations under the License.
1616

1717
package events
1818

19+
// Container event reason list
1920
const (
20-
// Container event reason list
2121
CreatedContainer = "Created"
2222
StartedContainer = "Started"
2323
FailedToCreateContainer = "Failed"
@@ -26,22 +26,28 @@ const (
2626
PreemptContainer = "Preempting"
2727
BackOffStartContainer = "BackOff"
2828
ExceededGracePeriod = "ExceededGracePeriod"
29+
)
2930

30-
// Pod event reason list
31+
// Pod event reason list
32+
const (
3133
FailedToKillPod = "FailedKillPod"
3234
FailedToCreatePodContainer = "FailedCreatePodContainer"
3335
FailedToMakePodDataDirectories = "Failed"
3436
NetworkNotReady = "NetworkNotReady"
37+
)
3538

36-
// Image event reason list
39+
// Image event reason list
40+
const (
3741
PullingImage = "Pulling"
3842
PulledImage = "Pulled"
3943
FailedToPullImage = "Failed"
4044
FailedToInspectImage = "InspectFailed"
4145
ErrImageNeverPullPolicy = "ErrImageNeverPull"
4246
BackOffPullImage = "BackOff"
47+
)
4348

44-
// kubelet event reason list
49+
// kubelet event reason list
50+
const (
4551
NodeReady = "NodeReady"
4652
NodeNotReady = "NodeNotReady"
4753
NodeSchedulable = "NodeSchedulable"
@@ -66,22 +72,32 @@ const (
6672
SandboxChanged = "SandboxChanged"
6773
FailedCreatePodSandBox = "FailedCreatePodSandBox"
6874
FailedStatusPodSandBox = "FailedPodSandBoxStatus"
75+
)
6976

70-
// Image manager event reason list
77+
// Image manager event reason list
78+
const (
7179
InvalidDiskCapacity = "InvalidDiskCapacity"
7280
FreeDiskSpaceFailed = "FreeDiskSpaceFailed"
81+
)
7382

74-
// Probe event reason list
83+
// Probe event reason list
84+
const (
7585
ContainerUnhealthy = "Unhealthy"
7686
ContainerProbeWarning = "ProbeWarning"
87+
)
7788

78-
// Pod worker event reason list
89+
// Pod worker event reason list
90+
const (
7991
FailedSync = "FailedSync"
92+
)
8093

81-
// Config event reason list
94+
// Config event reason list
95+
const (
8296
FailedValidation = "FailedValidation"
97+
)
8398

84-
// Lifecycle hooks
99+
// Lifecycle hooks
100+
const (
85101
FailedPostStartHook = "FailedPostStartHook"
86102
FailedPreStopHook = "FailedPreStopHook"
87103
)

0 commit comments

Comments
 (0)