Skip to content

Commit

Permalink
fix: update log levels to reflect alertmanager levels (#221)
Browse files Browse the repository at this point in the history
This updates the valid log level values in the API. This adds new
"error" log level and changes the "warning" log level to "warn".
  • Loading branch information
tremes authored Nov 16, 2022
1 parent f412734 commit b71d145
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion bundle/manifests/monitoring.rhobs_monitoringstacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ spec:
enum:
- debug
- info
- warning
- warn
- error
type: string
namespaceSelector:
description: Namespace selector for Monitoring Stack Resources. If
Expand Down
3 changes: 2 additions & 1 deletion deploy/crds/common/monitoring.rhobs_monitoringstacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ spec:
enum:
- debug
- info
- warning
- warn
- error
type: string
namespaceSelector:
description: Namespace selector for Monitoring Stack Resources. If
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ MonitoringStackSpec is the specification for desired Monitoring Stack
<td>
Loglevel set log levels of configured components<br/>
<br/>
<i>Enum</i>: debug, info, warning<br/>
<i>Enum</i>: debug, info, warn, error<br/>
<i>Default</i>: info<br/>
</td>
<td>false</td>
Expand Down
9 changes: 6 additions & 3 deletions pkg/apis/monitoring/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type MonitoringStackList struct {
}

// Loglevel set log levels of configured components
// +kubebuilder:validation:Enum=debug;info;warning
// +kubebuilder:validation:Enum=debug;info;warn;error
type LogLevel string

const (
Expand All @@ -44,8 +44,11 @@ const (
// Info Log level
Info LogLevel = "info"

// Warning Log level
Warning LogLevel = "warning"
// Warn Log level
Warn LogLevel = "warn"

// Error Log level
Error LogLevel = "error"
)

// MonitoringStackSpec is the specification for desired Monitoring Stack
Expand Down
1 change: 1 addition & 0 deletions test/e2e/monitoring_stack_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ func validateStackLogLevel(t *testing.T) {
"xyz",
"Info",
"Debug",
"Warning",
}
ms := newMonitoringStack(t, "invalid-loglevel-stack")
for _, v := range invalidLogLevels {
Expand Down

0 comments on commit b71d145

Please sign in to comment.