troubleshoot icon indicating copy to clipboard operation
troubleshoot copied to clipboard

copyFromHost collector should follow symlinks

Open xavpaice opened this issue 3 years ago • 1 comments

Problem to solve (Required)

Ok, so I think I've made a bit of progress. It seems that's the copyFromHost command doesn't work with a symlink. On all my Ubuntu servers/desktops, /etc/os-release is actually a symlink to /usr/lib/os-release - when I put hostPath: /usr/lib/os-release, it works

So, my question is, how do we allow it to work with a symlink? According to the os-release docs, this may or may not be a symlink. If I can't use a symlink, it looks like this might be problematic for our use-case

Proposal

copyFromHost collector should follow symlinks

Further details

collectors:
- copyFromHost:
    collectorName: os-release
    image: busybox:1
    name: os-release
    hostPath: /etc/os-release
$ ls -l /etc/os-release
lrwxrwxrwx 1 root root 21 Feb 17 00:44 /etc/os-release -> ../usr/lib/os-release
$ cat /etc/os-release | grep VER
VERSION="20.04.4 LTS (Focal Fossa)"

Impact (importance/urgency) (Required)

  • Replicated impact:
  • Vendor impact:
  • End-user impact:

cannot create an analyzer to require a specific os

What does business success look like, and how can we measure that?

Links / references

xavpaice avatar Sep 15 '22 22:09 xavpaice

Dmitry pointed out that the copyFromHost collector runs in a container, and so cannot follow links outside of the container's filesystem (by design).

However, as a workaround, we could consider adding a Host Collector for files/symlinks - though there is a HostOS collector for this specific purpose.

xavpaice avatar Sep 15 '22 23:09 xavpaice