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

Verifying that tools do not assume sh is in /bin/sh #490

Merged
merged 10 commits into from
Jul 6, 2019

Conversation

jglick
Copy link
Member

@jglick jglick commented Jun 4, 2019

pom.xml Outdated Show resolved Hide resolved
@@ -0,0 +1,7 @@
podTemplate(label: 'bourneShellElsewhereInPath', containers: [containerTemplate(name: 'kaniko', image: 'gcr.io/kaniko-project/executor:debug', command: 'sleep', args: '99d')]) {
node('bourneShellElsewhereInPath') {
container(name: 'kaniko') {
Copy link
Member Author

@jglick jglick Jun 4, 2019

Choose a reason for hiding this comment

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

Without the ContainerExecDecorator patch, this fails unless you

-container(name: 'kaniko') {
+container(name: 'kaniko', shell: '/busybox/sh') {

podTemplate(label: 'bourneShellElsewhereInPath', containers: [containerTemplate(name: 'kaniko', image: 'gcr.io/kaniko-project/executor:debug', command: 'sleep', args: '99d')]) {
node('bourneShellElsewhereInPath') {
container(name: 'kaniko') {
sh 'ls -la /'
Copy link
Member Author

@jglick jglick Jun 4, 2019

Choose a reason for hiding this comment

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

Without the BourneShellScript patch, this fails unless you

-sh 'ls -la /'
+sh '''#!/busybox/sh -ex
+    ls -la /
+'''

+ ls -la /
ls: can't open '/': Value too large for defined data type
total 0
Probably due to: https://issues.jenkins-ci.org/browse/JENKINS-46076?focusedCommentId=368388&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-368388
java.lang.AssertionError:

Expected: a string containing "Labels must follow required specs - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set: mypod!123"
     but: was "Started
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] podTemplate
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
"
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:956)
	at org.junit.Assert.assertThat(Assert.java:923)
	at org.jvnet.hudson.test.JenkinsRule.assertLogContains(JenkinsRule.java:1308)
	at org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecutionTest.testBadLabel(PodTemplateStepExecutionTest.java:85)
@Vlatombe
Copy link
Member

Vlatombe commented Jun 7, 2019

I'll hold this until there is a release of durable-task-plugin.

This reverts commit 575a8f8.
Not clear that this would actually fix the flake. RCA in JENKINS-46076.
pom.xml Outdated Show resolved Hide resolved
Co-Authored-By: Devin Nusbaum <dwnusbaum@users.noreply.github.com>
@jglick jglick removed the on hold label Jul 5, 2019
@Vlatombe Vlatombe added the test Tests label Jul 6, 2019
@Vlatombe Vlatombe merged commit ad124ef into jenkinsci:master Jul 6, 2019
@Vlatombe Vlatombe added bug Bug Fixes and removed test Tests labels Jul 8, 2019
@jglick jglick deleted the bourneShellElsewhereInPath branch July 9, 2019 18:07
Vlatombe added a commit that referenced this pull request Sep 12, 2019
Not needed anymore since #490
Vlatombe added a commit to Vlatombe/kubernetes-plugin that referenced this pull request Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants