Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Jul 6, 2021
1 parent e8f7d66 commit 3a0fd41
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
14 changes: 7 additions & 7 deletions pkg/apis/kibana/v1/kibana_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (k *Kibana) GetAssociations() []commonv1.Association {
if ref.IsDefined() {
associations = append(associations, &KbMonitoringAssociation{
Kibana: k,
ref: ref.WithDefaultNamespace(k.Namespace).NamespacedName(),
ref: ref.WithDefaultNamespace(k.Namespace).NamespacedName(),
})
}
}
Expand Down Expand Up @@ -344,12 +344,12 @@ func (kbent *KibanaEntAssociation) AssociationID() string {
func (k *Kibana) GetMonitoringMetricsAssociation() []commonv1.Association {
associations := make([]commonv1.Association, 0)
for _, ref := range k.Spec.Monitoring.Metrics.ElasticsearchRefs {
if ref.IsDefined() {
associations = append(associations, &KbMonitoringAssociation{
Kibana: k,
ref: ref.WithDefaultNamespace(k.Namespace).NamespacedName(),
})
}
if ref.IsDefined() {
associations = append(associations, &KbMonitoringAssociation{
Kibana: k,
ref: ref.WithDefaultNamespace(k.Namespace).NamespacedName(),
})
}
}
return associations
}
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/common/stackmon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ func mergeConfig(rawConfig string, config map[string]interface{}) ([]byte, error
return cfgBytes, nil
}


// inputConfigData holds data to configure the Metricbeat Elasticsearch and Kibana modules used
// to collect metrics for Stack Monitoring
type inputConfigData struct {
Expand Down
24 changes: 12 additions & 12 deletions pkg/controller/kibana/stackmon/kb_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (

var (
MonitoringKibanaCollectionEnabled = "monitoring.kibana.collection.enabled"
XPackSecurityAuditEnabled = "xpack.security.audit.enabled"
XPackSecurityAuditEnabled = "xpack.security.audit.enabled"

LoggingAppendersJsonFileAppenderType = "logging.appenders.rolling-file.type"
LoggingAppendersJsonFileAppenderFilename = "logging.appenders.rolling-file.fileName"
LoggingAppendersJsonFileAppenderLayoutType = "logging.appenders.rolling-file.layout.type"
LoggingAppendersJsonFileAppenderPolicyType = "logging.appenders.rolling-file.policy.type"
LoggingAppendersJsonFileAppenderPolicySize = "logging.appenders.rolling-file.policy.size"
LoggingRootAppenders = "logging.root.appenders"
LoggingAppendersJSONFileAppenderType = "logging.appenders.rolling-file.type"
LoggingAppendersJSONFileAppenderFilename = "logging.appenders.rolling-file.fileName"
LoggingAppendersJSONFileAppenderLayoutType = "logging.appenders.rolling-file.layout.type"
LoggingAppendersJSONFileAppenderPolicyType = "logging.appenders.rolling-file.policy.type"
LoggingAppendersJSONFileAppenderPolicySize = "logging.appenders.rolling-file.policy.size"
LoggingRootAppenders = "logging.root.appenders"
)

// MonitoringConfig returns the Kibana settings required to enable the collection of monitoring data and disk logging
Expand All @@ -37,11 +37,11 @@ func MonitoringConfig(kb kbv1.Kibana) commonv1.Config {
cfg.Data = map[string]interface{}{}
}
cfg.Data[XPackSecurityAuditEnabled] = true
cfg.Data[LoggingAppendersJsonFileAppenderType] = "rolling-file"
cfg.Data[LoggingAppendersJsonFileAppenderFilename] = filepath.Join(kibanaLogsMountPath, kibanaLogFilename)
cfg.Data[LoggingAppendersJsonFileAppenderLayoutType] = "json"
cfg.Data[LoggingAppendersJsonFileAppenderPolicyType] = "size-limit"
cfg.Data[LoggingAppendersJsonFileAppenderPolicySize] = "50mb"
cfg.Data[LoggingAppendersJSONFileAppenderType] = "rolling-file"
cfg.Data[LoggingAppendersJSONFileAppenderFilename] = filepath.Join(kibanaLogsMountPath, kibanaLogFilename)
cfg.Data[LoggingAppendersJSONFileAppenderLayoutType] = "JSON"
cfg.Data[LoggingAppendersJSONFileAppenderPolicyType] = "size-limit"
cfg.Data[LoggingAppendersJSONFileAppenderPolicySize] = "50mb"
cfg.Data[LoggingRootAppenders] = []string{"default", "rolling-file"}
}
return cfg
Expand Down
5 changes: 1 addition & 4 deletions pkg/controller/kibana/stackmon/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (

kibanaLogsVolumeName = "kibana-logs"
kibanaLogsMountPath = "/usr/share/kibana/logs"
kibanaLogFilename = "kibana.json"
kibanaLogFilename = "kibana.json"
)

func IsMonitoringMetricsDefined(kb kbv1.Kibana) bool {
Expand Down Expand Up @@ -125,6 +125,3 @@ func WithMonitoring(client k8s.Client, builder *defaults.PodTemplateBuilder, kb

return builder, nil
}



0 comments on commit 3a0fd41

Please sign in to comment.