diff --git a/charts/log-router/templates/daemonset.yaml b/charts/log-router/templates/daemonset.yaml index 803a632..a3a9e5e 100755 --- a/charts/log-router/templates/daemonset.yaml +++ b/charts/log-router/templates/daemonset.yaml @@ -143,6 +143,9 @@ spec: {{- if .Values.adminNamespace }} - --admin-namespace={{ .Values.adminNamespace }} {{- end }} + {{- if eq .Values.datasource "fs" }} + - --fs-dir={{ required "fsDatasourceDir is required for fs datasource" .Values.fsDatasourceDir }} + {{- end }} volumeMounts: - name: fluentconf mountPath: /fluentd/etc diff --git a/charts/log-router/values.yaml b/charts/log-router/values.yaml index 712e89a..d67e8ed 100755 --- a/charts/log-router/values.yaml +++ b/charts/log-router/values.yaml @@ -28,6 +28,9 @@ crdMigrationMode: false defaultConfigmap: "fluentd-config" +# Use with datasource: fs, the fsDataSourceDir will be used for finding config files +fsDatasourceDir: "" + image: repository: vmware/kube-fluentd-operator pullPolicy: IfNotPresent diff --git a/config-reloader/datasource/kube_informer.go b/config-reloader/datasource/kube_informer.go index 4ea5d05..b6cdef4 100644 --- a/config-reloader/datasource/kube_informer.go +++ b/config-reloader/datasource/kube_informer.go @@ -375,7 +375,7 @@ func (d *kubeInformerConnection) handlePodChange(ctx context.Context, obj interf buf := new(strings.Builder) if err := template.Render(buf, configdata, map[string]string{ "Namespace": mObj.GetNamespace(), - }); err == nil { + }); err != nil { logrus.Errorf("failed to render config in namespace: %v", mObj.GetNamespace()) } configdata = buf.String()