Skip to content

Commit bbb877a

Browse files
authored
Merge pull request #1661 from kube-logging/fix-tenant-aggregator-detection
fix tenant aggregation detection
2 parents 34c83ba + ad77b62 commit bbb877a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/resources/fluentbit/configsecret.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func (r *Reconciler) configSecret() (runtime.Object, reconciler.DesiredState, er
365365
for _, a := range r.loggingRoutes {
366366
tenants = append(tenants, a.Status.Tenants...)
367367
}
368-
if err := r.configureOutputsForTenants(ctx, tenants, &input, r.fluentdSpec, r.syslogNGSpec); err != nil {
368+
if err := r.configureOutputsForTenants(ctx, tenants, &input); err != nil {
369369
return nil, nil, errors.WrapIf(err, "configuring outputs for target tenants")
370370
}
371371
} else {

pkg/resources/fluentbit/tenants.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func FindTenants(ctx context.Context, target metav1.LabelSelector, reader client
8888
return tenants, nil
8989
}
9090

91-
func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v1beta1.Tenant, input *fluentBitConfig, fluentdSpec *v1beta1.FluentdSpec, syslogNGSpec *v1beta1.SyslogNGSpec) error {
91+
func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v1beta1.Tenant, input *fluentBitConfig) error {
9292
var errs error
9393
for _, t := range tenants {
9494
allNamespaces := len(t.Namespaces) == 0
@@ -100,7 +100,7 @@ func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v
100100
if err := r.resourceReconciler.Client.Get(ctx, types.NamespacedName{Name: t.Name}, logging); err != nil {
101101
return errors.WrapIf(err, "getting logging resource")
102102
}
103-
if fluentdSpec != nil {
103+
if logging.Spec.FluentdSpec != nil {
104104
if input.FluentForwardOutput == nil {
105105
input.FluentForwardOutput = &fluentForwardOutputConfig{}
106106
}
@@ -110,7 +110,7 @@ func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v
110110
Host: aggregatorEndpoint(logging, fluentd.ServiceName),
111111
Port: fluentd.ServicePort,
112112
})
113-
} else if syslogNGSpec != nil {
113+
} else if logging.Spec.SyslogNGSpec != nil {
114114
if input.SyslogNGOutput == nil {
115115
input.SyslogNGOutput = newSyslogNGOutputConfig()
116116
}

0 commit comments

Comments
 (0)