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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install/operator/build/conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec-defaults:
image: docker.io/syndesis/syndesis-meta:latest
db:
imageStreamNamespace: openshift
image: postgresql:9.5
image: postgresql:9.6
komodo:
image: docker.io/teiid/syndesis-dv:latest
oauth:
Expand Down
4 changes: 2 additions & 2 deletions install/operator/pkg/generator/assets_vfsdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions tools/bin/commands/util/openshift_funcs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ SETUP_MINISHIFT="setup-minishift"
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/")
#
# Removes any lines containing kubernetes or server
# Extracts any version number of the format dd.dd.dd, eg. 3.10.0 or 4.1.0
#
local test=$(oc version | grep -Eiv 'kubernetes|server' | grep -o '[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\?')

if [ -z "$test" ]; then
echo "ERROR: 'Version of oc could not be found'"
return
fi

echo $(compare_version $test $minimum)
Expand Down
65 changes: 65 additions & 0 deletions tools/bin/commands/util/openshift_funcs.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bats

source ./common_funcs
source ./openshift_funcs

@test "test output from a minishift oc command, it should compare correctly and return OK" {
function oc() {
printf "oc v3.10.0+dd10d17
kubernetes v1.10.0+b81c8f8
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://api.crc.testing:6443
kubernetes v1.14.6+73b5d76";
}
export -f oc

result=$(check_oc_version)
echo "Result: $result"

unset oc
[ "$result" == "OK" ]
}

@test "test output from a crc oc command, it should compare correctly and return OK" {
function oc() {
printf "Client Version: v4.3.0
Server Version: 4.2.0-0.nightly-2019-09-26-192831
Kubernetes Version: v1.14.6+73b5d76";
}
export -f oc

result=$(check_oc_version)
echo "Result: $result"

unset oc
[ "$result" == "OK" ]
}

@test "test output from a oc 4.2.0 command, it should compare correctly and return OK" {
function oc() {
printf "Client Version: openshift-clients-4.2.0-201910041700
Kubernetes Version: v1.11.0+d4cacc0";
}
export -f oc

result=$(check_oc_version)
echo "Result: $result"

unset oc
[ "$result" == "OK" ]
}

@test "test output from a oc theoretical command (3-digit minor version), it should compare correctly and return OK" {
function oc() {
printf "Client Version: openshift-clients-4.101.0-201910041700
Kubernetes Version: v1.11.0+d4cacc0";
}
export -f oc

result=$(check_oc_version)
echo "Result: $result"

unset oc
[ "$result" == "OK" ]
}