File tree Expand file tree Collapse file tree 5 files changed +17
-21
lines changed Expand file tree Collapse file tree 5 files changed +17
-21
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ PROMETHEUS_DUMP_PATH ?= $(shell find ./must-gather.local* -name prom_data.tar.gz
8
8
9
9
build : docker-build docker-push
10
10
11
+ run : IMAGE_REGISTRY:=ttl.sh
12
+ run : IMAGE_NAME:=oadp/must-gather-$(shell git rev-parse --short HEAD) -$(shell echo $$RANDOM)
13
+ run : IMAGE_TAG:=1h
14
+ run :
15
+ IMAGE_REGISTRY=$(IMAGE_REGISTRY ) IMAGE_NAME=$(IMAGE_NAME ) IMAGE_TAG=$(IMAGE_TAG ) make build && \
16
+ oc adm must-gather --image ${IMAGE_REGISTRY} /${IMAGE_NAME} :${IMAGE_TAG}
17
+
11
18
docker-build :
12
19
docker build -t ${IMAGE_REGISTRY} /${IMAGE_NAME} :${IMAGE_TAG} .
13
20
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ skip_tls=$8
15
15
mkdir -p " {object_collection_path}"
16
16
echo " [cluster=${cluster} ][ns=${ns} ] Gathering 'velero backup describe ${backup} '"
17
17
if [ " $timeout " = " 0s" ]; then
18
- oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " /velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /backup-describe-${backup} .txt" &
18
+ oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " timeout 30s /velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /backup-describe-${backup} .txt" &
19
19
else
20
- oc -n ${ns} exec --request-timeout=${timeout} $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " /velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /backup-describe-${backup} .txt" &
20
+ oc -n ${ns} exec --request-timeout=${timeout} $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " timeout ${timeout} /velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /backup-describe-${backup} .txt" &
21
21
fi
22
22
echo " [cluster=${cluster} ][ns=${ns} ] Gathering 'velero backup logs ${backup} '"
23
- oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " /velero backup logs ${backup} --insecure-skip-tls-verify=${skip_tls} --timeout=30s" & > " ${object_collection_path} /backup-${backup} .log" &
23
+ oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " timeout 30s /velero backup logs ${backup} --insecure-skip-tls-verify=${skip_tls} --timeout=30s" & > " ${object_collection_path} /backup-${backup} .log" &
24
24
25
25
wait
Original file line number Diff line number Diff line change @@ -13,12 +13,5 @@ object_collection_path=$6
13
13
node=$( oc get podvolumebackup $pvb --namespace $ns -o jsonpath=' {.spec.node}' )
14
14
mkdir -p ${object_collection_path}
15
15
oc describe podvolumebackup ${pvb} --namespace ${ns} & > " ${object_collection_path} /pvb-describe-${pvb} .txt" &
16
- for pod in $( oc get pods -o wide --field-selector spec.nodeName=${node} --selector name=restic --no-headers --namespace $ns | awk ' {print $1}' ) ; do
17
- echo " [cluster=${cluster} ][ns=${ns} ][pod=${pod} ] Collecting Pod logs..."
18
- oc logs --all-containers --namespace ${ns} ${pod} --since ${logs_since} & > " ${object_collection_path} /current.log" &
19
- echo " [cluster=${cluster} ][ns=${ns} ][pod=${pod} ] Collecting previous Pod logs..."
20
- oc logs --previous --all-containers --namespace ${ns} ${pod} --since ${logs_since} & > " ${object_collection_path} /previous.log" &
21
- pwait $max_parallelism
22
- done
23
-
16
+ # logs covered by restic pod logs in gather_logs_pods
24
17
wait
Original file line number Diff line number Diff line change @@ -9,12 +9,8 @@ max_parallelism=$4
9
9
pvr=$5
10
10
object_collection_path=$6
11
11
12
- # Gather PVR describe and logs
12
+ # Gather PVR describe
13
13
mkdir -p ${object_collection_path}
14
14
oc describe podvolumerestores.velero.io ${pvr} --namespace ${ns} & > " ${object_collection_path} /pvr-describe-${pvr} .txt"
15
- echo " [cluster=${cluster} ][ns=${ns} ][pod=${pod} ] Collecting Pod logs..."
16
- oc logs --all-containers --namespace ${ns} ${pod} --since ${logs_since} & > " ${object_collection_path} /current.log" &
17
- echo " [cluster=${cluster} ][ns=${ns} ][pod=${pod} ] Collecting previous Pod logs..."
18
- oc logs --previous --all-containers --namespace ${ns} ${pod} --since ${logs_since} & > " ${object_collection_path} /previous.log" &
19
-
15
+ # logs covered by restic pod logs in gather_logs_pods
20
16
wait
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ timeout=$7
12
12
skip_tls=$8
13
13
14
14
# Gather restore describe and logs
15
- mkdir -p " {object_collection_path}"
15
+ mkdir -p " $ {object_collection_path}"
16
16
echo " [cluster=${cluster} ][ns=${ns} ] Gathering 'velero restore describe ${restore} '"
17
17
if [ " $timeout " = " 0s" ]; then
18
- oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " /velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /restore-describe-${restore} .txt" &
18
+ oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " timeout 30s /velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /restore-describe-${restore} .txt" &
19
19
else
20
- oc -n ${ns} exec --request-timeout=${timeout} $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " /velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /restore-describe-${restore} .txt" &
20
+ oc -n ${ns} exec --request-timeout=${timeout} $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " timeout ${timeout} /velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details" & > " ${object_collection_path} /restore-describe-${restore} .txt" &
21
21
fi
22
22
echo " [cluster=${cluster} ][ns=${ns} ] Gathering 'velero restore logs ${restore} '"
23
- oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " /velero restore logs ${restore} --insecure-skip-tls-verify=${skip_tls} --timeout=30s" & > " ${object_collection_path} /restore-${restore} .log" &
23
+ oc -n ${ns} exec $( oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c " timeout 30s /velero restore logs ${restore} --insecure-skip-tls-verify=${skip_tls} --timeout=30s" & > " ${object_collection_path} /restore-${restore} .log" &
24
24
25
25
wait
You can’t perform that action at this time.
0 commit comments