-
Bug
-
Resolution: Unresolved
-
Blocker
-
None
After upgrade from 1.0.38 to 1.1.0.413.v3023d27e8434, oc raw command in my job is failing with error "flags cannot be placed before plugin name".
I need to force delete many objects in my job, and I need to pass these flags to oc: --force --grace-period=0 --ignore-not-found. I use oc raw command for this.
I call oc in job like this:
objects = openshift.selector('all,pvc,configmap,secret', ['madeby': 'jenkins-dbo-job', 'deployment': deployment_name) openshift.raw(['delete', '--force', '--grace-period=0', '--ignore-not-found'] + objects.names())
In new version, it fails with this error (the names of resources are just for example here):
ERROR: raw command [delete, --force, --grace-period=0, --ignore-not-found, pod/dbo-ul-460-76bdc65858-vtk8t, service/dbo-ul-460, deployment/dbo-ul-460, replicaset/dbo-ul-460-76bdc65858, route/dbo-ul-460-back, route/dbo-ul-460-front, persistentvolumeclaim/pvc-dbo-dbo-ul-460, configmap/dbo-ul-460-filebeat-conf, configmap/dbo-ul-460-log-cleaner, configmap/dbo-ul-460-nginx-addon-uploads-conf, secret/dbo-ul-460] returned an error;
{err=, verb=, cmd=oc --server=https://10.120.14.1:443 --certificate-authority="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" --namespace=dbo --token=XXXXX [delete, --force, --grace-period=0, --ignore-not-found, pod/dbo-ul-460-76bdc65858-vtk8t, service/dbo-ul-460, deployment/dbo-ul-460, replicaset/dbo-ul-460-76bdc65858, route/dbo-ul-460-back, route/dbo-ul-460-front, persistentvolumeclaim/pvc-dbo-dbo-ul-460, configmap/dbo-ul-460-filebeat-conf, configmap/dbo-ul-460-log-cleaner, configmap/dbo-ul-460-nginx-addon-uploads-conf, secret/dbo-ul-460] , out=flags cannot be placed before plugin name: --server=https://10.120.14.1:443 , status=1}
I run job on top of jnlp image based on jenkins/jenkins:3107.v665000b_51092-5-jdk11, with oc version installed 4.8.11 (latest from okd site)
Downgrade to 1.0.38 helps.