Skip to content

Commit

Permalink
Apply suggested variable renames
Browse files Browse the repository at this point in the history
  • Loading branch information
chrkl committed Feb 7, 2024
1 parent cd06567 commit a3bbbdf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/fluentbit/config/builder/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func createInputSection(pipeline *telemetryv1alpha1.LogPipeline, includePath, ex
}

func createIncludePath(pipeline *telemetryv1alpha1.LogPipeline) string {
var toInclude []string
var includePath []string

includeNamespaces := []string{"*"}
if len(pipeline.Spec.Input.Application.Namespaces.Include) > 0 {
Expand All @@ -40,15 +40,15 @@ func createIncludePath(pipeline *telemetryv1alpha1.LogPipeline) string {

for _, ns := range includeNamespaces {
for _, container := range includeContainers {
toInclude = append(toInclude, makeLogPath(ns, "*", container))
includePath = append(includePath, makeLogPath(ns, "*", container))
}
}

return strings.Join(toInclude, ",")
return strings.Join(includePath, ",")
}

func createExcludePath(pipeline *telemetryv1alpha1.LogPipeline) string {
toExclude := []string{
excludePath := []string{
makeLogPath("kyma-system", "telemetry-fluent-bit-*", "fluent-bit"),
}

Expand All @@ -58,14 +58,14 @@ func createExcludePath(pipeline *telemetryv1alpha1.LogPipeline) string {
}

for _, ns := range excludeNamespaces {
toExclude = append(toExclude, makeLogPath(ns, "*", "*"))
excludePath = append(excludePath, makeLogPath(ns, "*", "*"))
}

for _, container := range pipeline.Spec.Input.Application.Containers.Exclude {
toExclude = append(toExclude, makeLogPath("*", "*", container))
excludePath = append(excludePath, makeLogPath("*", "*", container))
}

return strings.Join(toExclude, ",")
return strings.Join(excludePath, ",")
}

func makeLogPath(namespace, pod, container string) string {
Expand Down

0 comments on commit a3bbbdf

Please sign in to comment.