Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Fix(GH-6918): Updates required for crc #6919

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

phantomjinx
Copy link
Contributor

  • CRC does not appear to contain postgresql 9.5 and usages results in the
    syndesis-db not installing due to "invalid image"

  • Adds extra regexp processing to ensure the CRC version of oc is
    correctly parsed

@pure-bot pure-bot bot added the pr/review-requested Use this if you want to have a review. pure-bot will prevent merging if set and no review given label Oct 15, 2019
@phantomjinx phantomjinx changed the title Chore(GH-6918): Updates required for crc Fix(GH-6918): Updates required for crc Oct 15, 2019
@phantomjinx phantomjinx force-pushed the crc-testing branch 2 times, most recently from 6dcf192 to 33f2627 Compare October 16, 2019 11:31
@@ -11,7 +11,7 @@ check_oc_version()
local minimum=${OC_MIN_VERSION}
local test=$(oc version | grep "^oc" | tr -d oc\ v | cut -f1 -d "+")
if [ "$test" = "" ]; then
local test=$(oc version | grep 'Client Version' | sed "s/^.*GitVersion:\"v\(.*\)\", GitCommit.*$/\1/")
local test=$(oc version | grep 'Client Version' | sed "s/^.*GitVersion:\"v\(.*\)\", GitCommit.*$/\1/" | sed "s/Client Version: v//")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For oc downloaded from https://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/latest/:

$ ./oc version
Client Version: openshift-clients-4.2.0-201910041700
Kubernetes Version: v1.11.0+d4cacc0
$ ./oc version | grep 'Client Version' | sed "s/^.*GitVersion:\"v\(.*\)\", GitCommit.*$/\1/" | sed "s/Client Version: v//"
Client Version: openshift-clients-4.2.0-201910041700

In that case this might work better:

Suggested change
local test=$(oc version | grep 'Client Version' | sed "s/^.*GitVersion:\"v\(.*\)\", GitCommit.*$/\1/" | sed "s/Client Version: v//")
local test=$(oc version | grep -i 'client version'|sed -e 's/.*: \(openshift-clients-\)\{0,1\}//')

Might be a good idea to add tests for this.

Also of note is that there's a yaml/json output in the 4.2 of oc version, doesn't seem to be much useful at the moment:

$ ./oc version --client -o json
{
  "clientVersion": {
    "major": "",
    "minor": "",
    "gitVersion": "openshift-clients-4.2.0-201910041700",
    "gitCommit": "d5465d715197862b15c8cf05e864d7c3cfea6917",
    "gitTreeState": "clean",
    "buildDate": "2019-10-07T15:16:39Z",
    "goVersion": "go1.12.8",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}

Copy link
Contributor Author

@phantomjinx phantomjinx Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change broke when dealing with crc due to the 'v' so taken it to bits and managed to do a single regexp with grep. Added some bats tests to prove it works.
WDYT?
@zregvart

* CRC does not appear to contain postgresql 9.5 and usages results in the
  syndesis-db not installing due to "invalid image"

* Adds extra regexp processing to ensure the CRC version of oc is
  correctly parsed
Copy link
Member

@zregvart zregvart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 perfect, thanks!

@pure-bot
Copy link
Contributor

pure-bot bot commented Oct 17, 2019

Pull request approved by @zregvart - applying pr/approved label

@pure-bot pure-bot bot added the pr/approved Applied by pure-bot when a review is approved label Oct 17, 2019
@zregvart zregvart added the group/install Installing Syndesis (templates, scripts) label Oct 17, 2019
@pure-bot pure-bot bot merged commit 8471d22 into syndesisio:master Oct 17, 2019
@zregvart zregvart mentioned this pull request Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
group/install Installing Syndesis (templates, scripts) pr/approved Applied by pure-bot when a review is approved pr/review-requested Use this if you want to have a review. pure-bot will prevent merging if set and no review given size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants