Skip to content

Commit

Permalink
The system's libc_type attribute is now populated on alpine con… (sen…
Browse files Browse the repository at this point in the history
…su#3682)

Signed-off-by: Simon Plourde <[email protected]>
  • Loading branch information
Simon Plourde authored Apr 9, 2020
1 parent d789183 commit ad962ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Versioning](http://semver.org/spec/v2.0.0.html).
and sensu-agent start.
- Keepalives can now be published via the HTTP API.
- Token substitution templates can now express escape-quoted strings.
- The system's libc_type attribute is now populated on alpine containers.

## [5.19.0] - 2020-03-26

Expand Down
5 changes: 4 additions & 1 deletion system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ func Info() (types.System, error) {

func getLibCType() (string, error) {
output, err := exec.Command("ldd", "--version").CombinedOutput()
if err != nil {
// The command above will return an exit code of 1 on alpine, but still output
// the relevant information. Therefore, as a workaround, we can inspect stderr
// and ignore the error if it contains pertinent data about the C library
if err != nil && !strings.Contains(strings.ToLower(string(output)), "libc") {
return "", err
}
text := strings.ToLower(string(output))
Expand Down

0 comments on commit ad962ed

Please sign in to comment.