File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# generate /must-gather/version file
4
4
. version
5
- echo " openshift/must-gather" > /must-gather/version
5
+ echo " openshift/must-gather" > /must-gather/version
6
6
version >> /must-gather/version
7
7
8
8
# Named resource list, eg. ns/openshift-config
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
function version() {
4
- # get version from image
5
- version=$( \
6
- oc status | grep ' ^pod' | \
7
- sed -n -r -e ' s/.*([[:digit:]]+\.[[:digit:]]+(:?\.[[:digit:]])?(:?-[^@]+)?).*/\1/p' \
8
- )
9
-
10
- # if version not found, fallback to imageID
11
- [ -z " ${version} " ] && version=$( oc status | grep ' ^pod.*runs' | sed -r -e ' s/^pod.*runs //' )
12
-
13
- # if version still not found, use Unknown
14
- [ -z " ${version} " ] && version=" Unknown"
15
-
16
- echo ${version}
4
+ if [[ ! -z $OS_GIT_VERSION ]] ; then
5
+ echo " ${OS_GIT_VERSION} "
6
+ else
7
+ echo " 0.0.0-unknown"
8
+ fi
17
9
}
You can’t perform that action at this time.
0 commit comments