sclorg / container-common-scripts

Apache License 2.0
20 stars 45 forks source link

Print 'oc version' and check client version after login #236

Closed phracek closed 2 years ago

phracek commented 2 years ago

This commit fixes issue caused by checking oc version before oc login.

Before this fix, we see output like:

PATH /usr/local/oc-v4.4/bin
Binary oc found in /usr/local/oc-v4.4/bin
Client Version: 4.4.0-0.nightly-2020-06-01-021027
error: You must be logged in to the server (Unauthorized)
OpenShift tests for ubi8/nodejs-12:1 failed.
make: *** [common/common.mk:103: test-openshift-4] Error 1

after a fix the output looks like:

PATH /usr/local/oc-v4.4/bin
Binary oc found in /usr/local/oc-v4.4/bin
Login successful.

You have access to 67 projects, the list has been suppressed. You can list all projects with 'oc projects'

Using project "default".
Client Version: 4.4.0-0.nightly-2020-06-01-021027
Server Version: 4.10.3
Kubernetes Version: v1.23.3+e419edf
PATH set correctly, binary oc found in version 4.4: /usr/local/oc-v4.4/bin/oc
Login to OpenShift 4.4 is DONE

Signed-off-by: Petr "Stone" Hracek phracek@redhat.com

phracek commented 2 years ago

[test]

phracek commented 2 years ago

Fedora test failed (https://artifacts.dev.testing-farm.io/62dc4e7a-e591-4c0d-b6e2-fbb6cb26a8a8/work-fedoralPQnCc/log.txt):

14:17:57                 out: npm ERR! command sh -c node-gyp rebuild
14:17:57                 out: npm ERR! sh: /usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp: Permission denied
14:17:57                 out: 
14:17:57                 out: npm ERR! A complete log of this run can be found in:
14:17:57        
14:18:00                 out:  [PASSED] for 'clients' prom-client
14:18:00                 out:  [FAILED] for 'binary' test_run_binary_application