diff --git a/deploy/helm/elastic-agent/templates/agent/_helpers.tpl b/deploy/helm/elastic-agent/templates/agent/_helpers.tpl index 52e39e2888a..5640f54906e 100644 --- a/deploy/helm/elastic-agent/templates/agent/_helpers.tpl +++ b/deploy/helm/elastic-agent/templates/agent/_helpers.tpl @@ -95,8 +95,8 @@ Initialise input templates if we are not deploying as managed {{- $customInputPresetName := ($customInputVal).preset -}} {{- $presetVal := get $.Values.agent.presets $customInputPresetName -}} {{- $_ := required (printf "preset with name \"%s\" of customInput \"%s\" not defined" $customInputPresetName $customInputName) $customInputVal -}} -{{- $customInputOuput := ($customInputVal).use_output -}} -{{- include "elasticagent.preset.mutate.outputs.byname" (list $ $presetVal $customInputOuput) -}} +{{- $customInputOutput := ($customInputVal).use_output -}} +{{- include "elasticagent.preset.mutate.outputs.byname" (list $ $presetVal $customInputOutput) -}} {{- include "elasticagent.preset.mutate.inputs" (list $ $presetVal (list $customInputVal)) -}} {{- end -}} {{- end -}} @@ -429,9 +429,9 @@ app.kubernetes.io/version: {{ .Values.agent.version}} {{- $ := index . 0 -}} {{- $preset := index . 1 -}} {{- $outputName := index . 2 -}} -{{- $ouputVal := get $.Values.outputs $outputName }} -{{- $_ := required (printf "output \"%s\" is not defined" $outputName) $ouputVal -}} -{{- $outputCopy := deepCopy $ouputVal -}} +{{- $outputVal := get $.Values.outputs $outputName }} +{{- $_ := required (printf "output \"%s\" is not defined" $outputName) $outputVal -}} +{{- $outputCopy := deepCopy $outputVal -}} {{- $presetOutputs := dig "outputs" (dict) $preset -}} {{- if not (hasKey $presetOutputs $outputName) -}} {{- $_ := set $presetOutputs $outputName $outputCopy}} diff --git a/deploy/helm/elastic-agent/templates/agent/eck/daemonset.yaml b/deploy/helm/elastic-agent/templates/agent/eck/daemonset.yaml index 12a82551fc1..09a362f9796 100644 --- a/deploy/helm/elastic-agent/templates/agent/eck/daemonset.yaml +++ b/deploy/helm/elastic-agent/templates/agent/eck/daemonset.yaml @@ -22,15 +22,15 @@ spec: configRef: secretName: {{ $agentName }} {{- with ($presetVal).outputs }} - {{- $eckOuputs := list }} + {{- $eckOutputs := list }} {{- range $outputName, $outputVal := . -}} {{- if eq ($outputVal).type "ESECKRef" -}} - {{- $eckOuputs = append $eckOuputs (include "elasticagent.output.ESECKRef.preset.config" (list $ $outputName $outputVal) | fromYaml) -}} + {{- $eckOutputs = append $eckOutputs (include "elasticagent.output.ESECKRef.preset.config" (list $ $outputName $outputVal) | fromYaml) -}} {{- end -}} {{- end -}} - {{- if gt (len $eckOuputs) 0 }} + {{- if gt (len $eckOutputs) 0 }} elasticsearchRefs: - {{- $eckOuputs | toYaml | nindent 4 -}} + {{- $eckOutputs | toYaml | nindent 4 -}} {{- end -}} {{- end }} daemonSet: diff --git a/deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml b/deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml index 9b166ccc33b..c9ba6bde8e9 100644 --- a/deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml +++ b/deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml @@ -22,15 +22,15 @@ spec: configRef: secretName: {{ $agentName }} {{- with ($presetVal).outputs }} - {{- $eckOuputs := list }} + {{- $eckOutputs := list }} {{- range $outputName, $outputVal := . -}} {{- if eq ($outputVal).type "ESECKRef" -}} - {{- $eckOuputs = append $eckOuputs (include "elasticagent.output.ESECKRef.preset.config" (list $ $outputName $outputVal) | fromYaml) -}} + {{- $eckOutputs = append $eckOutputs (include "elasticagent.output.ESECKRef.preset.config" (list $ $outputName $outputVal) | fromYaml) -}} {{- end -}} {{- end -}} - {{- if gt (len $eckOuputs) 0 }} + {{- if gt (len $eckOutputs) 0 }} elasticsearchRefs: - {{- $eckOuputs | toYaml | nindent 4 -}} + {{- $eckOutputs | toYaml | nindent 4 -}} {{- end -}} {{- end }} deployment: diff --git a/deploy/helm/elastic-agent/templates/agent/eck/statefulset.yaml b/deploy/helm/elastic-agent/templates/agent/eck/statefulset.yaml index a30673004bc..c58a8907758 100644 --- a/deploy/helm/elastic-agent/templates/agent/eck/statefulset.yaml +++ b/deploy/helm/elastic-agent/templates/agent/eck/statefulset.yaml @@ -22,15 +22,15 @@ spec: configRef: secretName: {{ $agentName }} {{- with ($presetVal).outputs }} - {{- $eckOuputs := list }} + {{- $eckOutputs := list }} {{- range $outputName, $outputVal := . -}} {{- if eq ($outputVal).type "ESECKRef" -}} - {{- $eckOuputs = append $eckOuputs (include "elasticagent.output.ESECKRef.preset.config" (list $ $outputName $outputVal) | fromYaml) -}} + {{- $eckOutputs = append $eckOutputs (include "elasticagent.output.ESECKRef.preset.config" (list $ $outputName $outputVal) | fromYaml) -}} {{- end -}} {{- end -}} - {{- if gt (len $eckOuputs) 0 }} + {{- if gt (len $eckOutputs) 0 }} elasticsearchRefs: - {{- $eckOuputs | toYaml | nindent 4 -}} + {{- $eckOutputs | toYaml | nindent 4 -}} {{- end -}} {{- end }} statefulSet: diff --git a/deploy/helm/elastic-agent/templates/integrations/_presets/_ksm_sidecar.tpl b/deploy/helm/elastic-agent/templates/integrations/_presets/_ksm_sidecar.tpl index db5e53a2db8..257ffab8909 100644 --- a/deploy/helm/elastic-agent/templates/integrations/_presets/_ksm_sidecar.tpl +++ b/deploy/helm/elastic-agent/templates/integrations/_presets/_ksm_sidecar.tpl @@ -93,8 +93,8 @@ env: value: "/usr/share/elastic-agent/state" {{- if eq $.Values.agent.fleet.enabled false -}} {{- $outputName := $.Values.kubernetes.output -}} -{{- $ouputVal := get $.Values.outputs $.Values.kubernetes.output }} -{{- (include (printf "elasticagent.output.%s.preset.envvars" ($ouputVal).type) (list $ $outputName $ouputVal)) | nindent 2 }} +{{- $outputVal := get $.Values.outputs $.Values.kubernetes.output }} +{{- (include (printf "elasticagent.output.%s.preset.envvars" ($outputVal).type) (list $ $outputName $outputVal)) | nindent 2 }} {{- else -}} {{- with ($fleetMutations).extraEnvs -}} {{- . | toYaml | nindent 2 }} @@ -125,9 +125,9 @@ providers: {{- $agentName := index . 1 -}} {{- $streams := index . 2 -}} {{- $outputName := $.Values.kubernetes.output -}} -{{- $ouputVal := get $.Values.outputs $outputName }} +{{- $outputVal := get $.Values.outputs $outputName }} {{- $presetVal := dict }} -{{- $_ := set $presetVal "outputs" (dict $outputName $ouputVal) }} +{{- $_ := set $presetVal "outputs" (dict $outputName $outputVal) }} {{- with (include "elasticagent.presets.ksm.sidecar.providers" $ | fromYaml).providers }} {{- $_ := set $presetVal "providers" . }} {{- end }} diff --git a/internal/pkg/agent/application/monitoring/v1_monitor.go b/internal/pkg/agent/application/monitoring/v1_monitor.go index f37ff276424..b4ae2df6446 100644 --- a/internal/pkg/agent/application/monitoring/v1_monitor.go +++ b/internal/pkg/agent/application/monitoring/v1_monitor.go @@ -76,7 +76,7 @@ const ( ) var ( - errNoOuputPresent = errors.New("outputs not part of the config") + errNoOutputPresent = errors.New("outputs not part of the config") supportedMetricsComponents = []string{"filebeat", "metricbeat", "apm-server", "auditbeat", "cloudbeat", "fleet-server", "heartbeat", "osquerybeat", "packetbeat", "pf-elastic-collector", "pf-elastic-symbolizer"} supportedBeatsComponents = []string{"filebeat", "metricbeat", "apm-server", "fleet-server", "auditbeat", "cloudbeat", "heartbeat", "osquerybeat", "packetbeat", "pf-elastic-collector", "pf-elastic-symbolizer"} ) @@ -220,9 +220,9 @@ func (b *BeatsMonitor) MonitoringConfig( componentInfos := b.getComponentInfos(components, componentIDPidMap) - if err := b.injectMonitoringOutput(policy, cfg, monitoringOutputName); err != nil && !errors.Is(err, errNoOuputPresent) { + if err := b.injectMonitoringOutput(policy, cfg, monitoringOutputName); err != nil && !errors.Is(err, errNoOutputPresent) { return nil, errors.New(err, "failed to inject monitoring output") - } else if errors.Is(err, errNoOuputPresent) { + } else if errors.Is(err, errNoOutputPresent) { // nothing to inject, no monitoring output return nil, nil } @@ -376,7 +376,7 @@ func (b *BeatsMonitor) initInputs(cfg map[string]interface{}) { func (b *BeatsMonitor) injectMonitoringOutput(source, dest map[string]interface{}, monitoringOutputName string) error { outputsNode, found := source[outputsKey] if !found { - return errNoOuputPresent + return errNoOutputPresent } outputs, ok := outputsNode.(map[string]interface{})