Skip to content

Commit

Permalink
Fix default scope in add_nomad_metadata (elastic#24559)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jsoriano authored Mar 16, 2021
1 parent ab2713c commit ab2b478
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 @@ -399,6 +399,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix Netflow 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 netflow module ignoring detect_sequence_reset flag. {issue}24268[24268] {pull}24270[24270]
- 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 ab2b478

Please sign in to comment.