-
Bug
-
Resolution: Unresolved
-
Minor
-
None
When using freestyle steps, it does not honor a build agent selected and it is calling oc on controller. In an environment, that does not have oc installed on controller this is a problem. (I am aware this is working correctly in pipeline DSL, hence the minor severity).
Reproducing job:
<?xml version='1.1' encoding='UTF-8'?> <project> <description></description> <keepDependencies>false</keepDependencies> <properties/> <scm class="hudson.scm.NullSCM"/> <assignedNode>jnlp-agent</assignedNode> <canRoam>false</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild>false</concurrentBuild> <builders> <hudson.tasks.Shell> <command>oc version</command> <configuredLocalRules/> </hudson.tasks.Shell> <com.openshift.jenkins.plugins.freestyle.RawStep plugin="openshift-client@1.0.37"> <clusterName></clusterName> <project></project> <credentialsId></credentialsId> <logLevel>0</logLevel> <command>version</command> <arguments></arguments> </com.openshift.jenkins.plugins.freestyle.RawStep> </builders> <publishers/> <buildWrappers/> </project>
Output:
Building remotely on jnlp-agent-s2zms (jnlp-agent) in workspace /home/jenkins/workspace/ogondza-openshift-test [ogondza-openshift-test] $ bash -xe /tmp/jenkins6382148924131634617.sh + oc version oc v3.11.0+20c5b86 kubernetes v1.10.0+b3b92b2 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://172.27.0.1:443 kubernetes v1.23.5+012e945 Executing: oc --server=https://172.27.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=jenkins-csb-dno --token=XXXXX version FATAL: Cannot run program "oc": error=2, No such file or directory java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) Caused: java.io.IOException: Cannot run program "oc": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at com.openshift.jenkins.plugins.freestyle.BaseStep$2.perform(BaseStep.java:257) at com.openshift.jenkins.plugins.freestyle.BaseStep$1.perform(BaseStep.java:241) at com.openshift.jenkins.plugins.freestyle.BaseStep.withTempInput(BaseStep.java:424) at com.openshift.jenkins.plugins.freestyle.BaseStep.runOcCommand(BaseStep.java:223) at com.openshift.jenkins.plugins.freestyle.BaseStep.standardRunOcCommand(BaseStep.java:251) at com.openshift.jenkins.plugins.freestyle.RawStep$1.perform(RawStep.java:51) at com.openshift.jenkins.plugins.freestyle.BaseStep.withTempInput(BaseStep.java:424) at com.openshift.jenkins.plugins.freestyle.RawStep.perform(RawStep.java:47) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:164) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524) at hudson.model.Run.execute(Run.java:1897) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Finished: FAILURE