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-53422] Declarative: do not wrap steps with container statement unless default container is changed #377

Merged

Conversation

vfreex
Copy link
Contributor

@vfreex vfreex commented Sep 4, 2018

We met a weird issue when migrating the scripted syntax to declarative
with Kubernetes plugin: The Launcher doesn't forward stdin,
stdout, or stderr even though they are requested to be forwarded.
This breaks many plugins that use Launcher to start a remote process on Jenkins slaves.

This happens because when Kubernetes plugin converts declarative syntax to scripted syntax,
all build steps are enclosed with a container statement.
As a result, remote commands are run via the Kubernetes exec API rather than
the jnlp agent.

Since running steps via Kubernetes exec API is still considered ALPHA
and there are some compatibility issues to solve,
I would like to make a small change to the syntax converting process:
The declarative steps will not be enclosed with a container statement unless
an alternate default container is specified by the pipeline user.

Issue link: https://issues.jenkins-ci.org/browse/JENKINS-53422

@vfreex vfreex changed the title Declarative: do not wrap steps with container statement unless Declarative: do not wrap steps with container statement unless default container is changed Sep 4, 2018
@vfreex vfreex force-pushed the declarative-not-using-container-step branch 2 times, most recently from aeeb027 to b475c5f Compare September 4, 2018 15:17
container is changed

We met a weird issue when migrating the scripted syntax to declarative
with Kubernetes plugin: The `Launcher` doesn't forward `stdin`,
`stdout`, or `stderr` even though they are requested to be forwarded.
This breaks many plugins that use `Launcher` to start a remote process on Jenkins slaves.

This happens because when Kubernetes plugin converts declarative syntax to scripted syntax,
all build steps are enclosed with a `container` statement.
As a result, remote commands are run via the Kubernetes exec API rather than
the jnlp agent.

Since running steps via Kubernetes exec API is still considered ALPHA
and there are some compatibility issues to solve,
I would like to make a small change to the syntax converting process:
The declarative steps will not be enclosed with a `container` statement unless
an alternate default container is specified by the pipeline user.
@vfreex vfreex force-pushed the declarative-not-using-container-step branch from b475c5f to f188a8c Compare September 4, 2018 15:50
@carlossg carlossg changed the title Declarative: do not wrap steps with container statement unless default container is changed [JENKINS-53422] Declarative: do not wrap steps with container statement unless default container is changed Oct 17, 2018
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.

3 participants