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

fix golint failures (#4439)

* fix golint failures

* fix golint failures
上级 3f890689
......@@ -22,7 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// FilterPodsByControllerResource returns a subset of pods controlled by given deployment.
// FilterDeploymentPodsByOwnerReference returns a subset of pods controlled by given deployment.
func FilterDeploymentPodsByOwnerReference(deployment apps.Deployment, allRS []apps.ReplicaSet,
allPods []v1.Pod) []v1.Pod {
var matchingPods []v1.Pod
......
......@@ -26,7 +26,7 @@ import (
kubernetes "k8s.io/client-go/kubernetes"
)
// ConfigMapListComponent contains a list of Config Maps in the cluster.
// ConfigMapList contains a list of Config Maps in the cluster.
type ConfigMapList struct {
ListMeta api.ListMeta `json:"listMeta"`
......
......@@ -27,7 +27,7 @@ import (
client "k8s.io/client-go/kubernetes"
)
// CronJobListComponent contains a list of CronJobs in the cluster.
// CronJobList contains a list of CronJobs in the cluster.
type CronJobList struct {
ListMeta api.ListMeta `json:"listMeta"`
CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"`
......
......@@ -24,7 +24,7 @@ import (
k8sClient "k8s.io/client-go/kubernetes"
)
// DaemonSeDetail represents detailed information about a Daemon Set.
// DaemonSetDetail represents detailed information about a Daemon Set.
type DaemonSetDetail struct {
// Extends list item structure.
DaemonSet `json:",inline"`
......@@ -35,7 +35,7 @@ type DaemonSetDetail struct {
Errors []error `json:"errors"`
}
// Returns detailed information about the given daemon set in the given namespace.
// GetDaemonSetDetail Returns detailed information about the given daemon set in the given namespace.
func GetDaemonSetDetail(client k8sClient.Interface, metricClient metricapi.MetricClient,
namespace, name string) (*DaemonSetDetail, error) {
......
......@@ -26,7 +26,7 @@ import (
"k8s.io/client-go/kubernetes"
)
// DaemonSetListComponent contains a list of Daemon Sets in the cluster.
// DaemonSetList contains a list of Daemon Sets in the cluster.
type DaemonSetList struct {
ListMeta api.ListMeta `json:"listMeta"`
DaemonSets []DaemonSet `json:"daemonSets"`
......
......@@ -32,7 +32,7 @@ type Ingress struct {
Endpoints []common.Endpoint `json:"endpoints"`
}
// IngressListComponent - response structure for a queried ingress list.
// IngressList - response structure for a queried ingress list.
type IngressList struct {
api.ListMeta `json:"listMeta"`
......
......@@ -28,7 +28,7 @@ import (
client "k8s.io/client-go/kubernetes"
)
// JobListComponent contains a list of Jobs in the cluster.
// JobList contains a list of Jobs in the cluster.
type JobList struct {
ListMeta api.ListMeta `json:"listMeta"`
CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"`
......@@ -46,11 +46,11 @@ type JobList struct {
type JobStatusType string
const (
// JobRunning means the job is still running.
// JobStatusRunning means the job is still running.
JobStatusRunning JobStatusType = "Running"
// JobComplete means the job has completed its execution.
// JobStatusComplete means the job has completed its execution.
JobStatusComplete JobStatusType = "Complete"
// JobFailed means the job has failed its execution.
// JobStatusFailed means the job has failed its execution.
JobStatusFailed JobStatusType = "Failed"
)
......
......@@ -27,12 +27,11 @@ func (rMap rangeMap) getRange(resource api.ResourceName) *LimitRangeItem {
if !ok {
rMap[resource] = &LimitRangeItem{}
return rMap[resource]
} else {
return r
}
return r
}
// LimitRange provides resource limit range values
// LimitRangeItem provides resource limit range values
type LimitRangeItem struct {
// ResourceName usage constraints on this kind by resource name
ResourceName string `json:"resourceName,omitempty"`
......
......@@ -25,7 +25,7 @@ import (
"k8s.io/client-go/kubernetes"
)
// PersistentVolumeClaimListComponent contains a list of Persistent Volume Claims in the cluster.
// PersistentVolumeClaimList contains a list of Persistent Volume Claims in the cluster.
type PersistentVolumeClaimList struct {
ListMeta api.ListMeta `json:"listMeta"`
......
......@@ -28,7 +28,7 @@ import (
k8sClient "k8s.io/client-go/kubernetes"
)
// PodListComponent contains a list of Pods in the cluster.
// PodList contains a list of Pods in the cluster.
type PodList struct {
ListMeta api.ListMeta `json:"listMeta"`
CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"`
......
......@@ -28,7 +28,7 @@ import (
client "k8s.io/client-go/kubernetes"
)
// ReplicaSetListComponent contains a list of Replica Sets in the cluster.
// ReplicaSetList contains a list of Replica Sets in the cluster.
type ReplicaSetList struct {
ListMeta api.ListMeta `json:"listMeta"`
CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"`
......
......@@ -27,7 +27,7 @@ import (
client "k8s.io/client-go/kubernetes"
)
// ReplicationControllerListComponent contains a list of Replication Controllers in the cluster.
// ReplicationControllerList contains a list of Replication Controllers in the cluster.
type ReplicationControllerList struct {
ListMeta api.ListMeta `json:"listMeta"`
CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"`
......
......@@ -33,10 +33,10 @@ const (
// SystemBannerSeverityInfo is the lowest of allowed system banner severities.
SystemBannerSeverityInfo SystemBannerSeverity = "INFO"
// SystemBannerSeverityInfo is in the middle of allowed system banner severities.
// SystemBannerSeverityWarning is in the middle of allowed system banner severities.
SystemBannerSeverityWarning SystemBannerSeverity = "WARNING"
// SystemBannerSeverityInfo is the highest of allowed system banner severities.
// SystemBannerSeverityError is the highest of allowed system banner severities.
SystemBannerSeverityError SystemBannerSeverity = "ERROR"
)
......
......@@ -23,13 +23,13 @@ import (
"k8s.io/client-go/kubernetes"
)
// RBACStatus describes status of RBAC in the cluster.
// RbacStatus describes status of RBAC in the cluster.
type RbacStatus struct {
// True when RBAC is enabled in the cluster.
Enabled bool `json:"enabled"`
}
// ValidateRBACStatus validates if RBAC is enabled in the cluster.
// ValidateRbacStatus validates if RBAC is enabled in the cluster.
// Supported version of RBAC api is: 'rbac.authorization.k8s.io/v1beta1'
func ValidateRbacStatus(client kubernetes.Interface) (*RbacStatus, error) {
groupList, err := client.Discovery().ServerGroups()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册