mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #78015 from SataQiu/fix-golint-kubelet-20190517
Fix golint failures of pkg/kubelet/configmap pkg/kubelet/custommetrics
This commit is contained in:
commit
480457994d
@ -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
|
||||
|
@ -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}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
type fakeManager struct {
|
||||
}
|
||||
|
||||
// NewFakeManager creates empty/fake ConfigMap manager
|
||||
func NewFakeManager() Manager {
|
||||
return &fakeManager{}
|
||||
}
|
||||
|
@ -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".
|
||||
|
Loading…
Reference in New Issue
Block a user