Bug 1679937
| Summary: | oc cmd doesn't work in jenkins build step 'OpenShift - Generic OC Invocation' | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | XiuJuan Wang <xiuwang> |
| Component: | ImageStreams | Assignee: | Gabe Montero <gmontero> |
| Status: | CLOSED ERRATA | QA Contact: | XiuJuan Wang <xiuwang> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 4.1.0 | CC: | aos-bugs, bparees, jokerman, mmccomas, wzheng, xiuwang |
| Target Milestone: | --- | Keywords: | Regression |
| Target Release: | 4.1.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Known Issue | |
| Doc Text: |
Cause: compatibility between java based jenkins process launching and golang based oc argument processing is sometime incompatable; for example, on `oc get`, you must use `type/name`, not `type name`
Consequence: not every possible argument combination from the linux command line is possible from the jenkins; you have to use the valid forms
Fix: update the UI help to inform users of some of the restrictions
Result: users will know what form to use
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-06-04 10:44:26 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
XiuJuan Wang
2019-02-22 09:41:27 UTC
Should be able to address this in time, but given the infrequency of freestyle jobs and client plugin we see (I might remember 1 github issue *ever*, very early on, and no support cases) Marking both priority and severity as low OK this is different than what I thought. There is some difference in how `oc` works when launched via process string from Jenkins than it does when launched from the command line. Jenkins must be setting the args in the actual process fork in a way that is confusing `oc`. I can confirm that like XiuJuan manually running the command exactly as we pass it Jenkins, it works. Now, If you change "pod hello-openshift" to "pod/hello-openshift" in the "Arguments associated with the above command", with "get" in the "Command to pass into the `oc` binary", then it works from Jenkins with the freestyle build step. By the way, when you leverage the pipeline dsl form of this, the plugin constructs the command line as "pod/hello-openshift". Pretty sure that is a workaround for this issue. Now, I ran with -loglevel=10 on the jenkins run, and it wants to treat "pod <podname>" as the actual type, vs. type/name. Jenkins must someone group the name and type with a space in between as one arg from the oc/golang perspective. So ACTION PLAN: 1) XiuJuan - re-run where you change "pod hello-openshift" to "pod/hello-openshift" in the "Arguments associated with the above command", with "get" in the "Command to pass into the `oc` binary" and confirm it works for you too 2) if so, I'll use this bug to update the help text in the Jenkins UI, and that is all we do getting kube/cli fixes to deal with getting forked by Jenkins API is a lost cause Gabe So ACTION PLAN: 1)re-run where you change "pod hello-openshift" to "pod/hello-openshift" in the "Arguments associated with the above command", with "get" in the "Command to pass into the `oc` binary" This works for me Thanks! plugin PR has merged Next steps: - cut a new version of the plugin - update the image v1.0.27 of the client plugin has been generated with the new field help for the Jenkins UI panel for client plugin free style jobs image PR will get created when the version is available at the jenkins update center ok new rpm has been cut in osbs/distgit via http://pkgs.devel.redhat.com/cgit/rpms/jenkins-2-plugins/commit/?h=rhaos-4.0-rhel-7&id=af50d53fa52ca60840c40f26af2c02a26963817e sending to QE to look out for the next ocp build with that to verify new help text is available The help doc have updated with registry.svc.ci.openshift.org/ocp/4.0-2019-03-07-043538@sha256:3ae4400256748815121ffb2e09e341802abe0d90afbba8e7a41ad45efb9bd73c The arguments associated with the command provided. Note, if you are to operate on a specific type and instance of an API object, like `oc get pod `, you have to use the form `oc get pod/`. The space separator between type and instance ID is not supported. Mark this to verified. Thanks Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0758 |