diff --git a/go.mod b/go.mod index ce7352b02719..891de83235af 100644 --- a/go.mod +++ b/go.mod @@ -620,11 +620,8 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 ) -require github.com/Masterminds/semver v1.5.0 // indirect - require ( dario.cat/mergo v1.0.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible github.com/Shopify/sarama v1.38.1 // indirect github.com/Workiva/go-datastructures v1.1.0 // indirect github.com/drone/envsubst v1.0.3 // indirect diff --git a/go.sum b/go.sum index 88d7658d1b9b..0384745ab682 100644 --- a/go.sum +++ b/go.sum @@ -193,13 +193,9 @@ github.com/Lusitaniae/apache_exporter v0.11.1-0.20220518131644-f9522724dab4/go.m github.com/MasslessParticle/azure-storage-blob-go v0.14.1-0.20220216145902-b5e698eff68e/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Mellanox/rdmamap v0.0.0-20191106181932-7c3c4763a6ee/go.mod h1:jDA6v0TUYrFEIAE5uGJ29LQOeONIgMdP4Rkqb8HUnPM= diff --git a/pkg/config/agent_management_remote_config_test.go b/pkg/config/agent_management_remote_config_test.go index e31d574646be..834375bda3ce 100644 --- a/pkg/config/agent_management_remote_config_test.go +++ b/pkg/config/agent_management_remote_config_test.go @@ -197,7 +197,7 @@ integration_configs: process_names: - name: "grafana-agent" cmdline: - - '{{ "grafana-agent" | replace "grafana-" "" }}' + - 'grafana-agent' - name: "{{.nonexistent.foo.bar.baz.bat}}" cmdline: - "{{ ` + templateInsideTemplate + ` }}" @@ -243,7 +243,7 @@ integration_configs: require.Equal(t, 4, len(processExporterConfig.ProcessExporter)) require.Equal(t, "grafana-agent", processExporterConfig.ProcessExporter[0].Name) - require.Equal(t, "agent", processExporterConfig.ProcessExporter[0].CmdlineRules[0]) + require.Equal(t, "grafana-agent", processExporterConfig.ProcessExporter[0].CmdlineRules[0]) require.Equal(t, 0, len(processExporterConfig.ProcessExporter[0].ExeRules)) require.Equal(t, "", processExporterConfig.ProcessExporter[1].Name) diff --git a/pkg/config/agentmanagement_remote_config.go b/pkg/config/agentmanagement_remote_config.go index 7c6efb12bc4b..8b5093861381 100644 --- a/pkg/config/agentmanagement_remote_config.go +++ b/pkg/config/agentmanagement_remote_config.go @@ -4,7 +4,6 @@ import ( "bytes" "text/template" - "github.com/Masterminds/sprig" "github.com/grafana/agent/pkg/integrations" "github.com/grafana/agent/pkg/logs" "github.com/grafana/agent/pkg/metrics/instance" @@ -165,7 +164,7 @@ func appendExternalLabels(c *Config, externalLabels map[string]string) { } func evaluateTemplate(config string, templateVariables map[string]any) (string, error) { - tpl, err := template.New("config").Funcs(sprig.FuncMap()).Parse(config) + tpl, err := template.New("config").Parse(config) if err != nil { return "", err }