We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 560565c commit 4484f16Copy full SHA for 4484f16
hack/collector-longhorn
@@ -64,13 +64,17 @@ function collect_kubelet_log(){
64
}
65
66
collect_longhorn_logs() {
67
- local src_dir
68
- src_dir=$(join_paths "$HOST_PATH" "$LONGHORN_LOG_PATH")
69
-
70
- if [ -d "$src_dir" ]; then
71
- cp -r "$src_dir"/* .
+ if [[ -n $LONGHORN_LOG_PATH ]]; then
+ local src_dir
+ src_dir=$(join_paths "$HOST_PATH" "$LONGHORN_LOG_PATH")
+
+ if [ -d "$src_dir" ]; then
72
+ cp -r "$src_dir"/* .
73
+ else
74
+ echo "Longhorn log directory not found: $src_dir" >&2
75
+ fi
76
else
- echo "Longhorn log directory not found: $src_dir" >&2
77
+ echo "LONGHORN_LOG_PATH is not set. Skipping Longhorn log collection." >&2
78
fi
79
80
0 commit comments