Jenkins OpenShift raw Command Returning an Error

Solution In Progress - Updated -

Issue

  • A command I can run directly in oc returns an error when I run it in Jenkins using 'openshift.raw':
oc patch cronjob/XXX -p '{"spec":{"suspend":true}}'
...
openshift.raw('patch', "cronjob/XXX" , '-p', "'{\"spec\":{\"suspend\":${suspend}}'")
...
ERROR: raw command [patch, cronjob/XXX, -p, '{"spec":{"suspend":true}'] returned an error;
{reference={}, err=Error from server (BadRequest): unexpected EOF, verb=, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=YYY --token=XXXXX  patch cronjob/XXX -p '{"spec":{"suspend":true}' , out=, status=1}

Environment

  • Red Hat OpenShift Container Platform
    • 3.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content