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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.