Skip to content

Commit

Permalink
Cherry-pick #24559 to 7.x: Fix default scope in add_nomad_metadata (#…
Browse files Browse the repository at this point in the history
…24565)

Fix default scope in add_nomad_metadata. It is set to local, but
it should be node. Fix also error message that showed that local
is a valid value.

(cherry picked from commit ab2b478)
  • Loading branch information
jsoriano authored Mar 16, 2021
1 parent fde890a commit a2c6c14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Zoom module pipeline failed to ingest some chat_channel events. {pull}23904[23904]
- Fix Netlow module issue with missing `internal_networks` config parameter. {issue}24094[24094] {pull}24110[24110]
- in httpjson input using encode_as "application/x-www-form-urlencoded" now sets Content-Type correctly {issue}24331[24331] {pull}24336[24336]
- Fix default `scope` in `add_nomad_metadata`. {issue}24559[24559]

*Heartbeat*

Expand Down
2 changes: 1 addition & 1 deletion x-pack/libbeat/autodiscover/providers/nomad/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *Config) Validate() error {
case ScopeNode:
case ScopeCluster:
default:
return fmt.Errorf("invalid value for `scope`, select `%s` or `%s`", ScopeNode, ScopeCluster)
return fmt.Errorf("invalid value for `scope`: %s, select `%s` or `%s`", c.Scope, ScopeNode, ScopeCluster)
}
return nil
}
4 changes: 2 additions & 2 deletions x-pack/libbeat/processors/add_nomad_metadata/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *nomadAnnotatorConfig) Validate() error {
case ScopeNode:
case ScopeCluster:
default:
return fmt.Errorf("invalid value for `scope`, select `local` or `global`")
return fmt.Errorf("invalid value for `scope`: %s, select `%s` or `%s`", c.Scope, ScopeNode, ScopeCluster)
}
return nil
}
Expand All @@ -57,7 +57,7 @@ func defaultNomadAnnotatorConfig() nomadAnnotatorConfig {
Region: "",
Namespace: "",
SecretID: "",
Scope: "local",
Scope: ScopeNode,
syncPeriod: 5 * time.Second,
CleanupTimeout: 60 * time.Second,
DefaultMatchers: Enabled{true},
Expand Down

0 comments on commit a2c6c14

Please sign in to comment.