rancherlabs/support-tools

log collector script distro check issue in sherlock()

Opened this issue · 0 comments

I think the following lines should be an elif:
https://github.com/rancherlabs/support-tools/blob/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh#L101
https://github.com/rancherlabs/support-tools/blob/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh#L114
https://github.com/rancherlabs/support-tools/blob/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh#L129

Example of why:

  1. have an RKE2 CP node with rke2-server.service down
  2. have docker also running on that node
  3. run the log collector script
    Even though this is an RKE2 CP node, it will evaluate line 114 and give you an rke1 log bundle incorrectly. This is because containerd is down due to step 1 and so the crictl ps check in line 104 fails so it moves on to the next if block that checks if docker is running and then thinks its an rke1 node.

Would it also be better to have a different check other than just doing crictl ps? I wonder if some of the log bundles we get are missing the distro directory because their containerd is down?