1
votes

I have a docker container with jenkins deployed using OpenShift Origin. Now I want to use Jenkins to build/test and deploy other OpenShift apps. So I try to login on my OpenShift-server (from inside my jenkins) but than I get the following error. Can someone help me?

Started by user Jenkins Admin
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/jobs/s2i-build-deploy/workspace
[EnvInject] - Executing scripts and injecting environment variables after the SCM step.
[EnvInject] - Injecting as environment variables the properties content 
APP_HOSTNAME=http://test.apps.example.com
USER_NAME=admin
PASSWORD=admin
OSO_SERVER=ip.compute.internal:8443
DEVEL_PROJ_NAME=test
SERVICE=test
[EnvInject] - Variables injected successfully.
[workspace] $ /bin/sh -xe /tmp/hudson1352752763797328747.sh
+ oc login -uadmin -padmin --server=ip.compute.internal:8443
error: x509: certificate signed by unknown authority
Build step 'Execute shell' marked build as failure
Finished: FAILURE

The oc login-command is working when I'm performing directly in my server.

2

2 Answers

1
votes

That error means you need to also specify the CA that was used to sign the API server's certificate. You will need to also specify --ca-file (check oc help options) with the ca.crt of the master in order to login.

0
votes

As mentioned in this comment try:

oc login $OPENSHIFT_URL --insecure-skip-tls-verify=true