Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-41287] Fix error when job contains spaces #131

Merged
merged 1 commit into from
Feb 13, 2017
Merged

Conversation

carlossg
Copy link
Contributor

https://issues.jenkins-ci.org/browse/JENKINS-41287

[job with spaces] Running shell script
Executing shell script inside container [busybox] of pod [kubernetes-8557fdf9781e4cf2a61886465194237f-38066e920443]
Executing command: sh -c echo $$ > '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/pid'; jsc=durable-e34518f433054f84ad6d3027eca192a2; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/script.sh' > '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/jenkins-result.txt'
/home/jenkins # cd "/home/jenkins/workspace/job with spaces"
/home/jenkins/workspace/job with spaces # sh -c echo $$ > '/home/jenkins/workspa

ce/job with spaces@tmp/durable-aa4b60a9/pid'; jsc=durable-e34518f433054f84ad6d30

27eca192a2; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/job with spaces@

tmp/durable-aa4b60a9/script.sh' > '/home/jenkins/workspace/job with spaces@tmp/d

urable-aa4b60a9/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/job wi

th spaces@tmp/durable-aa4b60a9/jenkins-result.txt'
/home/jenkins/workspace/job with spaces # exit
+ pwd
/home/jenkins/workspace/job with spaces

```
[job with spaces] Running shell script
Executing shell script inside container [busybox] of pod [kubernetes-8557fdf9781e4cf2a61886465194237f-38066e920443]
Executing command: sh -c echo $$ > '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/pid'; jsc=durable-e34518f433054f84ad6d3027eca192a2; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/script.sh' > '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/job with spaces@tmp/durable-aa4b60a9/jenkins-result.txt'
/home/jenkins # cd "/home/jenkins/workspace/job with spaces"
/home/jenkins/workspace/job with spaces # sh -c echo $$ > '/home/jenkins/workspa

ce/job with spaces@tmp/durable-aa4b60a9/pid'; jsc=durable-e34518f433054f84ad6d30

27eca192a2; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/job with spaces@

tmp/durable-aa4b60a9/script.sh' > '/home/jenkins/workspace/job with spaces@tmp/d

urable-aa4b60a9/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/job wi

th spaces@tmp/durable-aa4b60a9/jenkins-result.txt'
/home/jenkins/workspace/job with spaces # exit
+ pwd
/home/jenkins/workspace/job with spaces
```
@@ -122,7 +122,7 @@ public void onClose(int i, String s) {

//We need to get into the project workspace.
//The workspace is not known in advance, so we have to execute a cd command.
watch.getInput().write(("cd " + path + NEWLINE).getBytes(StandardCharsets.UTF_8));
watch.getInput().write(String.format("cd \"%s\"%s", path, NEWLINE).getBytes(StandardCharsets.UTF_8));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a change just for efficiency or there is more into it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the path quotes were missing

@iocanel iocanel merged commit f91f9a5 into master Feb 13, 2017
@carlossg carlossg deleted the JENKINS-41287 branch February 13, 2017 11:25
jglick added a commit to jglick/kubernetes-plugin that referenced this pull request Jun 10, 2019
…x a flake in PodTemplateStepExecutionTest.testBadLabel.
Vlatombe added a commit that referenced this pull request Jun 27, 2019
[JENKINS-46076] Hoping that workflow-job-plugin #131 will fix a flake in PodTemplateStepExecutionTest.testBadLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants