client: fix Consul version finterprint (#17349)

Consul v1.13.8 was released with a breaking change in the /v1/agent/self
endpoint version where a line break was being returned.

This caused the Nomad finterprint to fail because `NewVersion` errors on
parse.

This commit removes any extra space from the Consul version returned by
the API.
This commit is contained in:
Luiz Aoqui
2023-05-30 11:07:57 -04:00
committed by GitHub
parent 60e0404bb5
commit 4068b68b29
4 changed files with 23 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ func SKU(info Self) (string, bool) {
return "", ok
}
ver, vErr := version.NewVersion(v)
ver, vErr := version.NewVersion(strings.TrimSpace(v))
if vErr != nil {
return "", false
}