Skip to content

Commit 2519807

Browse files
Merge pull request #897 from jlarriba/fix-rsyslog-template-empty-value
Allow empty rsyslogTemplate for Go-constructed CRs
2 parents 8beadf5 + 8722819 commit 2519807

6 files changed

Lines changed: 9 additions & 1 deletion

File tree

api/bases/telemetry.openstack.org_loggings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ spec:
8888
default: RSYSLOG_TraditionalFileFormat
8989
description: The template format for rsyslog forwarding actions
9090
enum:
91+
- ""
9192
- RSYSLOG_TraditionalFileFormat
9293
- RSYSLOG_SyslogProtocol23Format
9394
type: string

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ spec:
14181418
default: RSYSLOG_TraditionalFileFormat
14191419
description: The template format for rsyslog forwarding actions
14201420
enum:
1421+
- ""
14211422
- RSYSLOG_TraditionalFileFormat
14221423
- RSYSLOG_SyslogProtocol23Format
14231424
type: string

api/v1beta1/logging_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type LoggingSpec struct {
6262
// The template format for rsyslog forwarding actions
6363
// +kubebuilder:validation:Optional
6464
// +kubebuilder:default=RSYSLOG_TraditionalFileFormat
65-
// +kubebuilder:validation:Enum=RSYSLOG_TraditionalFileFormat;RSYSLOG_SyslogProtocol23Format
65+
// +kubebuilder:validation:Enum="";RSYSLOG_TraditionalFileFormat;RSYSLOG_SyslogProtocol23Format
6666
RsyslogTemplate string `json:"rsyslogTemplate"`
6767
}
6868

config/crd/bases/telemetry.openstack.org_loggings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ spec:
8888
default: RSYSLOG_TraditionalFileFormat
8989
description: The template format for rsyslog forwarding actions
9090
enum:
91+
- ""
9192
- RSYSLOG_TraditionalFileFormat
9293
- RSYSLOG_SyslogProtocol23Format
9394
type: string

config/crd/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ spec:
14181418
default: RSYSLOG_TraditionalFileFormat
14191419
description: The template format for rsyslog forwarding actions
14201420
enum:
1421+
- ""
14211422
- RSYSLOG_TraditionalFileFormat
14221423
- RSYSLOG_SyslogProtocol23Format
14231424
type: string

internal/controller/logging_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ func (r *LoggingReconciler) generateComputeServiceConfig(
294294
instance.Spec.RsyslogQueueType = "linkedList"
295295
}
296296

297+
if instance.Spec.RsyslogTemplate == "" {
298+
instance.Spec.RsyslogTemplate = "RSYSLOG_TraditionalFileFormat"
299+
}
300+
297301
templateParameters := map[string]any{
298302
"RsyslogAddress": service.Annotations["metallb.universe.tf/loadBalancerIPs"],
299303
"RsyslogPort": instance.Spec.Port,

0 commit comments

Comments
 (0)