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.
This commit is contained in:
Ruben 2019-11-19 13:15:08 +01:00
parent 81af5baff8
commit 55c83e3397
2 changed files with 25 additions and 10 deletions

View File

@ -118,7 +118,6 @@ pkg/kubelet/dockershim/network/hostport
pkg/kubelet/dockershim/network/hostport/testing
pkg/kubelet/dockershim/network/kubenet
pkg/kubelet/dockershim/network/testing
pkg/kubelet/events
pkg/kubelet/lifecycle
pkg/kubelet/pluginmanager/pluginwatcher
pkg/kubelet/pod/testing

View File

@ -16,8 +16,8 @@ limitations under the License.
package events
// Container event reason list
const (
// Container event reason list
CreatedContainer = "Created"
StartedContainer = "Started"
FailedToCreateContainer = "Failed"
@ -26,22 +26,28 @@ const (
PreemptContainer = "Preempting"
BackOffStartContainer = "BackOff"
ExceededGracePeriod = "ExceededGracePeriod"
)
// Pod event reason list
// Pod event reason list
const (
FailedToKillPod = "FailedKillPod"
FailedToCreatePodContainer = "FailedCreatePodContainer"
FailedToMakePodDataDirectories = "Failed"
NetworkNotReady = "NetworkNotReady"
)
// Image event reason list
// Image event reason list
const (
PullingImage = "Pulling"
PulledImage = "Pulled"
FailedToPullImage = "Failed"
FailedToInspectImage = "InspectFailed"
ErrImageNeverPullPolicy = "ErrImageNeverPull"
BackOffPullImage = "BackOff"
)
// kubelet event reason list
// kubelet event reason list
const (
NodeReady = "NodeReady"
NodeNotReady = "NodeNotReady"
NodeSchedulable = "NodeSchedulable"
@ -66,22 +72,32 @@ const (
SandboxChanged = "SandboxChanged"
FailedCreatePodSandBox = "FailedCreatePodSandBox"
FailedStatusPodSandBox = "FailedPodSandBoxStatus"
)
// Image manager event reason list
// Image manager event reason list
const (
InvalidDiskCapacity = "InvalidDiskCapacity"
FreeDiskSpaceFailed = "FreeDiskSpaceFailed"
)
// Probe event reason list
// Probe event reason list
const (
ContainerUnhealthy = "Unhealthy"
ContainerProbeWarning = "ProbeWarning"
)
// Pod worker event reason list
// Pod worker event reason list
const (
FailedSync = "FailedSync"
)
// Config event reason list
// Config event reason list
const (
FailedValidation = "FailedValidation"
)
// Lifecycle hooks
// Lifecycle hooks
const (
FailedPostStartHook = "FailedPostStartHook"
FailedPreStopHook = "FailedPreStopHook"
)