Commit Graph

163 Commits

Author SHA1 Message Date
iwankgb
854445c010
Carefully fixing style (#2509)
* Use golangci-lint to add lint presubmit test, and fix linter errors

Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@intel.com>
2020-04-22 16:26:36 -07:00
iwankgb
0dd4098374
golanci-lint based cleanup (#2503)
* Cleanups based on linter

Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@intel.com>
2020-04-20 10:53:19 -07:00
David Ashpole
ca7a1173b7
Merge pull request #2478 from dims/switch-to-klog-v2
Switch to klog v2
2020-04-10 09:13:38 -07:00
David Ashpole
f72e6ae382
Merge pull request #2448 from dims/docker-based-integration-test
Docker based integration test for cadvisor
2020-04-10 09:04:21 -07:00
Davanum Srinivas
94508e8a2f
Switch to klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-09 22:54:37 -04:00
bblu
7f1ea45122 Issue fix: get wrong machine info in Arm64 guest
The latest kubernetes deployment on Arm64 VM-s always fails.
Because k8s always get num_cores=0 from cAdvisor on Arm64 VM-s.

The reason is that, there is no cache info on Arm64 VM-s.
And the good news is that, we can get cache info on Arm64 hosts.

When this patch was merged, I will deliver a patch to update the version
of cAdvisor in kubernetes as soon as possible.

Signed-off-by: bblu <bin.lu@arm.com>
2020-04-09 14:01:45 +08:00
Davanum Srinivas
831b5000c2
fix test to ensure nodes are sorted
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-06 20:30:24 -04:00
Ted Yu
f6e5433e67 Check the error return from GetCPUPhysicalPackageID()
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-04-06 16:50:53 -07:00
Katarzyna Kujawa
6536a6c35e Fix number of logical CPU cores when nodes are not available
Add reading CPU topology without nodes

Add test for reading CPU topology without nodes

Signed-off-by: Katarzyna Kujawa <katarzyna.kujawa@intel.com>
2020-04-06 17:42:24 +02:00
Davanum Srinivas
af89abfc29
Cleanup unused code
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-24 15:41:02 -04:00
Katarzyna Kujawa
c5a9232a94 Modify GetTopology to read information only from sysfs
* Move sysfs related functions needed to get nodes' information and tests into utils/sysfs
* Add tests for sysfs related functions

Signed-off-by: Katarzyna Kujawa <katarzyna.kujawa@intel.com>
2020-03-17 08:44:58 +01:00
David Ashpole
f6f5fd21b4 handle the new 5.0 linux format for oom messages 2020-03-05 11:53:40 -08:00
Davanum Srinivas
10ad7756af
moving docker/utils into container/docker 2020-01-22 23:00:08 -05:00
David Ashpole
60d438652e
Merge pull request #2228 from dashpole/code_safe_changes
Fix code safe linter errors
2019-09-05 14:11:54 -07:00
Tarun Pothulapati
daa036418b Use k8s.io/utils/inotify and resolved godep conflicts (#2269)
Use k8s.io/utils/inotify and resolved godep conflicts

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2019-07-18 09:48:52 -07:00
Ray Tung
189cc9ce3c Fixes #2232
This commit fixes the bug in #2232 where cadvisor was not able to detect
the cloud provider if it's running on a custom AMI derived from
Amazon Linux 2.

It does so by checking /etc/os-release. However, from what I've read,
/etc/os-release is pretty much a systemd thing. Although Amazon Linux 2
comes with systemd, cadvisor cannot assume the existence of systemd in
other AMIs / OSes, therefore we would only be checking for
/etc/os-release if all other methods fail us.
2019-05-15 23:52:28 +10:00
Lorenz Brun
1493d8af7d Remove cgo use and lots of ad-hoc defined kernel constants 2019-05-13 03:04:26 +02:00
David Ashpole
6bc176e3ef fix code safe linter errors 2019-04-25 13:05:46 -07:00
Tim Allclair
c492e4a814 Remove CloudProvider SDK dependencies 2019-04-04 10:07:24 -07:00
David Ashpole
cd92744b92
Merge pull request #2156 from dtrejod/dt/ec2-gen5-detection
Fix Amazon VM detection on EC2 Nitro generation.
2019-02-13 10:30:17 -08:00
David Ashpole
0995283c32
Merge pull request #2160 from gaorong/victimContainerName
change default oom victim container name
2019-02-05 09:27:02 -08:00
gaorong
1ea111582c cleanup oom parser test 2019-02-02 10:08:58 +08:00
gaorong
407289527c change default oom victim container name 2019-02-02 10:00:57 +08:00
Devin Trejo
fe06d6ebd4 Fix Amazon VM detection on EC2 Nitro generation. 2019-01-29 12:02:23 -05:00
Davanum Srinivas
4da6d809be
Move from glog to klog
Change-Id: Ic92f57c2d7f268d8d985797974883c1a537d6993
2018-11-08 18:06:28 -05:00
Yann Hodique
289e560efd replace golang.org/x/exp/inotify with standalone library
context: kubernetes/kubernetes#68478

The inotify code was removed from golang.org/x/exp several years ago. Therefore
importing it from that path prevents downstream consumers from using any module
that makes use of more recent features of golang.org/x/exp.

Given that this code is by definition frozen and that the long term path should
be to migrate to fsnotify, replacing the current code by an identical standalone
copy doesn't have maintenance cost, and will unlock other activities for
kubernetes for example.
2018-09-28 08:48:12 -07:00
Yann Hodique
b36e6fb63a fix minor errors revealed by go 1.11 (#2039)
minor fixes for go 1.11
2018-09-10 13:49:37 -07:00
David Ashpole
8335af9d6b Revert "Switch from Inotify to Fsnotify"
This reverts commit c1a6d6090b.
2018-06-11 10:50:23 -07:00
David Ashpole
c1a6d6090b Switch from Inotify to Fsnotify 2018-04-09 11:09:40 -07:00
Tim Allclair
5b435b4b70
Clean up cAdvisor logging 2017-11-27 19:48:05 -08:00
David Ashpole
6988e70a3d Revert "fix #1708; move from inotify to fsnotify"
This reverts commit e6b6a1ac57.
2017-11-17 10:28:28 -08:00
David Ashpole
888a529088 fix #1743; move off of docker/engine-api 2017-09-28 11:05:13 -07:00
David Ashpole
e6b6a1ac57 fix #1708; move from inotify to fsnotify 2017-09-28 10:57:49 -07:00
Euan Kemp
95f9c8c86f oomparser: update to use kmsg based parser
This provides much more robust support for kernel logs via accessing the
`/dev/kmsg` interface to them directly.
2017-08-30 15:35:40 -07:00
Michael Taufen
3190c1c53d Fix journalctl leak
This fixes the journalctl leak that occurs when a process that uses
cadvisor exits. See issues #1725 and
https://github.com/kubernetes/kubernetes/issues/34965.
2017-08-23 09:14:54 -07:00
Euan Kemp
fe722c7b02 oomparser: don't get stuck for certain processes
The oomparser logic would end up stuck, unable to detect the end of a
given oom trace, for any process with a name that didn't match \w+.

This includes processes like 'python3.4' due to the '.', or
'docker-containerd' due to the '-'.

This fix was included in pr #1544 last year, but since that PR seems
dead it seems like a good idea to break this more important fix out.

I've updated the tests such that they would have caught this issue.
2017-08-01 16:21:31 -07:00
Brian Akins
feecd47daa Add watcher for zfs similar to devicemapper
minor cleanup

ensure we look at parent dataset for limit, etc
2017-03-15 18:31:11 -04:00
NickrenREN
a248c34528 optimize NewRealSysFs()
remove second return value since it will never return err
2017-03-15 12:11:50 +08:00
Andy Xie
2c1d001857 add error log for open log file 2017-01-06 10:52:03 +08:00
Random-Liu
3c3f070720 Fix bug in tail. 2016-11-10 11:39:22 -08:00
Euan Kemp
125d026aae oomparser: Fix tests
They had reflect.Equal instead of !reflect.Equal.
They also depended on the current year. Which changed.
2016-10-20 10:50:14 -07:00
Tim St. Clair
afe67fec68
Cleanup comment style: // should be proceded by a space 2016-10-07 17:06:02 -07:00
Tim St. Clair
e7576e5790
Moved google.golang.org/cloud/compute/metadata to cloud.google.com/go/compute/metadata 2016-09-13 13:59:03 -07:00
Erez Freiberger
cf548f1b70 cloudinfo: identify gce from file 2016-07-01 11:43:09 +03:00
Seth Jennings
f3bca888f8 fallback to /dev/mapper device if metadata device is not set in docker info 2016-06-21 16:01:18 -05:00
Tim St. Clair
fb5fb832ed Merge pull request #1292 from timstclair/tail
Fixes for log tailing
2016-05-19 12:16:24 -07:00
Tim St. Clair
2f0af7bb40 Fixes for log tailing
IN_ATTRIB inotify events are generated when atime / mtime is changed,
which would cause the tail to be reset, and reread the same log
again (generating duplicate events). Instead, watch the directory for
file delete / move.

Also, use an exponential backoff when retrying opening the file.
2016-05-18 18:53:35 -07:00
Tim St. Clair
18e56007c1 Merge pull request #1290 from timstclair/tail
Cleanup tail util from #1264
2016-05-18 14:46:50 -07:00
Tim St. Clair
ee24f28f73 Cleanup tail util from #1264 2016-05-18 14:36:12 -07:00
Tim St. Clair
381f24b4f2 Merge pull request #1264 from sjenning/log-rotate-support
add log file tailing and logrotate support
2016-05-18 14:35:54 -07:00