提交 b641080d 编写于 作者: F Faye Zhang 提交者: Kubernetes Prow Robot

fix golint failures (#4458)

上级 8a75205e
......@@ -894,7 +894,7 @@ type HorizontalPodAutoscalerListChannel struct {
Error chan error
}
// GetPodListMetricsChannel returns a pair of channels to MetricsByPod and errors that
// GetHorizontalPodAutoscalerListChannel returns a pair of channels to MetricsByPod and errors that
// both must be read numReads times.
func GetHorizontalPodAutoscalerListChannel(client client.Interface, nsQuery *NamespaceQuery,
numReads int) HorizontalPodAutoscalerListChannel {
......
......@@ -28,7 +28,7 @@ import (
client "k8s.io/client-go/kubernetes"
)
// Based on given selector returns list of services that are candidates for deletion.
// GetServicesForDSDeletion is based on given selector returns list of services that are candidates for deletion.
// Services are matched by daemon sets' label selector. They are deleted if given
// label selector is targeting only 1 daemon set.
func GetServicesForDSDeletion(client client.Interface, labelSelector labels.Selector,
......
......@@ -18,7 +18,7 @@ import (
metricapi "github.com/kubernetes/dashboard/src/app/backend/integration/metric/api"
)
// Options for GenericDataSelect which takes []GenericDataCell and returns selected data.
// DataSelectQuery is options for GenericDataSelect which takes []GenericDataCell and returns selected data.
// Can be extended to include any kind of selection - for example filtering.
// Currently included only Pagination and Sort options.
type DataSelectQuery struct {
......
......@@ -60,9 +60,8 @@ func (self StdComparableRFC3339Timestamp) Compare(otherV ComparableValue) int {
if err1 != nil || err2 != nil {
// in case of timestamp parsing failure just compare as strings
return strings.Compare(string(self), string(other))
} else {
return ints64Compare(selfTime.Unix(), otherTime.Unix())
}
return ints64Compare(selfTime.Unix(), otherTime.Unix())
}
func (self StdComparableRFC3339Timestamp) Contains(otherV ComparableValue) bool {
......
......@@ -148,7 +148,7 @@ func GetNamespaceEvents(client kubernetes.Interface, dsQuery *dataselect.DataSel
return CreateEventList(FillEventsType(events.Items), dsQuery), nil
}
// Based on event Reason fills event Type in order to allow correct filtering by Type.
// FillEventsType is based on event Reason fills event Type in order to allow correct filtering by Type.
func FillEventsType(events []v1.Event) []v1.Event {
for i := range events {
// Fill in only events with empty type.
......
......@@ -19,7 +19,7 @@ import (
autoscaling "k8s.io/api/autoscaling/v1"
)
// Simple mapping of an autoscaling.CrossVersionObjectReference
// ScaleTargetRef is a simple mapping of an autoscaling.CrossVersionObjectReference
type ScaleTargetRef struct {
Kind string `json:"kind"`
Name string `json:"name"`
......
......@@ -22,7 +22,7 @@ import (
// LINE_INDEX_NOT_FOUND is returned if requested line could not be found
var LINE_INDEX_NOT_FOUND = -1
// Default number of lines that should be returned in case of invalid request.
// DefaultDisplayNumLogLines returns default number of lines in case of invalid request.
var DefaultDisplayNumLogLines = 100
// MaxLogLines is a number that will be certainly bigger than any number of logs. Here 2 billion logs is certainly much larger
......@@ -51,7 +51,7 @@ var OldestLogLineId = LogLineId{
LogTimestamp: OldestTimestamp,
}
// Default log view selector that is used in case of invalid request
// DefaultSelection loads default log view selector that is used in case of invalid request
// Downloads newest DefaultDisplayNumLogLines lines.
var DefaultSelection = &Selection{
OffsetFrom: 1 - DefaultDisplayNumLogLines,
......@@ -60,14 +60,14 @@ var DefaultSelection = &Selection{
LogFilePosition: End,
}
// Returns all logs.
// AllSelection returns all logs.
var AllSelection = &Selection{
OffsetFrom: -MaxLogLines,
OffsetTo: MaxLogLines,
ReferencePoint: NewestLogLineId,
}
// Representation of log lines
// LogDetails returns representation of log lines
type LogDetails struct {
// Additional information of the logs e.g. container name, dates,...
......@@ -80,7 +80,7 @@ type LogDetails struct {
LogLines `json:"logs"`
}
// Meta information about the selected log lines
// LogInfo returns meta information about the selected log lines
type LogInfo struct {
// Pod name.
......@@ -140,7 +140,7 @@ type LogLineId struct {
// slice of logs relatively to certain reference line ID.
type LogLines []LogLine
// A single log line. Split into timestamp and the actual content
// LogLine is a single log line that split into timestamp and the actual content.
type LogLine struct {
Timestamp LogTimestamp `json:"timestamp"`
Content string `json:"content"`
......@@ -215,9 +215,8 @@ func (self LogLines) getLineIndex(logLineId *LogLineId) int {
}
if 0 <= offset && offset < linesMatched {
return matchingStartedAt + offset
} else {
return LINE_INDEX_NOT_FOUND
}
return LINE_INDEX_NOT_FOUND
}
// CreateLogLineId returns ID of the line with provided lineIndex.
......
......@@ -37,7 +37,7 @@ type ResourceQuotaDetail struct {
StatusList map[v1.ResourceName]ResourceStatus `json:"statusList,omitempty"`
}
// ResourceQuotaDetailList
// ResourceQuotaDetailList provides a set of resource Quotas.
type ResourceQuotaDetailList struct {
ListMeta api.ListMeta `json:"listMeta"`
Items []ResourceQuotaDetail `json:"items"`
......
......@@ -80,7 +80,7 @@ func MarshalPinnedResources(p []PinnedResource) string {
return string(bytes)
}
// Unmarshal settings from JSON string into object.
// UnmarshalPinnedResources unmarshal pinned resource into object.
func UnmarshalPinnedResources(data string) (*[]PinnedResource, error) {
p := new([]PinnedResource)
err := json.Unmarshal([]byte(data), p)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册