Skip to content

Commit 50c6a42

Browse files
authored
feat: add logging plugin show timezone selector option (#991)
Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
1 parent cd13c3d commit 50c6a42

File tree

6 files changed

+39
-8
lines changed

6 files changed

+39
-8
lines changed

bundle/manifests/observability-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ metadata:
4343
certified: "false"
4444
console.openshift.io/operator-monitoring-default: "true"
4545
containerImage: observability-operator:1.3.0
46-
createdAt: "2026-01-19T11:48:44Z"
46+
createdAt: "2026-01-30T11:23:09Z"
4747
description: A Go based Kubernetes operator to setup and manage highly available
4848
Monitoring Stack using Prometheus, Alertmanager and Thanos Querier.
4949
operatorframework.io/cluster-monitoring: "true"

bundle/manifests/observability.openshift.io_uiplugins.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ spec:
138138
- otel
139139
- select
140140
type: string
141+
showTimezoneSelector:
142+
description: |-
143+
ShowTimezoneSelector indicates whether to show the timezone selector in the UI.
144+
145+
Defaults to false if not specified.
146+
type: boolean
141147
timeout:
142148
description: |-
143149
Timeout is the maximum duration before a query timeout.

deploy/crds/common/observability.openshift.io_uiplugins.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ spec:
138138
- otel
139139
- select
140140
type: string
141+
showTimezoneSelector:
142+
description: |-
143+
ShowTimezoneSelector indicates whether to show the timezone selector in the UI.
144+
145+
Defaults to false if not specified.
146+
type: boolean
141147
timeout:
142148
description: |-
143149
Timeout is the maximum duration before a query timeout.

docs/api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5378,6 +5378,15 @@ Defaults to "viaq" if not specified. Use "otel" for OpenTelemetry schema, or "se
53785378
<i>Enum</i>: viaq, otel, select<br/>
53795379
</td>
53805380
<td>false</td>
5381+
</tr><tr>
5382+
<td><b>showTimezoneSelector</b></td>
5383+
<td>boolean</td>
5384+
<td>
5385+
ShowTimezoneSelector indicates whether to show the timezone selector in the UI.
5386+
5387+
Defaults to false if not specified.<br/>
5388+
</td>
5389+
<td>false</td>
53815390
</tr><tr>
53825391
<td><b>timeout</b></td>
53835392
<td>string</td>

pkg/apis/uiplugin/v1alpha1/types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ type LoggingConfig struct {
128128
// +kubebuilder:validation:Optional
129129
// +kubebuilder:validation:Enum=viaq;otel;select
130130
Schema string `json:"schema,omitempty"`
131+
132+
// ShowTimezoneSelector indicates whether to show the timezone selector in the UI.
133+
//
134+
// Defaults to false if not specified.
135+
//
136+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OCP Console Logs show timezone selector",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:ocpConsoleLogsShowTimezoneSelector"}
137+
// +kubebuilder:validation:Optional
138+
ShowTimezoneSelector bool `json:"showTimezoneSelector,omitempty"`
131139
}
132140

133141
// LokiStackReference is used to configure a reference to a LokiStack that should be used

pkg/controllers/uiplugin/logging.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ import (
2323
)
2424

2525
type loggingConfig struct {
26-
LogsLimit int32 `yaml:"logsLimit,omitempty"`
27-
Timeout time.Duration `yaml:"timeout,omitempty"`
28-
Schema string `yaml:"schema,omitempty"`
26+
LogsLimit int32 `yaml:"logsLimit,omitempty"`
27+
Timeout time.Duration `yaml:"timeout,omitempty"`
28+
Schema string `yaml:"schema,omitempty"`
29+
ShowTimezoneSelector bool `yaml:"showTimezoneSelector,omitempty"`
2930
}
3031

3132
func createLoggingPluginInfo(plugin *uiv1alpha1.UIPlugin, namespace, name, image string, features []string, ctx context.Context, dk dynamic.Interface, logger logr.Logger, korrel8rImage string) (*UIPluginInfo, error) {
@@ -146,7 +147,7 @@ func marshalLoggingPluginConfig(cfg *uiv1alpha1.LoggingConfig) (string, error) {
146147
return "", nil
147148
}
148149

149-
if cfg.LogsLimit == 0 && cfg.Timeout == "" && cfg.Schema == "" {
150+
if cfg.LogsLimit == 0 && cfg.Timeout == "" && cfg.Schema == "" && !cfg.ShowTimezoneSelector {
150151
return "", nil
151152
}
152153

@@ -160,9 +161,10 @@ func marshalLoggingPluginConfig(cfg *uiv1alpha1.LoggingConfig) (string, error) {
160161
}
161162

162163
pluginCfg := loggingConfig{
163-
LogsLimit: cfg.LogsLimit,
164-
Timeout: timeout,
165-
Schema: cfg.Schema,
164+
LogsLimit: cfg.LogsLimit,
165+
Timeout: timeout,
166+
Schema: cfg.Schema,
167+
ShowTimezoneSelector: cfg.ShowTimezoneSelector,
166168
}
167169

168170
buf := &bytes.Buffer{}

0 commit comments

Comments
 (0)