cleaning up

mine
derailed 2020-11-11 04:50:23 -07:00
parent 4d76440b38
commit 69bcd641ac
5 changed files with 8 additions and 5 deletions

View File

@ -45,7 +45,7 @@ type APIClient struct {
connOK bool
}
// NewTestClient for testing ONLY!!
// NewTestAPIClient for testing ONLY!!
func NewTestAPIClient() *APIClient {
return &APIClient{
config: NewConfig(nil),

View File

@ -2,8 +2,10 @@ package client
import metricsapi "k8s.io/metrics/pkg/apis/metrics"
// Error represents an error.
type Error string
// Error returns the error text.
func (e Error) Error() string {
return string(e)
}

View File

@ -172,7 +172,7 @@ func (m *MetricsServer) FetchNodesMetrics(ctx context.Context) (*mv1beta1.NodeMe
return mxList, nil
}
// FetchNodesMetrics return all metrics for nodes.
// FetchNodeMetrics return all metrics for nodes.
func (m *MetricsServer) FetchNodeMetrics(ctx context.Context, n string) (*mv1beta1.NodeMetrics, error) {
const msg = "user is not authorized to list node metrics"
@ -243,6 +243,7 @@ func (m *MetricsServer) FetchPodsMetrics(ctx context.Context, ns string) (*mv1be
return mxList, err
}
// FetchContainersMetrics returns a pod's containers metrics.
func (m *MetricsServer) FetchContainersMetrics(ctx context.Context, fqn string) (ContainersMetrics, error) {
mm, err := m.FetchPodMetrics(ctx, fqn)
if err != nil {

View File

@ -63,10 +63,10 @@ var (
// ContainersMetrics tracks containers metrics.
type ContainersMetrics map[string]*mv1beta1.ContainerMetrics
// NodesMetrics tracks node metrics.
// NodesMetricsMap tracks node metrics.
type NodesMetricsMap map[string]*mv1beta1.NodeMetrics
// PodsMetrics tracks pod metrics.
// PodsMetricsMap tracks pod metrics.
type PodsMetricsMap map[string]*mv1beta1.PodMetrics
// Authorizer checks what a user can or cannot do to a resource.

View File

@ -38,7 +38,7 @@ func (*SemVer) parse(version string) (major, minor, patch int) {
return
}
// Normalize ensures the version starts with a v.
// NormalizeVersion ensures the version starts with a v.
func NormalizeVersion(version string) string {
if version == "" {
return version