diff --git a/hack/.golint_failures b/hack/.golint_failures index bb8ad55f2b7..47574f6b5ca 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -153,10 +153,8 @@ pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1 pkg/kubelet/client pkg/kubelet/cm pkg/kubelet/config -pkg/kubelet/configmap pkg/kubelet/container pkg/kubelet/container/testing -pkg/kubelet/custommetrics pkg/kubelet/dockershim pkg/kubelet/dockershim/libdocker pkg/kubelet/dockershim/network diff --git a/pkg/kubelet/configmap/configmap_manager.go b/pkg/kubelet/configmap/configmap_manager.go index 76aa1f03fb8..7dca030d22f 100644 --- a/pkg/kubelet/configmap/configmap_manager.go +++ b/pkg/kubelet/configmap/configmap_manager.go @@ -33,6 +33,7 @@ import ( "k8s.io/apimachinery/pkg/watch" ) +// Manager interface provides methods for Kubelet to manage ConfigMap. type Manager interface { // Get configmap by configmap namespace and name. GetConfigMap(namespace, name string) (*v1.ConfigMap, error) @@ -54,6 +55,7 @@ type simpleConfigMapManager struct { kubeClient clientset.Interface } +// NewSimpleConfigMapManager creates a new ConfigMapManager instance. func NewSimpleConfigMapManager(kubeClient clientset.Interface) Manager { return &simpleConfigMapManager{kubeClient: kubeClient} } diff --git a/pkg/kubelet/configmap/fake_manager.go b/pkg/kubelet/configmap/fake_manager.go index 84abcb580b5..959ab6b693f 100644 --- a/pkg/kubelet/configmap/fake_manager.go +++ b/pkg/kubelet/configmap/fake_manager.go @@ -25,6 +25,7 @@ import ( type fakeManager struct { } +// NewFakeManager creates empty/fake ConfigMap manager func NewFakeManager() Manager { return &fakeManager{} } diff --git a/pkg/kubelet/custommetrics/custom_metrics.go b/pkg/kubelet/custommetrics/custom_metrics.go index 55b8870ca49..bb46e029c9f 100644 --- a/pkg/kubelet/custommetrics/custom_metrics.go +++ b/pkg/kubelet/custommetrics/custom_metrics.go @@ -24,13 +24,15 @@ import ( ) const ( + // CustomMetricsDefinitionContainerFile is the file in container that stores Custom Metrics definition CustomMetricsDefinitionContainerFile = "definition.json" + // CustomMetricsDefinitionDir is the dir where Custom Metrics definition is stored CustomMetricsDefinitionDir = "/etc/custom-metrics" ) +// GetCAdvisorCustomMetricsDefinitionPath returns a path to a cAdvisor-specific custom metrics configuration. // Alpha implementation. -// Returns a path to a cAdvisor-specific custom metrics configuration. func GetCAdvisorCustomMetricsDefinitionPath(container *v1.Container) (*string, error) { // Assumes that the container has Custom Metrics enabled if it has "/etc/custom-metrics" directory // mounted as a volume. Custom Metrics definition is expected to be in "definition.json".