Skip to content

Commit

Permalink
Assorted small fixes for must-gather.
Browse files Browse the repository at this point in the history
Fill out git commit in velero client version, fix DPA version gathering,
and fix a mkdir problem in log backup.

Signed-off-by: Matthew Arnold <marnold@redhat.com>
  • Loading branch information
mrnold committed May 10, 2023
1 parent 510bf52 commit ee2ad97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion must-gather/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ ARG VELERO_BRANCH=konveyor-dev
WORKDIR /build
RUN curl --location --output velero.tgz https://github.com/openshift/velero/archive/refs/heads/${VELERO_BRANCH}.tar.gz && \
tar -xzvf velero.tgz && cd velero-${VELERO_BRANCH} && \
CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${VELERO_BRANCH}' -o /velero github.com/vmware-tanzu/velero/cmd/velero && \
VELERO_COMMIT=$(git ls-remote https://github.com/openshift/velero HEAD | awk '{printf $1}') && \
CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version='"${VELERO_BRANCH}"' -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA='"${VELERO_COMMIT}" -o /velero github.com/vmware-tanzu/velero/cmd/velero && \
cd .. && rm -rf velero.tgz velero-${VELERO_BRANCH} && \
curl --location --output restic.tgz https://github.com/openshift/restic/archive/refs/heads/${RESTIC_BRANCH}.tar.gz && \
tar -xzvf restic.tgz && cd restic-${RESTIC_BRANCH} && \
Expand Down
4 changes: 2 additions & 2 deletions must-gather/collection-scripts/gather_versions
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ fi


# DataProtectionApplications
dpas=$(oc get dpa --all-namespaces --insecure-skip-tls-verify=${skip_tls} -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.metadata.namespace}')
if [ -z "${dpas}" -o "${dpas}" == " " ]; then
dpas=$(oc get dpa --all-namespaces --insecure-skip-tls-verify=${skip_tls} -o custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace --no-headers)
if [ -z "${dpas}" ]; then
log_command "DataProtectionApplication CRs" "echo No DPAs found in cluster"
else
while read dpa namespace; do
Expand Down
2 changes: 1 addition & 1 deletion must-gather/collection-scripts/logs/gather_logs_backup
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ timeout=$7
skip_tls=$8

# Gather backup logs and description
mkdir -p "{object_collection_path}"
mkdir -p "${object_collection_path}"
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero backup describe ${backup}'"
if [ "$timeout" = "0s" ]; then
timeout 30s velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
Expand Down

0 comments on commit ee2ad97

Please sign in to comment.