Commit Graph

52 Commits (master)

Author SHA1 Message Date
Matthieu MOREL 27ea38b5ad chore: enable use-any from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 month ago
shirou 37f531010d fix golangcilint errors, ignore gosec G115 7 months ago
shirou 1221983189 [windows][mem]: change to use Performance Counter on SwapMemory. 8 months ago
shirou bc060cc227 add SPDX License, remove old build tag, and replace import 10 months ago
Bryce Kahle b0d976c49b
ensure host platform are files and have contents
In a containerized deployment, it is common to mount several files from /etc. Within the container, those files will be created regardless if they exist on the host or not. In those instances, the existing code would erroneously return empty platform information.
1 year ago
shirou 0665cafa1b chore: replace deprecated ioutil package to os and io 2 years ago
Antoine Toulme 4ed0f1436a
return err if not EOF 2 years ago
Antoine Toulme 4bc9e37b0f
faster file read 2 years ago
Antoine Toulme 177e1b1982 remove deprecation comments 2 years ago
Antoine Toulme 0cbdf257ab change to use a typed map per code review 2 years ago
Antoine Toulme 5b9212e240 move the Env key out of internal packages 2 years ago
Antoine Toulme 38b94668ea allow to pass context values to override environment variables 2 years ago
shirou 852f455217 fix lint 2 years ago
Ville Skyttä 70a8f589c6 Detect Docker also using /.dockerenv 2 years ago
Eng Zer Jun 37894e9b28
test: use `T.Setenv` to set env vars in tests
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2 years ago
Ties de Wit f253d81d1b
Update common.go 3 years ago
shirou 839e8b731f fix(common): simplify size check 3 years ago
shirou 5610fbc5d5 fix(host,linux): Check if path exists and is nonempty before reading host files 3 years ago
Ville Skyttä 1e56c6f421 Spelling and grammar fixes 3 years ago
shirou 2f8da0a394
Merge pull request #1205 from mmorel-35/master
enable more linters, report coverage and cache mods
3 years ago
Makazeu 521fafd945
Fix a typo in comment 3 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
wyl 5a288fb852 Fix bug for func named ReadLinesOffsetN 3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
Ville Skyttä 5d0724f42f Comment convention fixes 4 years ago
Ville Skyttä a9b1ce2dec Remove unnecessary conversions 4 years ago
shirou 2fa855f295 add MockEnv as more generic function. 4 years ago
Sergey Vinogradov 8ff2ab3187 Add "vet" target to the Makefile
Making the "vet" target will run "go vet ./..." for each supported
GOOS.

Also, some of the warnings produced by go 1.15 vet were mitigated.
4 years ago
Mihir Singh 92d6df6d8f Attempted LXC guest detection from environ procfile 5 years ago
Ilya Prudnikov 256e00319e implement proposed solution 5 years ago
shirou 5335e3fd50
Merge pull request #685 from cmattoon/conntrack-stat
Adds ConntrackStats (/proc/net/stat/nf_conntrack)
6 years ago
Curtis Mattoon 648bf4eebc Adds ConntrackStats to get conntrack summary stats 6 years ago
Lomanic 0e0dd767df [process][darwin] Fix #670 remove call to common.Pipeline (prone to race condition)
Also properly parse lsof to get second txt record instead of hoping the 5th line is the right one (wrong data returned for pid 57)
6 years ago
Jaime Soriano Pastor 61902bc2a5 Use HOST_* environment variables for getting disk serial number in Linux 7 years ago
shirou 145dca90f7 change to use CommandContext. 7 years ago
Daniel Nelson df2f1a8dd1
Add HOST_VAR envvar and use to locate utmp on Linux. 8 years ago
Michael Schurter 042305ee4a Remove SetEnv on all platforms 8 years ago
Sean Chittenden d0e40ff723
Fix issues reported by golint. 8 years ago
Sean Chittenden 3834908232
Improve Command() handling and signal handling for launched processes. 8 years ago
WAKAYAMA Shirou 30ebb9ca3a rename expected dir to testdata. 8 years ago
Cameron Sparr a213bf5e6d
run go fmt ./... 8 years ago
Nex 5c0ac28fed Changing a little the return values 9 years ago
Nex d9b355f75e Added proper piping of commands 9 years ago
Sean Chittenden e4f857a9ca
Fix a linter issue: s/TimeoutErr/ErrTimeout/g 9 years ago
Shirou WAKAYAMA 57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 9 years ago
Shirou WAKAYAMA 0787e8ba3e [host]linux-arm: update type_liux.go. Test will fail. 9 years ago
Shirou WAKAYAMA 613a8a90e1 fixed by golint. 9 years ago
Shirou WAKAYAMA fa3e1cc196 [common]linux: add HostEtc to switch '/etc' See #175. 9 years ago
Shirou WAKAYAMA 6c352016d8 [net]linux: start replacing lsof. still work in progress. 9 years ago
Shawn Smith 9cc9e82920 fix typos 9 years ago