Skip to content

Commit

Permalink
Merge pull request #81 from slawqo/issue/OSPRH-13336
Browse files Browse the repository at this point in the history
Add version file to the data collected with openstack-must-gather
  • Loading branch information
openshift-merge-bot[bot] authored Jan 31, 2025
2 parents f73ea20 + f7e5e62 commit b929cdf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions collection-scripts/gather_run
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ wait_bg
# Create rotated log symlinks after everything else has finished
rotated_logs_symlinks

# Store version of the must-gather tool first
source "${DIR_NAME}/gather_version"
log_version

# The path to store the compressed result
export COMPRESSED_PATH=${COMPRESSED_PATH:-"${BASE_COLLECTION_PATH}"}
# whether to delete or keep the uncompressed files.
Expand Down
21 changes: 21 additions & 0 deletions collection-scripts/gather_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# load shared functions and data when not sourced
if [[ -z "$DIR_NAME" ]]; then
CALLED=1
DIR_NAME=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "${DIR_NAME}/common.sh"
fi

function log_version() {
echo "openstack-k8s-operators/openstack-must-gather"> "${BASE_COLLECTION_PATH}/version"
ocp_version="0.0.0-unknown"
if [[ -n ${OS_GIT_VERSION} ]]; then
ocp_version="${OS_GIT_VERSION}"
fi
echo ${ocp_version} >> "${BASE_COLLECTION_PATH}/version"
}

if [[ $CALLED -eq 1 ]]; then
log_version
fi

0 comments on commit b929cdf

Please sign in to comment.