File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 40
40
oc_version=4.4
41
41
oc_tools_dir=$HOME /oc-${oc_version}
42
42
oc_tools_local_file=openshift-client-${oc_version} .tar.gz
43
- oc_date=0
44
43
if which oc 2>&1 > /dev/null ; then
45
- oc_date=$( date -d $( oc version -o json | jq -r ' .clientVersion.buildDate' ) +%s)
44
+ oc_git_version=$( oc version -o json | jq -r ' .clientVersion.gitVersion' )
45
+ oc_actual_version=${oc_git_version# v* }
46
+ oc_major_minor=" ${oc_actual_version% \. [0-9]* } "
46
47
fi
47
- if [ ! -f ${oc_tools_dir} /${oc_tools_local_file} ] || [ $oc_date -lt 1566755586 ]; then
48
+ if [ ! -f ${oc_tools_dir} /${oc_tools_local_file} ] || [ " $oc_major_minor " != " $oc_version " ]; then
48
49
mkdir -p ${oc_tools_dir}
49
50
cd ${oc_tools_dir}
50
51
wget https://mirror.openshift.com/pub/openshift-v4/clients/oc/${oc_version} /linux/oc.tar.gz -O ${oc_tools_local_file}
You can’t perform that action at this time.
0 commit comments