Unexport some constants (#1393)

* fix the space issue

* merge shenanigans

* nit and tests

* Unexport some constants that don't seem to be used anywhere
This commit is contained in:
Victor Agababov 2020-06-09 11:40:32 -07:00 committed by GitHub
parent 8b0054f5f1
commit fef70cc261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View File

@ -28,7 +28,7 @@ import (
cm "knative.dev/pkg/configmap"
)
const ConfigMapNameEnv = "CONFIG_LEADERELECTION_NAME"
const configMapNameEnv = "CONFIG_LEADERELECTION_NAME"
var validResourceLocks = sets.NewString("leases", "configmaps", "endpoints")
@ -123,7 +123,7 @@ func defaultComponentConfig(name string) ComponentConfig {
// ConfigMapName returns the name of the configmap to read for leader election
// settings.
func ConfigMapName() string {
cm := os.Getenv(ConfigMapNameEnv)
cm := os.Getenv(configMapNameEnv)
if cm == "" {
return "config-leader-election"
}

View File

@ -31,9 +31,8 @@ import (
"knative.dev/pkg/logging/logkey"
)
const ConfigMapNameEnv = "CONFIG_LOGGING_NAME"
const (
configMapNameEnv = "CONFIG_LOGGING_NAME"
loggerConfigKey = "zap-logger-config"
fallbackLoggerName = "fallback-logger"
)
@ -233,7 +232,7 @@ func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicL
// ConfigMapName gets the name of the logging ConfigMap
func ConfigMapName() string {
cm := os.Getenv(ConfigMapNameEnv)
cm := os.Getenv(configMapNameEnv)
if cm == "" {
return "config-logging"
}

View File

@ -29,10 +29,10 @@ const (
DefaultLogURLTemplate = "http://localhost:8001/api/v1/namespaces/knative-monitoring/services/kibana-logging/proxy/app/kibana#/discover?_a=(query:(match:(kubernetes.labels.knative-dev%2FrevisionUID:(query:'${REVISION_UID}',type:phrase))))"
// The following is used to set the default metrics backend
DefaultRequestMetricsBackend = "prometheus"
defaultRequestMetricsBackend = "prometheus"
// The env var name for config-observability
ConfigMapNameEnv = "CONFIG_OBSERVABILITY_NAME"
configMapNameEnv = "CONFIG_OBSERVABILITY_NAME"
)
// ObservabilityConfig contains the configuration defined in the observability ConfigMap.
@ -64,7 +64,7 @@ type ObservabilityConfig struct {
func defaultConfig() *ObservabilityConfig {
return &ObservabilityConfig{
LoggingURLTemplate: DefaultLogURLTemplate,
RequestMetricsBackend: DefaultRequestMetricsBackend,
RequestMetricsBackend: defaultRequestMetricsBackend,
}
}
@ -95,7 +95,7 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab
// ConfigMapName gets the name of the metrics ConfigMap
func ConfigMapName() string {
cm := os.Getenv(ConfigMapNameEnv)
cm := os.Getenv(configMapNameEnv)
if cm == "" {
return "config-observability"
}